Skip to content

Commit 998b3e3

Browse files
Merge pull request #2898 from AI-Hypercomputer:tests_docker_image
PiperOrigin-RevId: 850456883
2 parents 24d2c1f + fca2c5b commit 998b3e3

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

.github/workflows/UploadDockerImages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ jobs:
102102
dockerfile: ${{ matrix.dockerfile }}
103103
maxtext_sha: ${{ needs.setup.outputs.maxtext_sha }}
104104
image_date: ${{ needs.setup.outputs.image_date }}
105+
base_image: gcr.io/tpu-prod-env-multipod/maxtext_jax_stable:${{ needs.setup.outputs.image_date }}
105106
is_post_training: true
106107

107108
gpu-pre-training:

.github/workflows/build_and_push_docker_image.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ on:
3737
image_date:
3838
required: true
3939
type: string
40+
base_image:
41+
required: false
42+
type: string
43+
default: ''
4044
is_post_training:
4145
required: false
4246
type: boolean
@@ -114,7 +118,8 @@ jobs:
114118
MODE=${{ inputs.build_mode }}
115119
JAX_VERSION=NONE
116120
LIBTPU_VERSION=NONE
117-
BASEIMAGE=gcr.io/tpu-prod-env-multipod/maxtext_jax_stable:${{ inputs.image_date }}
121+
INCLUDE_TEST_ASSETS=true
122+
${{ inputs.base_image != '' && format('BASEIMAGE={0}', inputs.base_image) || '' }}
118123
119124
- name: Add tags to Docker image
120125
if: steps.check.outputs.should_run == 'true'

dependencies/dockerfiles/maxtext_gpu_dependencies.Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,14 @@ RUN --mount=type=cache,target=/root/.cache/pip bash /deps/tools/setup/setup.sh M
5858
# Now copy the remaining code (source files that may change frequently)
5959
COPY . .
6060

61+
# Download test assets from GCS if building image with test assets
62+
ARG INCLUDE_TEST_ASSETS=false
63+
RUN if [ "$INCLUDE_TEST_ASSETS" = "true" ]; then \
64+
echo "Downloading test assets from GCS..."; \
65+
if ! gcloud storage cp -r gs://maxtext-test-assets/* "${MAXTEXT_TEST_ASSETS_ROOT}"; then \
66+
echo "WARNING: Failed to download test assets from GCS. These files are only used for end-to-end tests; you may not have access to the bucket."; \
67+
fi; \
68+
fi
69+
6170
# Install (editable) MaxText
6271
RUN test -f '/tmp/venv_created' && "$(tail -n1 /tmp/venv_created)"/bin/activate ; pip install --no-dependencies -e .

dependencies/dockerfiles/maxtext_tpu_dependencies.Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,14 @@ RUN --mount=type=cache,target=/root/.cache/pip bash /deps/tools/setup/setup.sh M
5555
# Now copy the remaining code (source files that may change frequently)
5656
COPY . .
5757

58+
# Download test assets from GCS if building image with test assets
59+
ARG INCLUDE_TEST_ASSETS=false
60+
RUN if [ "$INCLUDE_TEST_ASSETS" = "true" ]; then \
61+
echo "Downloading test assets from GCS..."; \
62+
if ! gcloud storage cp -r gs://maxtext-test-assets/* "${MAXTEXT_TEST_ASSETS_ROOT}"; then \
63+
echo "WARNING: Failed to download test assets from GCS. These files are only used for end-to-end tests; you may not have access to the bucket."; \
64+
fi; \
65+
fi
66+
5867
# Install (editable) MaxText
5968
RUN test -f '/tmp/venv_created' && "$(tail -n1 /tmp/venv_created)"/bin/activate ; pip install --no-dependencies -e .

0 commit comments

Comments
 (0)