Skip to content

Commit e608911

Browse files
committed
Add workflow for build and test release candidate for TPU
1 parent 8a382dc commit e608911

1 file changed

Lines changed: 87 additions & 0 deletions

File tree

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Copyright 2026 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# This workflow will build and test the MaxText package, and build Docker images
16+
# for a Release Candidate when a new release tag is created.
17+
18+
name: Build and Test MaxText Release Candidate
19+
20+
on:
21+
release:
22+
types: [published]
23+
workflow_dispatch:
24+
inputs:
25+
target_device:
26+
description: 'Target Device (tpu, gpu, or all)'
27+
required: false
28+
default: 'all'
29+
type: choice
30+
options:
31+
- all
32+
- tpu
33+
- gpu
34+
35+
permissions:
36+
contents: read
37+
issues: write
38+
39+
jobs:
40+
release_approval:
41+
name: Approve Release Candidate
42+
if: github.event_name != 'workflow_dispatch'
43+
runs-on: ubuntu-latest
44+
environment: release
45+
steps:
46+
- name: Acknowledge Approval
47+
run: echo "Release candidate approved, proceeding to build and test MaxText package."
48+
49+
build_and_test_maxtext_package:
50+
name: Build and Test MaxText Package
51+
needs: [release_approval]
52+
if: |
53+
always() &&
54+
(needs.release_approval.result == 'success' || needs.release_approval.result == 'skipped')
55+
uses: ./.github/workflows/build_and_test_maxtext.yml
56+
secrets: inherit
57+
58+
build_release_candidate_images:
59+
name: Build Release Candidate Images
60+
needs: [build_and_test_maxtext_package]
61+
if: |
62+
always() &&
63+
(needs.build_and_test_maxtext_package.result == 'success' || needs.build_and_test_maxtext_package.result == 'skipped')
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
include:
68+
- device: tpu
69+
build_mode: stable
70+
image_name: maxtext_jax_stable
71+
workflow: pre-training
72+
dockerfile: maxtext_tpu_dependencies.Dockerfile
73+
- device: tpu
74+
build_mode: stable
75+
image_name: maxtext_post_training_stable
76+
workflow: post-training
77+
dockerfile: maxtext_tpu_dependencies.Dockerfile
78+
uses: ./.github/workflows/build_and_push_docker_image.yml
79+
with:
80+
image_name: ${{ matrix.image_name }}
81+
device: ${{ matrix.device }}
82+
build_mode: ${{ matrix.build_mode }}
83+
workflow: ${{ matrix.workflow }}
84+
dockerfile: ${{ matrix.dockerfile }}
85+
maxtext_sha: ${{ github.sha }}
86+
secrets:
87+
HF_TOKEN: ${{ secrets.HF_TOKEN }}

0 commit comments

Comments
 (0)