-
Notifications
You must be signed in to change notification settings - Fork 7k
[release auto] add uv and default python in forge #58874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # syntax=docker/dockerfile:1.3-labs | ||
|
|
||
| FROM ubuntu:20.04 | ||
| FROM ubuntu:22.04 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
|
|
@@ -16,17 +16,37 @@ apt-get install -y curl zip clang-12 | |
| ln -s /usr/bin/clang-12 /usr/bin/clang | ||
|
|
||
| # Install miniforge3 | ||
| curl -sfL https://github.com/conda-forge/miniforge/releases/download/25.3.0-1/Miniforge3-25.3.0-1-Linux-aarch64.sh > /tmp/miniforge3.sh | ||
| curl -fsSL https://github.com/conda-forge/miniforge/releases/download/25.3.0-1/Miniforge3-25.3.0-1-Linux-aarch64.sh > /tmp/miniforge3.sh | ||
| bash /tmp/miniforge3.sh -b -u -p /usr/local/bin/miniforge3 | ||
| rm /tmp/miniforge3.sh | ||
| /usr/local/bin/miniforge3/bin/conda init bash | ||
|
|
||
| # Install Bazelisk | ||
| curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64 --output /usr/local/bin/bazelisk | ||
| curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-arm64 --output /usr/local/bin/bazelisk | ||
| chmod +x /usr/local/bin/bazelisk | ||
|
|
||
| ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel | ||
|
|
||
| # Install uv | ||
| curl -fsSL https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/usr/local/bin" sh | ||
|
|
||
| mkdir -p /usr/local/python | ||
| # Install Python using uv | ||
| UV_PYTHON_VERSION=3.10 | ||
| uv python install --install-dir /usr/local/python "$UV_PYTHON_VERSION" | ||
|
|
||
| export UV_PYTHON_INSTALL_DIR=/usr/local/python | ||
| # Make Python from uv the default by creating symlinks | ||
| UV_PYTHON_BIN="$(uv python find --no-project "$UV_PYTHON_VERSION")" | ||
| echo "uv python binary location: $UV_PYTHON_BIN" | ||
| ln -s "$UV_PYTHON_BIN" "/usr/local/bin/python${UV_PYTHON_VERSION}" | ||
| ln -s "$UV_PYTHON_BIN" /usr/local/bin/python3 | ||
| ln -s "$UV_PYTHON_BIN" /usr/local/bin/python | ||
|
|
||
| # As a convention, we pin all python packages to a specific version. This | ||
| # is to to make sure we can control version upgrades through code changes. | ||
| uv pip install --system pip==25.2 cffi==1.16.0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: Inconsistent pip versions across forge Docker imagesThe new forge images install |
||
|
|
||
| EOF | ||
|
|
||
| ENV CC=clang | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| # syntax=docker/dockerfile:1.3-labs | ||
|
|
||
| FROM ubuntu:20.04 | ||
| FROM ubuntu:22.04 | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
|
|
@@ -21,17 +21,37 @@ addgroup --gid 992 docker1 # docker group on buildkite AMI as of 2025-06-07 | |
| ln -s /usr/bin/clang-12 /usr/bin/clang | ||
|
|
||
| # Install miniforge3 | ||
| curl -sfL https://github.com/conda-forge/miniforge/releases/download/25.3.0-1/Miniforge3-25.3.0-1-Linux-x86_64.sh > /tmp/miniforge3.sh | ||
| curl -fsSL https://github.com/conda-forge/miniforge/releases/download/25.3.0-1/Miniforge3-25.3.0-1-Linux-x86_64.sh > /tmp/miniforge3.sh | ||
| bash /tmp/miniforge3.sh -b -u -p /usr/local/bin/miniforge3 | ||
| rm /tmp/miniforge3.sh | ||
| /usr/local/bin/miniforge3/bin/conda init bash | ||
|
|
||
| # Install Bazelisk | ||
| curl -L https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 --output /usr/local/bin/bazelisk | ||
| curl -fsSL https://github.com/bazelbuild/bazelisk/releases/download/v1.19.0/bazelisk-linux-amd64 --output /usr/local/bin/bazelisk | ||
| chmod +x /usr/local/bin/bazelisk | ||
|
|
||
| ln -s /usr/local/bin/bazelisk /usr/local/bin/bazel | ||
|
|
||
| # Install uv | ||
| curl -fsSL https://astral.sh/uv/install.sh | env UV_UNMANAGED_INSTALL="/usr/local/bin" sh | ||
|
|
||
| mkdir -p /usr/local/python | ||
| # Install Python using uv | ||
| UV_PYTHON_VERSION=3.10 | ||
| uv python install --install-dir /usr/local/python "$UV_PYTHON_VERSION" | ||
|
|
||
| export UV_PYTHON_INSTALL_DIR=/usr/local/python | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| # Make Python from uv the default by creating symlinks | ||
| UV_PYTHON_BIN="$(uv python find --no-project "$UV_PYTHON_VERSION")" | ||
| echo "uv python binary location: $UV_PYTHON_BIN" | ||
| ln -s "$UV_PYTHON_BIN" "/usr/local/bin/python${UV_PYTHON_VERSION}" | ||
| ln -s "$UV_PYTHON_BIN" /usr/local/bin/python3 | ||
| ln -s "$UV_PYTHON_BIN" /usr/local/bin/python | ||
|
|
||
| # As a convention, we pin all python packages to a specific version. This | ||
| # is to to make sure we can control version upgrades through code changes. | ||
| uv pip install --system pip==25.2 cffi==1.16.0 | ||
|
|
||
| # A non-root user. Use 2000, which is the same as our buildkite agent VM uses. | ||
| adduser --home /home/forge --uid 2000 forge --gid 100 | ||
| usermod -a -G docker forge | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
export UV_PYTHON_INSTALL_DIRcommand appears to be unnecessary. This environment variable is not a standarduvvariable and does not seem to be used by any subsequent commands in thisRUNblock. Removing it would improve clarity.