Publish TPU pre-training and post-training stable docker images to cloud-tpu-images#3878
Draft
SurbhiJainUSC wants to merge 1 commit into
Draft
Publish TPU pre-training and post-training stable docker images to cloud-tpu-images#3878SurbhiJainUSC wants to merge 1 commit into
SurbhiJainUSC wants to merge 1 commit into
Conversation
f8dd28b to
8f4df1e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
c8b5653 to
337d5a8
Compare
337d5a8 to
34db38e
Compare
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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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):
gemini-reviewlabel.