From dcc63dc5452c212d5a9e9944a37ade5ff4a3b315 Mon Sep 17 00:00:00 2001 From: Alison Shao <54658187+alisonshao@users.noreply.github.com> Date: Wed, 11 Feb 2026 08:05:29 -0800 Subject: [PATCH] [CI] Guard python3 call in install script for fresh runners (#18609) --- scripts/ci/cuda/ci_install_dependency.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/ci/cuda/ci_install_dependency.sh b/scripts/ci/cuda/ci_install_dependency.sh index 42b48169c..97b3ef310 100755 --- a/scripts/ci/cuda/ci_install_dependency.sh +++ b/scripts/ci/cuda/ci_install_dependency.sh @@ -23,16 +23,13 @@ SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" bash "${SCRIPT_DIR}/../../killall_sglang.sh" echo "CUDA_VISIBLE_DEVICES=${CUDA_VISIBLE_DEVICES:-}" -# Clear torch compilation cache -python3 -c 'import os, shutil, tempfile, getpass; cache_dir = os.environ.get("TORCHINDUCTOR_CACHE_DIR") or os.path.join(tempfile.gettempdir(), "torchinductor_" + getpass.getuser()); shutil.rmtree(cache_dir, ignore_errors=True)' - -# Install apt packages +# Install apt packages (including python3/pip which may be missing on some runners) # Use --no-install-recommends and ignore errors from unrelated broken packages on the runner # The NVIDIA driver packages may have broken dependencies that are unrelated to these packages -apt-get install -y --no-install-recommends git libnuma-dev libssl-dev pkg-config libibverbs-dev libibverbs1 ibverbs-providers ibverbs-utils || { +apt-get install -y --no-install-recommends python3 python3-pip python3-venv git libnuma-dev libssl-dev pkg-config libibverbs-dev libibverbs1 ibverbs-providers ibverbs-utils || { echo "Warning: apt-get install failed, checking if required packages are available..." # Verify the packages we need are actually installed - for pkg in git libnuma-dev libssl-dev pkg-config libibverbs-dev libibverbs1 ibverbs-providers ibverbs-utils; do + for pkg in python3 python3-pip python3-venv git libnuma-dev libssl-dev pkg-config libibverbs-dev libibverbs1 ibverbs-providers ibverbs-utils; do if ! dpkg -l "$pkg" 2>/dev/null | grep -q "^ii"; then echo "ERROR: Required package $pkg is not installed and apt-get failed" exit 1 @@ -41,6 +38,9 @@ apt-get install -y --no-install-recommends git libnuma-dev libssl-dev pkg-config echo "All required packages are already installed, continuing..." } +# Clear torch compilation cache +python3 -c 'import os, shutil, tempfile, getpass; cache_dir = os.environ.get("TORCHINDUCTOR_CACHE_DIR") or os.path.join(tempfile.gettempdir(), "torchinductor_" + getpass.getuser()); shutil.rmtree(cache_dir, ignore_errors=True)' + # Check if protoc of correct architecture is already installed if command -v protoc >/dev/null 2>&1; then if protoc --version >/dev/null 2>&1; then @@ -93,8 +93,8 @@ else echo "protoc already installed: $(protoc --version)" fi -# Install uv -pip install --upgrade pip +# Install uv (use python3 -m pip for robustness since some runners only have pip3) +python3 -m pip install --upgrade pip if [ "$IS_BLACKWELL" = "1" ]; then # The blackwell CI runner has some issues with pip and uv,