diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93b529099..9cd93ab96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,22 +73,11 @@ jobs: run: | mkdir -p nitro cp build/nitro nitro/ - zip -r nitro.zip nitro tar -czvf nitro.tar.gz nitro # run e2e testing cd nitro chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }} - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.zip - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-linux-amd64.zip - asset_content_type: application/zip - - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -132,22 +121,11 @@ jobs: run: | mkdir -p nitro cp build/nitro nitro/ - zip -r nitro.zip nitro tar -czvf nitro.tar.gz nitro # run e2e testing cd nitro chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }} - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.zip - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-linux-amd64-cuda.zip - asset_content_type: application/zip - - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -193,22 +171,11 @@ jobs: mkdir -p nitro cp llama.cpp/ggml-metal.metal nitro/ cp build/nitro nitro/ - zip -r nitro.zip nitro tar -czvf nitro.tar.gz nitro # run e2e testing cd nitro chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }} - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.zip - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-arm64.zip - asset_content_type: application/zip - - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -252,21 +219,11 @@ jobs: run: | mkdir -p nitro cp build/nitro nitro/ - zip -r nitro.zip nitro tar -czvf nitro.tar.gz nitro # run e2e testing cd nitro chmod +x ../.github/scripts/e2e-test-linux-and-mac.sh && ../.github/scripts/e2e-test-linux-and-mac.sh ./nitro ${{ env.MODEL_URL }} - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.zip - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-amd64.zip - asset_content_type: application/zip - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -332,23 +289,11 @@ jobs: run: | robocopy build_deps\_install\bin .\build\Release zlib.dll robocopy build\bin\Release .\build\Release llama.dll - 7z a nitro.zip .\build\Release\* 7z a -ttar temp.tar .\build\Release\* 7z a -tgzip nitro.tar.gz temp.tar cd .\build\Release ..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }} - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.zip - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64.zip - asset_content_type: application/zip - - - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -404,21 +349,11 @@ jobs: set PATH=%PATH%;C:\Program Files\7-Zip\ robocopy build_deps\_install\bin .\build\Release zlib.dll robocopy build\bin\Release .\build\Release llama.dll - 7z a nitro.zip .\build\Release\* 7z a -ttar temp.tar .\build\Release\* 7z a -tgzip nitro.tar.gz temp.tar cd .\build\Release ..\..\.github\scripts\e2e-test-windows.bat .\nitro.exe ${{ env.MODEL_URL }} - - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.zip - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-cuda.zip - asset_content_type: application/zip + - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: diff --git a/docs/src/containers/DownloadButton/index.js b/docs/src/containers/DownloadButton/index.js index 83d7914f2..b506ab372 100644 --- a/docs/src/containers/DownloadButton/index.js +++ b/docs/src/containers/DownloadButton/index.js @@ -8,17 +8,17 @@ const systemsTemplate = [ { name: "Download for Mac", logo: require("@site/static/img/logos/apple-logo-white.png").default, - fileFormat: "{appname}-mac-arm64.zip", + fileFormat: "{appname}-mac-arm64.tar.gz", }, { name: "Download for Windows", logo: require("@site/static/img/logos/windows-logo-white.png").default, - fileFormat: "{appname}-win-amd64.zip", + fileFormat: "{appname}-win-amd64.tar.gz", }, { name: "Download for Linux", logo: require("@site/static/img/logos/linux-logo-white.png").default, - fileFormat: "{appname}-linux-amd64.zip", + fileFormat: "{appname}-linux-amd64.tar.gz", }, ]; diff --git a/docs/src/containers/Homepage/GetNitro/index.js b/docs/src/containers/Homepage/GetNitro/index.js index b091bf191..a36932710 100644 --- a/docs/src/containers/Homepage/GetNitro/index.js +++ b/docs/src/containers/Homepage/GetNitro/index.js @@ -15,7 +15,7 @@ export default function GetNitro() { ? `powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/nitro/main/install.bat' -OutFile 'install.bat'; .\install.bat; Remove-Item -Path 'install.bat' }"` : `curl -sfL https://raw.githubusercontent.com/janhq/nitro/main/install.sh | sudo /bin/bash -`; - const codeStringNpm = `#(Coming Soon)\nnpm install @janhq/nitro`; + const codeStringNpm = `npm install @janhq/nitro`; const codeStringPython = `#(Coming Soon)\npip install @janhq/nitro`; const [packageInstall, setPackageInstall] = useState("Shell script"); diff --git a/examples/example-docker/Dockerfile b/examples/example-docker/Dockerfile index 23459def3..1e727826a 100644 --- a/examples/example-docker/Dockerfile +++ b/examples/example-docker/Dockerfile @@ -6,11 +6,11 @@ WORKDIR /app # Install curl, unzip, and numactl, download the file, unzip it, then remove unnecessary packages RUN apt-get update && \ - apt-get install -y curl unzip numactl && \ - curl -L "https://github.com/janhq/nitro/releases/download/v0.1.14/nitro-0.1.14-linux-amd64.zip" -o nitro.zip && \ - unzip nitro.zip && \ - rm nitro.zip && \ - apt-get remove --purge -y curl unzip && \ + apt-get install -y curl tar gzip numactl && \ + curl -L "https://github.com/janhq/nitro/releases/download/v0.1.17/nitro-0.1.17-linux-amd64.tar.gz" -o nitro.tar.gz && \ + tar -xzvf nitro.tar.gz && \ + rm nitro.tar.gz && \ + apt-get remove --purge -y curl tar gzip && \ apt-get autoremove -y && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/install.bat b/install.bat index 9c1b4bf7c..2a17db9d0 100644 --- a/install.bat +++ b/install.bat @@ -42,13 +42,13 @@ if "%GPU%"=="true" ( :: If --gpu option is provided, append -cuda to the URL set "URL=%URL%-cuda" ) -set "URL=%URL%.zip" +set "URL=%URL%.tar.gz" :: Download and extract nitro echo Downloading Nitro from: %URL% -powershell -Command "Invoke-WebRequest -OutFile '%TEMP%\nitro.zip' '%URL%'" +powershell -Command "Invoke-WebRequest -OutFile '%TEMP%\nitro.tar.gz' '%URL%'" echo Extracting Nitro... -powershell -Command "Expand-Archive -Path '%TEMP%\nitro.zip' -DestinationPath '%APPDATA%\nitro'" +powershell -Command "Expand-Archive -Path '%TEMP%\nitro.tar.gz' -DestinationPath '%APPDATA%\nitro'" :: Add nitro to the PATH setx PATH "%APPDATA%\nitro;%PATH%" @@ -59,6 +59,6 @@ echo setx PATH "%PATH:;%APPDATA%\nitro=;%"" >> "%APPDATA%\nitro\uninstallnitro.b echo rmdir /S /Q "%APPDATA%\nitro" >> "%APPDATA%\nitro\uninstallnitro.bat" :: Clean up -del %TEMP%\nitro.zip +del %TEMP%\nitro.tar.gz endlocal \ No newline at end of file diff --git a/install.sh b/install.sh index f42403c8b..54d8b473d 100755 --- a/install.sh +++ b/install.sh @@ -6,8 +6,8 @@ if [ "$(id -u)" != "0" ]; then exit 1 fi -# Check and suggest installing jq and unzip if not present -check_install_jq_unzip() { +# Check and suggest installing jq and tar if not present +check_install_jq_tar() { RED='\033[0;31m' GREEN='\033[0;32m' NC='\033[0m' # No Color @@ -25,15 +25,15 @@ check_install_jq_unzip() { fi fi - if ! command -v unzip &> /dev/null; then - echo -e "${RED}unzip could not be found ...${NC}" + if ! command -v tar &> /dev/null; then + echo -e "${RED}tar could not be found ...${NC}" if [[ "$OS" == "Linux" ]]; then - echo -e "${GREEN}Please run the command below to install unzip then rerun this script${NC}" - echo "$ sudo apt-get install unzip" + echo -e "${GREEN}Please run the command below to install tar then rerun this script${NC}" + echo "$ sudo apt install tar gzip" exit 1 elif [[ "$OS" == "Darwin" ]]; then - echo -e "${GREEN}Please run the command below to install unzip then rerun this script${NC}" - echo "$ brew install unzip" + echo -e "${GREEN}Please run the command below to install tar then rerun this script${NC}" + echo "$ brew install gnu-tar" exit 1 fi fi @@ -42,10 +42,10 @@ check_install_jq_unzip() { # Function to download and install nitro install_nitro() { rm -rf /tmp/nitro - rm /tmp/nitro.zip + rm /tmp/nitro.tar.gz echo "Downloading Nitro version $VERSION... from $1" - curl -sL "$1" -o /tmp/nitro.zip - unzip /tmp/nitro.zip -d /tmp + curl -sL "$1" -o /tmp/nitro.tar.gz + tar -xzvf /tmp/nitro.tar.gz -C /tmp ls /tmp/nitro # Copying files to /usr/local/bin @@ -77,7 +77,7 @@ ARCH=$(uname -m) VERSION="latest" GPU="" -check_install_jq_unzip +check_install_jq_tar # Parse arguments for arg in "$@" @@ -116,11 +116,11 @@ fi # Construct download URL based on OS, ARCH, GPU and VERSION case $OS in Linux) - FILE_NAME="nitro-${VERSION}-linux-amd64${GPU}.zip" + FILE_NAME="nitro-${VERSION}-linux-amd64${GPU}.tar.gz" ;; Darwin) ARCH_FORMAT=$( [[ "$ARCH" == "arm64" ]] && echo "mac-arm64" || echo "mac-amd64") - FILE_NAME="nitro-${VERSION}-${ARCH_FORMAT}.zip" + FILE_NAME="nitro-${VERSION}-${ARCH_FORMAT}.tar.gz" ;; *) echo "Unsupported OS."