73
73
74
74
amd64 :
75
75
needs : metadata
76
- uses : ./.github/workflows/_ci .yaml
76
+ uses : ./.github/workflows/_ci_tmp .yaml
77
77
with :
78
78
ARCHITECTURE : amd64
79
79
BUILD_DATE : ${{ needs.metadata.outputs.BUILD_DATE }}
@@ -82,117 +82,21 @@ jobs:
82
82
83
83
arm64 :
84
84
needs : metadata
85
- uses : ./.github/workflows/_ci .yaml
85
+ uses : ./.github/workflows/_ci_tmp .yaml
86
86
with :
87
87
ARCHITECTURE : arm64
88
88
BUILD_DATE : ${{ needs.metadata.outputs.BUILD_DATE }}
89
89
BUMP_MANIFEST : ${{ needs.metadata.outputs.BUMP_MANIFEST == 'true' }}
90
90
secrets : inherit
91
91
92
- make-publish-configs :
92
+ commit-bump :
93
93
runs-on : ubuntu-22.04
94
- if : ${{ !cancelled() }}
95
- env :
96
- MEALKIT_IMAGE_REPO : ${{ needs.metadata.outputs.PUBLISH == 'true' && 'jax-mealkit' || 'mock-jax-mealkit' }}
97
- FINAL_IMAGE_REPO : ${{ needs.metadata.outputs.PUBLISH == 'true' && 'jax' || 'mock-jax' }}
98
94
needs :
99
- - metadata
100
95
- amd64
101
96
- arm64
102
- outputs :
103
- PUBLISH_CONFIGS : ${{ steps.generate-configs.outputs.PUBLISH_CONFIGS }}
104
97
steps :
105
- - id : generate-configs
106
- shell : bash -eu -o pipefail {0}
107
- run : |
108
- declare -a FLAVORS=(
109
- base
110
- jax
111
- pallas
112
- maxtext
113
- levanter
114
- t5x
115
- pax
116
- rosetta-t5x
117
- rosetta-pax
118
- )
119
- declare -a STAGES=(
120
- mealkit
121
- final
122
- )
123
-
124
- ## create JSON specs for a 1D matrix of container publication jobs
125
-
126
- ALL_TAGS=$(
127
- echo '${{ needs.amd64.outputs.DOCKER_TAGS }}' \
128
- '${{ needs.arm64.outputs.DOCKER_TAGS }}' |\
129
- jq -s 'add'
130
- )
131
- PUBLISH_CONFIGS='[]'
132
-
133
- for stage in "${STAGES[@]}"; do
134
- for flavor in "${FLAVORS[@]}";do
135
-
136
- # collect images for different platforms, e.g. amd64 and arm64
137
- matching_tags=$(
138
- echo "$ALL_TAGS" |\
139
- jq -c ".[] | select(.stage == \"${stage}\" and .flavor == \"${flavor}\" and .tag != \"\")"
140
- )
141
-
142
- # source_image is a list of all platform-specific tags
143
- source_image=$(echo "${matching_tags}" | jq -c "[.tag]" | jq -s 'add')
144
- # if the build job failed without producing any images, skip this flavor
145
- n_source_images=$(echo "$source_image" | jq 'length')
146
- if [[ $n_source_images -gt 0 ]]; then
147
- echo "PUBLISH image $flavor with $n_source_images $stage containers"
148
-
149
- # tag priority is the highest priority of all platform-specific tags
150
- priority=$(echo "${matching_tags}" | jq -r ".priority" | jq -s 'max')
151
-
152
- # put all final images in the `ghcr.io/nvidia/jax` namespace
153
- # and mealkit images in `ghcr.io/nvidia/jax-toolbox-mealkit` namespace
154
- case ${stage} in
155
- mealkit)
156
- target_image=${MEALKIT_IMAGE_REPO}
157
- ;;
158
- final)
159
- target_image=${FINAL_IMAGE_REPO}
160
- ;;
161
- esac
162
-
163
- PUBLISH_CONFIGS=$(
164
- echo ${PUBLISH_CONFIGS} | jq -c ". + [{
165
- \"flavor\": \"${flavor}\",
166
- \"target_image\": \"${target_image}\",
167
- \"priority\": \"${priority}\",
168
- \"source_image\": ${source_image}
169
- }]"
170
- )
171
- else
172
- echo "SKIPPED image $flavor with 0 $stage containers"
173
- fi
174
- done
175
- done
176
-
177
- PUBLISH_CONFIGS=$(echo "$PUBLISH_CONFIGS" | jq -c '{"config": .}')
178
- echo ${PUBLISH_CONFIGS} | jq
179
- echo "PUBLISH_CONFIGS=${PUBLISH_CONFIGS}" >> $GITHUB_OUTPUT
180
-
181
- publish-containers :
182
- needs :
183
- - metadata
184
- - make-publish-configs
185
- if : ${{ !cancelled() && needs.make-publish-configs.outputs.PUBLISH_CONFIGS.config != '{"config":[]}' }}
186
- strategy :
187
- fail-fast : false
188
- matrix : ${{ fromJson(needs.make-publish-configs.outputs.PUBLISH_CONFIGS) }}
189
- uses : ./.github/workflows/_publish_container.yaml
190
- with :
191
- SOURCE_IMAGE : ${{ join(matrix.config.source_image, ' ') }}
192
- TARGET_IMAGE : ${{ matrix.config.target_image }}
193
- TARGET_TAGS : |
194
- type=raw,value=${{ matrix.config.flavor }},priority=${{ matrix.config.priority }}
195
- type=raw,value=${{ matrix.config.flavor }}-${{ needs.metadata.outputs.BUILD_DATE }},priority=${{ matrix.config.priority }}
98
+ - name : test
99
+ run : echo ${{ needs.amd64 }}
196
100
197
101
finalize :
198
102
needs : [metadata, amd64, arm64]
0 commit comments