Skip to content

Commit 1119f84

Browse files
committed
Install to global /opt/venv
1 parent 19b1ca2 commit 1119f84

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.github/container/Dockerfile.base

+11-6
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ ARG CLANG_VERSION=18
88
## Obtain GCP's NCCL TCPx plugin
99
###############################################################################
1010

11-
FROM us-docker.pkg.dev/gce-ai-infra/gpudirect-tcpx/nccl-plugin-gpudirecttcpx:v3.1.10 as tcpx-installer-amd64
11+
FROM us-docker.pkg.dev/gce-ai-infra/gpudirect-tcpx/nccl-plugin-gpudirecttcpx:v3.1.10 AS tcpx-installer-amd64
1212

1313
# make a stub arm64 container because GCP does not provide an arm64 version of the plugin
14-
FROM ubuntu as tcpx-installer-arm64
14+
FROM ubuntu AS tcpx-installer-arm64
1515
RUN <<"OUTEREOF" bash -ex
1616
mkdir -p /scripts /var/lib/tcpx/lib64
1717
echo '#!/bin/bash' > /scripts/container_entry.sh
1818
chmod +x /scripts/container_entry.sh
1919
OUTEREOF
2020

21-
FROM tcpx-installer-${TARGETARCH} as tcpx-installer
21+
FROM tcpx-installer-${TARGETARCH} AS tcpx-installer
2222
RUN /scripts/container_entry.sh install
2323

2424
###############################################################################
@@ -51,14 +51,16 @@ apt_packages=(
5151
liblzma-dev
5252
python-is-python3
5353
python3-pip
54+
python3-venv
5455
rsync
5556
vim
5657
wget
5758
jq
5859
# llvm.sh
59-
lsb-release software-properties-common
60+
lsb-release
61+
software-properties-common
6062
# GCP autoconfig
61-
pciutils hwloc bind9-host
63+
# pciutils hwloc bind9-host
6264
)
6365
if [[ $(dpkg --print-architecture) == arm64 ]]; then
6466
# h5py: The newest release of of h5py (3.11.0) does not include ARM wheels and causes pip to build h5py.
@@ -125,7 +127,10 @@ git apply </opt/pip/pip-vcs-equivalency.patch
125127
git add -u
126128
git commit -m 'Adds JAX_TOOLBOX_VCS_EQUIVALENCY as a trigger to treat all github VCS installs for a package as equivalent. The spec of the last encountered version will be used'
127129
EOF
128-
RUN pip install --upgrade --no-cache-dir -e /opt/pip pip-tools && rm -rf ~/.cache/*
130+
# Create a system-wide venv for the pip-installed world inside the containers
131+
RUN python -m venv --prompt jax /opt/venv && /opt/venv/bin/pip install --no-cache-dir -e /opt/pip pip-tools
132+
# Make sure `python` refers to the venv version
133+
ENV PATH=/opt/venv/bin:${PATH}
129134

130135
###############################################################################
131136
## Install TCPx

0 commit comments

Comments
 (0)