File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 22
33ARG TARGET=base
44ARG 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
67FROM ${BASE_IMAGE} AS base
78
@@ -106,6 +107,30 @@ RUN if [ "$INSTALL_PATHWAYS_JAXLIB" = "true" ]; then \
106107 fi
107108COPY . .
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
You can’t perform that action at this time.
0 commit comments