Skip to content

Commit

Permalink
Deprecate nitro.zip
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-service-account committed Nov 29, 2023
1 parent f14655b commit e2d9f1a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 92 deletions.
67 changes: 1 addition & 66 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down Expand Up @@ -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/[email protected]
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/[email protected]
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
env:
Expand Down
6 changes: 3 additions & 3 deletions docs/src/containers/DownloadButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
];

Expand Down
10 changes: 5 additions & 5 deletions examples/example-docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
8 changes: 4 additions & 4 deletions install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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%"
Expand All @@ -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
28 changes: 14 additions & 14 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -77,7 +77,7 @@ ARCH=$(uname -m)
VERSION="latest"
GPU=""

check_install_jq_unzip
check_install_jq_tar

# Parse arguments
for arg in "$@"
Expand Down Expand Up @@ -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."
Expand Down

0 comments on commit e2d9f1a

Please sign in to comment.