-
Notifications
You must be signed in to change notification settings - Fork 315
94 lines (89 loc) · 4.45 KB
/
UploadDockerImages.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build Images
on:
schedule:
# Run the job daily at 7PM PST (3AM UTC)
- cron: '0 3 * * *'
jobs:
tpu:
strategy:
fail-fast: false
matrix:
device-type: ["v4-8"]
runs-on: ["self-hosted", "tpu", "${{ matrix.device-type }}"]
steps:
- uses: actions/checkout@v3
- name: build jax stable image
run : |
project=tpu-prod-env-multipod
local_image_name=maxtext_local_jax_stable
cloud_image_name=maxtext_jax_stable
bash docker_build_dependency_image.sh LOCAL_IMAGE_NAME=$local_image_name MODE=stable
docker build --build-arg BASEIMAGE=${local_image_name} -f ./maxtext_runner.Dockerfile -t ${local_image_name}_runner .
gcloud auth configure-docker --quiet
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:latest
docker push gcr.io/$project/${cloud_image_name}:latest
image_date=$(date +%Y-%m-%d)
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:${image_date}
docker push gcr.io/$project/${cloud_image_name}:${image_date}
- name: build jax nightly image
run : |
project=tpu-prod-env-multipod
local_image_name=maxtext_local_jax_nightly
cloud_image_name=maxtext_jax_nightly
bash docker_build_dependency_image.sh LOCAL_IMAGE_NAME=$local_image_name MODE=nightly
docker build --build-arg BASEIMAGE=${local_image_name} -f ./maxtext_runner.Dockerfile -t ${local_image_name}_runner .
gcloud auth configure-docker --quiet
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:latest
docker push gcr.io/$project/${cloud_image_name}:latest
image_date=$(date +%Y-%m-%d)
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:${image_date}
docker push gcr.io/$project/${cloud_image_name}:${image_date}
gpu:
strategy:
fail-fast: false
matrix:
device-type: ["a100-40gb-4"]
runs-on: ["self-hosted", "gpu", "${{ matrix.device-type }}"]
steps:
- uses: actions/checkout@v3
- name: build jax stable image
run : |
project=tpu-prod-env-multipod
local_image_name=maxtext_gpu_local_jax_stable
cloud_image_name=maxtext_gpu_jax_stable
bash docker_build_dependency_image.sh LOCAL_IMAGE_NAME=$local_image_name MODE=stable DEVICE=gpu
docker build --build-arg BASEIMAGE=${local_image_name} -f ./maxtext_runner.Dockerfile -t ${local_image_name}_runner .
gcloud auth configure-docker --quiet
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:latest
docker push gcr.io/$project/${cloud_image_name}:latest
image_date=$(date +%Y-%m-%d)
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:${image_date}
docker push gcr.io/$project/${cloud_image_name}:${image_date}
- name: build jax nightly image
run : |
project=tpu-prod-env-multipod
local_image_name=maxtext_gpu_local_jax_nightly
cloud_image_name=maxtext_gpu_jax_nightly
bash docker_build_dependency_image.sh LOCAL_IMAGE_NAME=$local_image_name MODE=nightly DEVICE=gpu
docker build --build-arg BASEIMAGE=${local_image_name} -f ./maxtext_runner.Dockerfile -t ${local_image_name}_runner .
gcloud auth configure-docker --quiet
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:latest
docker push gcr.io/$project/${cloud_image_name}:latest
image_date=$(date +%Y-%m-%d)
docker tag ${local_image_name}_runner gcr.io/$project/${cloud_image_name}:${image_date}
docker push gcr.io/$project/${cloud_image_name}:${image_date}