Skip to content

Commit b20ea23

Browse files
committed
Promote TPU nightly docker images to latest without verifying E2E Airflow tests
1 parent 863e534 commit b20ea23

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/tpu_nightly_images_pipeline.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,38 @@ jobs:
107107
maxtext_sha: ${{ github.sha }}
108108
secrets: inherit
109109

110+
# TODO: This is a workaround, to be removed when promote_docker_image.yml workflow is stable
111+
tag_docker_image:
112+
name: Promote ${{ matrix.image_name }} Docker Image
113+
needs: run_ci_tests
114+
if: needs.run_ci_tests.result == 'success'
115+
runs-on: linux-x86-n2-16-buildkit
116+
container: google/cloud-sdk:524.0.0
117+
strategy:
118+
fail-fast: false
119+
matrix:
120+
image_name:
121+
- maxtext_jax_stable
122+
- maxtext_jax_nightly
123+
- maxtext_post_training_nightly
124+
steps:
125+
- name: Configure Docker
126+
run: gcloud auth configure-docker us-docker.pkg.dev,gcr.io -q
127+
- name: Add tags to Docker image
128+
shell: bash
129+
env:
130+
GITHUB_RUN_ID: ${{ github.run_id }}
131+
run: |
132+
image_name=${{ inputs.image_suffix != '' && format('{0}_{1}', matrix.image_name, inputs.image_suffix) || matrix.image_name }}
133+
SOURCE_IMAGE="gcr.io/${{ vars.PROJECT_NAME }}/${image_name}"
134+
135+
# Add the traceability tag to confirm it passed validation suite
136+
gcloud container images add-tag "${SOURCE_IMAGE}:${GITHUB_RUN_ID}" \
137+
"${SOURCE_IMAGE}:verified-${GITHUB_RUN_ID}" --quiet
138+
139+
# Add "latest" tag
140+
gcloud container images add-tag "${SOURCE_IMAGE}:${GITHUB_RUN_ID}" "${SOURCE_IMAGE}:latest" --quiet
141+
110142
notify_failure:
111143
name: Notify failed build
112144
needs: [build_and_push_docker_images, run_ci_tests, run_e2e_tests]

0 commit comments

Comments
 (0)