Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Conversation

@hiento09
Copy link
Contributor

@hiento09 hiento09 commented Nov 14, 2023

This pull request introduces a new install.sh script to the codebase. This script is designed to automate the installation process of the project's dependencies and the project itself, making it easier for users to get started.
Key features of the script include:

  1. Checking for root privileges: The script ensures it is run with root privileges, preventing potential permission issues during installation.
  2. Checking and suggesting installation of jq and unzip: If these dependencies are not found, the script will provide the user with instructions on how to install them.
  3. Downloading and installing Nitro: The script automatically downloads the appropriate version of Nitro based on the user's operating system and architecture. It also handles the extraction and installation of the downloaded files.
  4. Creating an uninstall script: An uninstall script is automatically generated and placed in the appropriate directory, allowing users to easily remove the installed files if necessary.
  5. Enhanced user experience: The script provides clear and colored output messages to guide the user through the installation process.

Task:

  • install.sh for linux and macos
  • install.bat for windows

Quick test, default is CPU option and latest nitro version:

  • Linux and macos: curl -sfL https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.sh | sudo /bin/bash -
  • Linux and macos with a specific version: curl -sfL https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.sh -o /tmp/install.sh && sudo bash /tmp/install.sh --version 0.1.7 && rm /tmp/install.sh
  • Linux GPU: curl -sfL https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.sh -o /tmp/install.sh && sudo bash /tmp/install.sh --gpu && rm /tmp/install.sh
  • Linux GPU with a specific version: curl -sfL https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.sh -o /tmp/install.sh && sudo bash /tmp/install.sh --gpu --version 0.1.7 && rm /tmp/install.sh
  • windows CPU: powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.bat' -OutFile 'install.bat'; .\install.bat; Remove-Item -Path 'install.bat' }"
  • windows CPU with a specific version: powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.bat' -OutFile 'install.bat'; .\install.bat --version 0.1.7; Remove-Item -Path 'install.bat' }"
  • windows GPU: powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.bat' -OutFile 'install.bat'; .\install.bat --gpu; Remove-Item -Path 'install.bat' }"
  • windows GPU with a specific version: powershell -Command "& { Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/janhq/nitro/feature/install-script/install.bat' -OutFile 'install.bat'; .\install.bat --gpu --version 0.1.7; Remove-Item -Path 'install.bat' }"

Usage

After installing nitro on your os, open another terminal or powershell and just type nitro (or nitro.exe on windows) then press enter, nitro server will be started and you can start using it from now.

  • Windows Result:
    image

  • Linux Result:
    image

  • Mac Silicon result:

To uninstall nitro:

  • On linux and mac just run sudo uninstall_nitro.sh from any where since the script is added to PATH
  • On windows open powershell and run uninstallnitro.bat from any where since the script is added to PATH

@hiento09 hiento09 added the type: feature request A new feature label Nov 14, 2023
@hiento09 hiento09 added this to the Nitro v0.3.0 milestone Nov 14, 2023
@hiento09 hiento09 self-assigned this Nov 14, 2023
@hiento09 hiento09 merged commit e0cef1e into main Nov 14, 2023
@dan-menlo
Copy link
Contributor

Really good work, @hiento09!

@hiro-v hiro-v deleted the feature/install-script branch November 20, 2023 16:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants