Skip to content

Publish TPU pre-training and post-training stable docker images to cloud-tpu-images#3878

Draft
SurbhiJainUSC wants to merge 1 commit into
mainfrom
tpu_docker_image
Draft

Publish TPU pre-training and post-training stable docker images to cloud-tpu-images#3878
SurbhiJainUSC wants to merge 1 commit into
mainfrom
tpu_docker_image

Conversation

@SurbhiJainUSC
Copy link
Copy Markdown
Collaborator

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456

Notice 1: Once all tests pass, the "pull ready" label will automatically be assigned.
This label is used for administrative purposes. Please do not add it manually.

Notice 2: For external contributions, our settings currently require an approval from a MaxText maintainer to trigger CI tests.

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@SurbhiJainUSC SurbhiJainUSC force-pushed the tpu_docker_image branch 4 times, most recently from f8dd28b to 8f4df1e Compare May 12, 2026 00:07
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@SurbhiJainUSC SurbhiJainUSC force-pushed the tpu_docker_image branch 9 times, most recently from c8b5653 to 337d5a8 Compare May 12, 2026 17:55
Comment on lines +27 to +53
name: Get latest MaxText PyPI version
runs-on: ubuntu-latest
outputs:
latest_pypi_version: ${{ steps.get_version.outputs.version }}
steps:
- name: Install jq
run: sudo apt-get update && sudo apt-get install -y jq
- name: Fetch latest version of maxtext from PyPI
id: get_version
run: |
# Fetch JSON from PyPI for 'maxtext'
echo "Fetching latest version from https://pypi.org/pypi/maxtext/json"
pypi_json=$(curl -s https://pypi.org/pypi/maxtext/json)

# Extract the version from the "info" section using jq
latest_version=$(echo "$pypi_json" | jq -r ".info.version")

if [ -z "$latest_version" ] || [ "$latest_version" == "null" ]; then
echo "Error: Could not parse latest version from PyPI JSON."
exit 1
fi

echo "Successfully fetched latest MaxText version on PyPI: $latest_version"
# Set the output variable for other jobs to consume
echo "version=$latest_version" >> "$GITHUB_OUTPUT"

build_maxtext_package:
Comment on lines +54 to +88
name: Build MaxText Package
needs: get_latest_maxtext_pypi_version
runs-on: ubuntu-latest
outputs:
commit_sha: ${{ steps.get_sha.outputs.commit_sha }}
steps:
- name: Checkout MaxText
uses: actions/checkout@v5
with:
fetch-depth: 0 # Fetch all history for all tags
- name: Get commit SHA for tag
id: get_sha
run: |
PYPI_VERSION="${{ needs.get_latest_maxtext_pypi_version.outputs.latest_pypi_version }}"
TAG_NAME="maxtext-v${PYPI_VERSION}"
echo "Looking for tag: ${TAG_NAME}"

# Get the commit SHA for the tag
COMMIT_SHA=$(git rev-parse --verify "${TAG_NAME}^{commit}" 2>/dev/null)

echo "Found commit SHA: ${COMMIT_SHA}"
echo "commit_sha=${COMMIT_SHA}" >> "$GITHUB_OUTPUT"
- name: Install build tools
run: |
python -m pip install --upgrade pip build uv
- name: Build maxtext wheel
run: |
uv build --wheel
- name: Upload the built maxtext wheel
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: maxtext-wheel
path: dist/*

upload_maxtext_docker_images:
Comment on lines +89 to +121
name: ${{ matrix.image_name }}
needs: [get_latest_maxtext_pypi_version, build_maxtext_package]
strategy:
fail-fast: false
matrix:
include:
- device: tpu
build_mode: stable
image_name: tpu_pre_training
workflow: pre-training
dockerfile: maxtext_tpu_dependencies.Dockerfile
- device: gpu
build_mode: stable
image_name: gpu_pre_training
workflow: pre-training
dockerfile: maxtext_gpu_dependencies.Dockerfile
- device: tpu
build_mode: stable
image_name: tpu_post_training
workflow: post-training
dockerfile: maxtext_tpu_dependencies.Dockerfile
uses: ./.github/workflows/build_and_push_docker_image.yml
with:
image_name: ${{ matrix.image_name }}
docker_image_prefix: us-docker.pkg.dev/${{ vars.PUBLIC_IMAGE_PROJECT_NAME }}/maxtext-images
device: ${{ matrix.device }}
build_mode: ${{ matrix.build_mode }}
workflow: ${{ matrix.workflow }}
dockerfile: ${{ matrix.dockerfile }}
maxtext_sha: ${{ needs.build_maxtext_package.outputs.commit_sha }}
version_name: needs.get_latest_maxtext_pypi_version.outputs.latest_pypi_version
secrets:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants