4646# POST-TRAINING BUILD EXAMPLES
4747# ==================================
4848
49- # Build docker image with stable pre-training dependencies and stable post-training dependencies
49+ # Build docker image with post-training dependencies
5050# # bash src/dependencies/scripts/docker_build_dependency_image.sh WORKFLOW=post-training
5151
52- # Build docker image with stable pre-training dependencies and post-training dependencies from GitHub head
53- # # bash src/dependencies/scripts/docker_build_dependency_image.sh WORKFLOW=post-training POST_TRAINING_SOURCE=local
54-
5552if [ " ${BASH_SOURCE-} " ]; then
5653 this_file=" ${BASH_SOURCE[0]} "
5754elif [ " ${ZSH_VERSION-} " ]; then
@@ -118,24 +115,6 @@ run_docker_build() {
118115 docker build --network host $( printf -- ' --build-arg %q ' " $@ " ) -f " $dockerfile_path " -t " $LOCAL_IMAGE_NAME " .
119116}
120117
121- # Function to build post-training dependencies from local Github head
122- build_post_training_deps_from_local_github () {
123- # To install vllm, tunix, tpu-inference from a local path, we copy it into the build context, excluding __pycache__.
124- # This assumes vllm, tunix, tpu-inference is a sibling directory to the current one (maxtext).
125- rsync -a --exclude=' __pycache__' ../tpu-inference .
126- rsync -a --exclude=' __pycache__' ../vllm .
127- rsync -a --exclude=' __pycache__' ../tunix .
128-
129- # The cleanup is set to run even if the build fails to remove the copied directory.
130- trap " rm -rf ./tpu-inference ./vllm ./tunix" EXIT INT TERM
131-
132- DOCKERFILE_NAME=' maxtext_post_training_local_dependencies.Dockerfile'
133- echo " Building local post-training dependencies: $DOCKERFILE_NAME "
134-
135- run_docker_build " $MAXTEXT_REPO_ROOT /src/dependencies/dockerfiles/$DOCKERFILE_NAME " \
136- " MODE=${WORKFLOW} " " BASEIMAGE=${LOCAL_IMAGE_NAME} "
137- }
138-
139118# Function to build image for GPUs
140119build_gpu_image () {
141120 if [[ ${MODE} == " pinned" ]]; then
@@ -162,13 +141,6 @@ build_tpu_image() {
162141
163142 echo " Building docker image with arguments: ${docker_build_args[*]} "
164143 run_docker_build " $MAXTEXT_REPO_ROOT /src/dependencies/dockerfiles/maxtext_tpu_dependencies.Dockerfile" " ${docker_build_args[@]} "
165-
166- # Handle post-training workflow if specified
167- if [[ ${WORKFLOW} == " post-training" || ${WORKFLOW} == " post-training-experimental" ]]; then
168- if [[ ${POST_TRAINING_SOURCE} == " local" ]]; then
169- build_post_training_deps_from_local_github
170- fi
171- fi
172144}
173145
174146if [[ ${DEVICE} == " gpu" ]]; then
0 commit comments