diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a3c50f2bbb..3f88715874 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -195,12 +195,22 @@ jobs: - name: Setup Rust toolchain for s3s-e2e installation uses: dtolnay/rust-toolchain@stable + # s3s-e2e depends on aws-lc-sys (CMake) and other native crates; minimal runners may omit these. + - name: Install build dependencies for s3s-e2e + run: | + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \ + build-essential \ + cmake \ + pkg-config \ + libssl-dev + - name: Install s3s-e2e test tool uses: taiki-e/cache-cargo-install-action@v2 with: tool: s3s-e2e git: https://github.com/s3s-project/s3s.git - rev: 4a04a670cf41274d9be9ab65dc36f4aa3f92fbad + rev: da276469212a6d57ac5a6bf831e6af41e0646785 - name: Run end-to-end tests run: | @@ -234,6 +244,17 @@ jobs: - name: Make binary executable run: chmod +x ./target/debug/rustfs + # Same as e2e-s3tests.yml: provision awscurl (admin API SigV4) and tox before run.sh. + # Minimal images may ship python3 without pip (No module named pip). + # Ubuntu/Debian PEP 668 (externally-managed-environment) rejects plain --user installs; use + # --break-system-packages for CI-only user-site installs (same fallback as scripts/s3-tests/run.sh). + - name: Install Python tools + run: | + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip + python3 -m pip install --user --break-system-packages --upgrade pip awscurl tox + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + - name: Run implemented s3-tests run: | DEPLOY_MODE=binary \ diff --git a/.github/workflows/e2e-s3tests.yml b/.github/workflows/e2e-s3tests.yml index a2a8829ae5..213061ca16 100644 --- a/.github/workflows/e2e-s3tests.yml +++ b/.github/workflows/e2e-s3tests.yml @@ -78,7 +78,9 @@ jobs: - name: Install Python tools run: | - python3 -m pip install --user --upgrade pip awscurl tox + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip + python3 -m pip install --user --break-system-packages --upgrade pip awscurl tox echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Enable buildx @@ -240,7 +242,9 @@ jobs: - name: Install Python tools run: | - python3 -m pip install --user --upgrade pip awscurl tox + sudo apt-get update + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip + python3 -m pip install --user --break-system-packages --upgrade pip awscurl tox echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Enable buildx diff --git a/scripts/s3-tests/run.sh b/scripts/s3-tests/run.sh index ced0ecbb62..4f4fd37035 100755 --- a/scripts/s3-tests/run.sh +++ b/scripts/s3-tests/run.sh @@ -723,6 +723,32 @@ install_python_package() { local package=$1 local error_output + # Debian/Ubuntu minimal images often have python3 but no pip (No module named pip). + if ! python3 -m pip --version >/dev/null 2>&1; then + if command -v apt-get >/dev/null 2>&1; then + log_warn "python3 has no pip; installing python3-pip via apt..." + if [ "$(id -u)" -eq 0 ]; then + apt-get update -qq + DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip || { + log_error "Failed to install python3-pip via apt-get" + return 1 + } + elif command -v sudo >/dev/null 2>&1; then + sudo apt-get update -qq + sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip || { + log_error "Failed to install python3-pip via apt-get" + return 1 + } + else + log_error "python3 has no pip. Install python3-pip (or ensure pip) and retry." + return 1 + fi + else + log_error "python3 has no pip. Install pip (e.g. python3-pip on Debian/Ubuntu) and retry." + return 1 + fi + fi + # Try --user first (works on most Linux systems) error_output=$(python3 -m pip install --user --upgrade pip "${package}" 2>&1) if [ $? -eq 0 ]; then