Skip to content

Commit ab6dcf6

Browse files
committed
Refactor: 3.1 phase of RESTRUCTURE.md, focussing on setup.sh and related Python dependency & Dockerfile files
1 parent a022ce3 commit ab6dcf6

35 files changed

+142
-66
lines changed

.github/workflows/UploadDockerImages.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,26 +52,26 @@ jobs:
5252
include:
5353
# TPU Image Builds
5454
- image_name: maxtext_jax_stable
55-
dockerfile: ./maxtext_dependencies.Dockerfile
55+
dockerfile: ./dependencies/dockerfiles/maxtext_dependencies.Dockerfile
5656
build_args: |
5757
MODE=stable
5858
JAX_VERSION=NONE
5959
LIBTPU_GCS_PATH=NONE
6060
- image_name: maxtext_jax_nightly
61-
dockerfile: ./maxtext_dependencies.Dockerfile
61+
dockerfile: ./dependencies/dockerfiles/maxtext_dependencies.Dockerfile
6262
build_args: |
6363
MODE=nightly
6464
JAX_VERSION=NONE
6565
LIBTPU_GCS_PATH=NONE
6666
# TPU Image builds using JAX AI Image
6767
- image_name: maxtext_jax_stable_stack
68-
dockerfile: ./maxtext_jax_ai_image.Dockerfile
68+
dockerfile: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
6969
base_image: us-docker.pkg.dev/cloud-tpu-images/jax-ai-image/tpu:latest
7070
- image_name: maxtext_stable_stack_nightly_jax
71-
dockerfile: ./maxtext_jax_ai_image.Dockerfile
71+
dockerfile: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
7272
base_image: us-docker.pkg.dev/tpu-prod-env-multipod/jax-stable-stack/tpu/jax_nightly:latest
7373
- image_name: maxtext_stable_stack_candidate
74-
dockerfile: ./maxtext_jax_ai_image.Dockerfile
74+
dockerfile: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
7575
base_image: us-docker.pkg.dev/tpu-prod-env-multipod/jax-stable-stack/candidate/tpu:latest
7676

7777
# Setup for GKE runners per b/412986220#comment82 and b/412986220#comment90
@@ -130,13 +130,13 @@ jobs:
130130
# GPU Image Builds using JAX AI Image
131131
include:
132132
- image_name: maxtext_gpu_jax_stable_stack
133-
dockerfile: ./maxtext_jax_ai_image.Dockerfile
133+
dockerfile: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
134134
base_image: us-central1-docker.pkg.dev/deeplearning-images/jax-ai-image/gpu:latest
135135
- image_name: maxtext_gpu_stable_stack_nightly_jax
136-
dockerfile: ./maxtext_jax_ai_image.Dockerfile
136+
dockerfile: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
137137
base_image: us-docker.pkg.dev/tpu-prod-env-multipod/jax-stable-stack/gpu/jax_nightly:latest
138138
- image_name: maxtext_stable_stack_candidate_gpu
139-
dockerfile: ./maxtext_jax_ai_image.Dockerfile
139+
dockerfile: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
140140
base_image: us-docker.pkg.dev/tpu-prod-env-multipod/jax-stable-stack/candidate/gpu:latest
141141

142142
steps:

.github/workflows/build_and_upload_images.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@
2424
# Example command:
2525
# bash build_and_upload_images.sh PROJECT=<project> MODE=stable DEVICE=tpu CLOUD_IMAGE_NAME=${USER}_runner
2626

27+
if [ "${BASH_SOURCE-}" ]; then
28+
this_file="${BASH_SOURCE[0]}"
29+
elif [ "${ZSH_VERSION-}" ]; then
30+
# shellcheck disable=SC2296
31+
this_file="${(%):-%x}"
32+
else
33+
this_file="${0}"
34+
fi
2735

36+
MAXTEXT_REPO_ROOT="${MAXTEXT_REPO_ROOT:-$(CDPATH='' cd -- "$(dirname -- "${this_file}")"'/../..' && pwd)}"
2837
export LOCAL_IMAGE_NAME=maxtext_base_image
2938

3039
# Set environment variables
@@ -40,7 +49,7 @@ if [[ ! -v CLOUD_IMAGE_NAME ]] || [[ ! -v PROJECT ]] || [[ ! -v MODE ]] || [[ !
4049
fi
4150

4251
gcloud auth configure-docker us-docker.pkg.dev --quiet
43-
bash docker_build_dependency_image.sh LOCAL_IMAGE_NAME=$LOCAL_IMAGE_NAME MODE=$MODE DEVICE=$DEVICE
52+
bash "$MAXTEXT_REPO_ROOT"'/dependencies/scripts/docker_build_dependency_image.sh' LOCAL_IMAGE_NAME=$LOCAL_IMAGE_NAME MODE="$MODE" DEVICE="$DEVICE"
4453
image_date=$(date +%Y-%m-%d)
4554

4655
# Upload only dependencies image
@@ -56,7 +65,7 @@ if ! gcloud storage cp gs://maxtext-test-assets/* "${MAXTEXT_TEST_ASSETS_ROOT:-$
5665
fi
5766

5867
# Build then upload "dependencies + code" image
59-
docker build --build-arg BASEIMAGE=${LOCAL_IMAGE_NAME} -f ./maxtext_runner.Dockerfile -t ${LOCAL_IMAGE_NAME}_runner .
68+
docker build --build-arg BASEIMAGE=${LOCAL_IMAGE_NAME} -f "$MAXTEXT_REPO_ROOT"'/dependencies/dockerfiles/maxtext_runner.Dockerfile' -t ${LOCAL_IMAGE_NAME}_runner .
6069
docker tag ${LOCAL_IMAGE_NAME}_runner gcr.io/$PROJECT/${CLOUD_IMAGE_NAME}:latest
6170
docker push gcr.io/$PROJECT/${CLOUD_IMAGE_NAME}:latest
6271
docker tag ${LOCAL_IMAGE_NAME}_runner gcr.io/$PROJECT/${CLOUD_IMAGE_NAME}:${image_date}

.github/workflows/build_upload_internal.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
with:
6060
push: true
6161
context: .
62-
file: ./maxtext_jax_ai_image.Dockerfile
62+
file: ./dependencies/dockerfiles/maxtext_jax_ai_image.Dockerfile
6363
tags: gcr.io/tpu-prod-env-multipod/maxtext_${{ github.run_id }}:${{ inputs.device_type }}
6464
provenance: false
6565
build-args: |

.github/workflows/check_docs_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
cache: 'pip' # caching pip dependencies
2525

2626
- name: Install dependencies
27-
run: pip install -r requirements_docs.txt
27+
run: pip install -r dependencies/requirements/requirements_docs.txt
2828

2929
- name: Build documentation
3030
run: |

.github/workflows/run_tests_against_package.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ jobs:
8585
source .venv/bin/activate
8686
maxtext_wheel=$(ls maxtext-*-py3-none-any.whl 2>/dev/null)
8787
uv pip install ${maxtext_wheel}[${MAXTEXT_PACKAGE_EXTRA}] --resolution=lowest
88-
install_maxtext_github_deps
88+
uv pip install -r src/install_maxtext_extra_deps/extra_deps_from_github.txt
8989
python3 --version
9090
python3 -m pip freeze
9191
- name: Copy test assets files
File renamed without changes.
File renamed without changes.

src/MaxText/inference/jetstream_pathways/Dockerfile renamed to dependencies/dockerfiles/jetstream_pathways.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ git clone https://github.com/AI-Hypercomputer/maxtext.git
3838

3939
RUN cd maxtext/ && \
4040
git checkout ${MAXTEXT_VERSION} && \
41-
bash setup.sh
41+
bash ./tools/setup/setup.sh
4242

4343
RUN cd /JetStream && \
4444
git checkout ${JETSTREAM_VERSION} && \

src/MaxText/inference/maxengine_server/Dockerfile renamed to dependencies/dockerfiles/maxengine_server.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ git clone https://github.com/AI-Hypercomputer/JetStream.git
3535

3636
RUN cd maxtext/ && \
3737
git checkout ${MAXTEXT_VERSION} && \
38-
bash setup.sh
38+
bash ./tools/setup/setup.sh
3939

4040
RUN cd /JetStream && \
4141
git checkout ${JETSTREAM_VERSION} && \
@@ -45,4 +45,4 @@ COPY maxengine_server_entrypoint.sh /usr/bin/
4545

4646
RUN chmod +x /usr/bin/maxengine_server_entrypoint.sh
4747

48-
ENTRYPOINT ["/usr/bin/maxengine_server_entrypoint.sh"]
48+
ENTRYPOINT ["/usr/bin/maxengine_server_entrypoint.sh"]

0 commit comments

Comments
 (0)