Skip to content

ci: install python3-pip before awscurl/tox on minimal runners#11

Open
andybrown668 wants to merge 4 commits into
mainfrom
ci/install-python3-pip-for-s3-tests
Open

ci: install python3-pip before awscurl/tox on minimal runners#11
andybrown668 wants to merge 4 commits into
mainfrom
ci/install-python3-pip-for-s3-tests

Conversation

@andybrown668
Copy link
Copy Markdown

Type of Change

  • New Feature
  • Bug Fix
  • Documentation
  • Performance Improvement
  • Test/CI
  • Refactor
  • Other:

Related Issues

N/A

Summary of Changes

Minimal CI images (e.g. Ubicloud) ship python3 without pip, which breaks python3 -m pip install awscurl and caused S3 Implemented Tests to fail with No module named pip.

  • Install python3-pip via apt in Install Python tools steps in .github/workflows/ci.yml and .github/workflows/e2e-s3tests.yml, then install awscurl and tox with pip as before.
  • In scripts/s3-tests/run.sh, if pip is missing, install python3-pip via apt when apt-get and sudo are available so local runs match CI behavior.

Checklist

  • I have read and followed the CONTRIBUTING.md guidelines
  • Passed make pre-commit
  • Added/updated necessary tests
  • Documentation updated (if needed)
  • CI/CD passed (if applicable)

Verification

make pre-commit

Impact

  • Breaking change (compatibility)
  • Requires doc/config/deployment update
  • Other impact: CI and optional local s3-tests setup only; no runtime behavior change for RustFS.

Additional Notes

N/A


Thank you for your contribution! Please ensure your PR follows the community standards (CODE_OF_CONDUCT.md). If this is your first contribution, review the CLA document and sign it by commenting I have read and agree to the CLA. on the PR.

Copilot AI review requested due to automatic review settings April 9, 2026 16:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR hardens RustFS CI and local S3 test tooling on minimal Linux runners where python3 is present but pip is missing, preventing awscurl/tox installation and breaking S3 test execution.

Changes:

  • Install python3-pip via apt-get in GitHub Actions workflows before installing awscurl and tox.
  • Add a fallback in scripts/s3-tests/run.sh to install python3-pip via apt-get when pip is missing (and apt-get/sudo are available).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
scripts/s3-tests/run.sh Adds a runtime check to provision python3-pip on Debian/Ubuntu-like environments when pip is missing.
.github/workflows/e2e-s3tests.yml Ensures python3-pip is installed on minimal runners before pip install awscurl tox in both single/multi jobs.
.github/workflows/ci.yml Installs python3-pip before running implemented S3 tests to avoid No module named pip failures.

Comment thread scripts/s3-tests/run.sh
Comment on lines +726 to +728
# 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
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The python3 -m pip --version check will also fail when python3 itself is missing, but the warning/error messages assume Python is present (“python3 has no pip”). Consider checking command -v python3 first (or distinguish exit codes) so the log guidance is accurate (e.g., install python3 vs install python3-pip).

Suggested change
# 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
# Distinguish between missing python3 and missing pip so remediation is accurate.
if ! command -v python3 >/dev/null 2>&1; then
if command -v apt-get >/dev/null 2>&1; then
log_warn "python3 is missing; installing python3 and python3-pip via apt..."
if [ "$(id -u)" -eq 0 ]; then
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip || {
log_error "Failed to install python3 and 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 python3-pip || {
log_error "Failed to install python3 and python3-pip via apt-get"
return 1
}
else
log_error "python3 is missing. Install python3 and python3-pip, then retry."
return 1
fi
else
log_error "python3 is missing. Install python3 and pip (e.g. python3-pip on Debian/Ubuntu), then retry."
return 1
fi
elif ! python3 -m pip --version >/dev/null 2>&1; then
if command -v apt-get >/dev/null 2>&1; then

Copilot uses AI. Check for mistakes.
Comment thread scripts/s3-tests/run.sh
Comment on lines +731 to +737
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
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apt-get update -qq is executed under set -e, so if it fails the whole script will exit without emitting a log_error, which makes failures harder to diagnose. Consider wrapping apt-get update with an explicit || { log_error ...; return 1; } (or similar) so update failures produce a clear message like the install failure path does.

Suggested change
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
apt-get update -qq || {
log_error "Failed to update apt package index"
return 1
}
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 || {
log_error "Failed to update apt package index"
return 1
}

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings April 14, 2026 13:38
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

run: |
python3 -m pip install --user --upgrade pip awscurl tox
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip
run: |
python3 -m pip install --user --upgrade pip awscurl tox
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip
Comment thread .github/workflows/ci.yml
Comment on lines 243 to 245

- name: Make binary executable
run: chmod +x ./target/debug/rustfs
Comment thread scripts/s3-tests/run.sh
}
elif command -v sudo >/dev/null 2>&1; then
sudo apt-get update -qq
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y python3-pip || {
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
Comment thread .github/workflows/ci.yml
Comment on lines +249 to +255
# 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
Comment thread .github/workflows/ci.yml
Comment on lines +200 to +203
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y \
build-essential \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants