Skip to content

Commit 2a65c9d

Browse files
update installation script for conda/ubuntu users without sudo access (#127)
* update installation script for conda/ubuntu users without sudo access * remove older functions from the script
1 parent 59d2b45 commit 2a65c9d

File tree

1 file changed

+38
-6
lines changed

1 file changed

+38
-6
lines changed

scripts/install.sh

Lines changed: 38 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ set -euo pipefail
1010
# Colors for output
1111
GREEN='\033[0;32m'
1212
RED='\033[0;31m'
13+
YELLOW='\033[0;33m'
1314
NC='\033[0m'
1415

1516
log_info() { echo -e "${GREEN}[INFO]${NC} $1"; }
1617
log_error() { echo -e "${RED}[ERROR]${NC} $1"; }
18+
log_warning() { echo -e "${YELLOW}[WARNING]${NC} $1";}
1719

1820
# Configuration
1921
PYTORCH_VERSION="2.9.0.dev20250828"
@@ -34,20 +36,49 @@ check_conda_env() {
3436
log_info "Installing in conda environment: $CONDA_DEFAULT_ENV"
3537
}
3638

37-
# Check sudo access
39+
# Check sudo access and if it is not available; continue with Conda
3840
check_sudo() {
3941
if ! sudo -n true 2>/dev/null; then
40-
log_error "This script requires passwordless sudo access for system packages"
41-
log_info "Run 'sudo -v' first, or configure passwordless sudo"
42-
exit 1
42+
log_warning "Passwordless sudo access is not available."
43+
log_info "The script will continue and attempt to install packages via conda instead."
44+
else
45+
log_info "Passwordless sudo access detected."
4346
fi
4447
}
4548

4649
# Install required system packages
4750
install_system_packages() {
4851
log_info "Installing required system packages..."
49-
sudo dnf install -y libibverbs rdma-core libmlx5 libibverbs-devel rdma-core-devel
50-
log_info "System packages installed successfully"
52+
# Check for sudo access
53+
if sudo -n true 2>/dev/null; then
54+
# Detect OS and install packages accordingly
55+
if [ -f /etc/fedora-release ]; then
56+
log_info "Detected Fedora OS"
57+
sudo dnf install -y libibverbs rdma-core libmlx5 libibverbs-devel rdma-core-devel
58+
elif [ -f /etc/lsb-release ] || [ -f /etc/ubuntu-release ]; then
59+
log_info "Detected Ubuntu OS"
60+
sudo apt-get update
61+
sudo apt-get install -y libibverbs1 rdma-core libmlx5-1 libibverbs-dev rdma-core-dev
62+
else
63+
log_error "Unsupported OS for automatic system package installation"
64+
exit 1
65+
fi
66+
log_info "System packages installed successfully"
67+
else
68+
log_warning "No sudo access detected. Attempting to install packages via conda."
69+
conda install -c conda-forge rdma-core libibverbs-cos7-x86_64 -y
70+
log_info "Conda package installation attempted. Please ensure the packages are installed correctly."
71+
fi
72+
}
73+
74+
# Check to see if gh is installed, if not, it will be installed via conda-forge channel
75+
check_gh_install() {
76+
if ! command -v gh &> /dev/null; then
77+
log_warning "GitHub CLI (gh) not found. Installing via Conda..."
78+
conda install gh --channel conda-forge -y
79+
else
80+
log_info "GitHub CLI (gh) already installed."
81+
fi
5182
}
5283

5384
# Check wheels exist
@@ -126,6 +157,7 @@ main() {
126157
conda install -y openssl
127158

128159
install_system_packages
160+
check_gh_install
129161
download_vllm_wheel
130162

131163
log_info "Installing PyTorch nightly..."

0 commit comments

Comments
 (0)