Skip to content

Commit 8429e80

Browse files
committed
test
1 parent c318902 commit 8429e80

File tree

2 files changed

+45
-101
lines changed

2 files changed

+45
-101
lines changed

.github/workflows/_ci_tmp.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: ~CI, single-arch
2+
run-name: CI-${{ inputs.ARCHITECTURE }}
3+
on:
4+
workflow_call:
5+
inputs:
6+
ARCHITECTURE:
7+
type: string
8+
required: true
9+
BUILD_DATE:
10+
type: string
11+
description: Build date in YYYY-MM-DD format
12+
required: false
13+
default: NOT SPECIFIED
14+
BUMP_MANIFEST:
15+
type: boolean
16+
description: Flag to bump manifest file or not
17+
default: false
18+
required: false
19+
outputs:
20+
DOCKER_TAGS:
21+
description: JSON object containing tags of all docker images built
22+
value: ${{ jobs.collect-docker-tags.outputs.TAGS }}
23+
24+
permissions:
25+
contents: read # to fetch code
26+
actions: write # to cancel previous workflows
27+
packages: write # to upload container
28+
29+
jobs:
30+
31+
pass:
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- name: Pass
35+
run: echo pass
36+
pass2:
37+
runs-on: ubuntu-22.04
38+
steps:
39+
- name: Pass
40+
run: echo pass

.github/workflows/ci.yaml

+5-101
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ jobs:
7373
7474
amd64:
7575
needs: metadata
76-
uses: ./.github/workflows/_ci.yaml
76+
uses: ./.github/workflows/_ci_tmp.yaml
7777
with:
7878
ARCHITECTURE: amd64
7979
BUILD_DATE: ${{ needs.metadata.outputs.BUILD_DATE }}
@@ -82,117 +82,21 @@ jobs:
8282

8383
arm64:
8484
needs: metadata
85-
uses: ./.github/workflows/_ci.yaml
85+
uses: ./.github/workflows/_ci_tmp.yaml
8686
with:
8787
ARCHITECTURE: arm64
8888
BUILD_DATE: ${{ needs.metadata.outputs.BUILD_DATE }}
8989
BUMP_MANIFEST: ${{ needs.metadata.outputs.BUMP_MANIFEST == 'true' }}
9090
secrets: inherit
9191

92-
make-publish-configs:
92+
commit-bump:
9393
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' }}
9894
needs:
99-
- metadata
10095
- amd64
10196
- arm64
102-
outputs:
103-
PUBLISH_CONFIGS: ${{ steps.generate-configs.outputs.PUBLISH_CONFIGS }}
10497
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 }}
196100

197101
finalize:
198102
needs: [metadata, amd64, arm64]

0 commit comments

Comments
 (0)