Skip to content

Commit 25c2354

Browse files
committed
Dockerfile changes
1 parent 1be130f commit 25c2354

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

Dockerfile

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
ARG TARGET=base
44
ARG BASE_IMAGE=ubuntu:22.04
5+
ARG BASE_IMAGE_COLOCATED=us-docker.pkg.dev/cloud-tpu-v2-images/pathways-colocated-python/sidecar:2025_10_06-python_3.10-jax_0.6.2
56

67
FROM ${BASE_IMAGE} AS base
78

@@ -106,6 +107,30 @@ RUN if [ "$INSTALL_PATHWAYS_JAXLIB" = "true" ]; then \
106107
fi
107108
COPY . .
108109

110+
################################################################################
111+
# Colocated Python container spec. #
112+
################################################################################
113+
114+
FROM ${BASE_IMAGE_COLOCATED} as colocated-python
115+
116+
WORKDIR /app
117+
COPY . .
118+
119+
# Install the additional user-provided dependencies, strictly enforcing the rules
120+
# from the base image's constraints file.
121+
RUN \
122+
echo "--> Installing user-provided dependencies..." && \
123+
uv pip install ".[core,gcp]" -c /opt/venv/server_constraints.txt && \
124+
\
125+
# 2. Verify that the colocated_python_cpu_client is present.
126+
echo "--> Verifying JAX patch integrity..." && \
127+
python -c "from jax._src.lib import _jax; _jax.colocated_python_cpu_client" && \
128+
echo "--> JAX patch verification successful." && \
129+
\
130+
# 3. Clean the cache to keep the image slim.
131+
uv cache clean
132+
133+
109134
################################################################################
110135
# GPU container spec. #
111136
################################################################################
@@ -125,4 +150,4 @@ COPY . .
125150
# Final target spec. #
126151
################################################################################
127152

128-
FROM ${TARGET} AS final
153+
FROM ${TARGET} AS final

0 commit comments

Comments
 (0)