Skip to content

Fix docker build and upload with pip install#3448

Merged
copybara-service[bot] merged 1 commit intomainfrom
docker_build
Mar 18, 2026
Merged

Fix docker build and upload with pip install#3448
copybara-service[bot] merged 1 commit intomainfrom
docker_build

Conversation

@SurbhiJainUSC
Copy link
Collaborator

@SurbhiJainUSC SurbhiJainUSC commented Mar 18, 2026

Description

This PR solves the issue to build and upload docker images without git cloing maxtext repository.

Fixes: b/493593839

Next Step:

  1. Update documentation with the following:
uv pip install maxtext[runner] --resolution=lowest
build_maxtext_docker_image WORKFLOW=$WORKFLOW
upload_maxtext_docker_image CLOUD_IMAGE_NAME=$CLOUD_IMAGE_NAME

2.Release new version of MaxText to PyPI

Tests

Case 1: Installing from PyPI

# Build and upload to Test PyPI account
uv build --wheel && python3 -m twine upload --repository test dist/*

# Install test PyPI package
uv pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ maxtext-dev[runner] --force-reinstall

# Build and upload maxtext docker image (run this from home directory)
build_maxtext_docker_image WORKFLOW=$WORKFLOW
upload_maxtext_docker_image CLOUD_IMAGE_NAME=$CLOUD_IMAGE_NAME

Case 2: Installing from PyPI in editable mode

# Install maxtext in editable mode
cd ~/maxtext
uv pip install -e .[runner] --resolution=lowest

# Build and upload maxtext docker image (run this from `maxtext` directory)
build_maxtext_docker_image WORKFLOW=$WORKFLOW
upload_maxtext_docker_image CLOUD_IMAGE_NAME=$CLOUD_IMAGE_NAME

Case 3: Running bash scripts directly

cd ~/maxtext

# Build and upload maxtext docker image (run this from `maxtext` directory)
bash src/dependencies/scripts/docker_build_dependency_image.sh WORKFLOW=$WORKFLOW
bash src/dependencies/scripts/docker_upload_runner.sh CLOUD_IMAGE_NAME=$CLOUD_IMAGE_NAME

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.

@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@copybara-service copybara-service bot merged commit 5d9e57f into main Mar 18, 2026
42 of 43 checks passed
@copybara-service copybara-service bot deleted the docker_build branch March 18, 2026 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants