15
15
workflow_dispatch :
16
16
17
17
jobs :
18
- docker :
18
+ docker-build :
19
19
name : Docker build ${{ matrix.name }}
20
20
runs-on : ${{ matrix.runner }}
21
21
timeout-minutes : 1200
22
22
permissions :
23
23
contents : read
24
24
packages : write
25
25
strategy :
26
+ fail-fast : true
26
27
matrix :
27
28
include :
28
- - name : cuda12.8 arm64
29
+ - name : cuda12.8- arm64
29
30
dockerfile : cuda12.8
30
- tags : superbench/main:cuda12.8
31
+ tags : superbench/main:cuda12.8-arm64
31
32
platforms : linux/arm64
32
33
runner : [self-hosted, linux/arm64]
33
34
build_args : " NUM_MAKE_JOBS=16"
34
- - name : cuda12.8
35
+ - name : cuda12.8-amd64
35
36
dockerfile : cuda12.8
36
- tags : superbench/main:cuda12.8
37
+ tags : superbench/main:cuda12.8-amd64
37
38
platforms : linux/amd64
38
39
runner : [self-hosted, linux/amd64]
39
40
build_args : " NUM_MAKE_JOBS=16"
40
- - name : cuda12.4 arm64
41
- dockerfile : cuda12.4
42
- tags : superbench/main:cuda12.4
43
- platforms : linux/arm64
44
- runner : [self-hosted, linux/arm64]
45
- build_args : " NUM_MAKE_JOBS=16"
46
41
- name : cuda12.4
47
42
dockerfile : cuda12.4
48
43
tags : superbench/main:cuda12.4
@@ -61,12 +56,12 @@ jobs:
61
56
platforms : linux/amd64
62
57
runner : ubuntu-latest
63
58
build_args : " NUM_MAKE_JOBS=8"
64
- - name : rocm6.2
65
- dockerfile : rocm6.2.x
66
- tags : superbench/main:rocm6.2
67
- platforms : linux/amd64
68
- runner : [self-hosted, linux/amd64, rocm]
69
- build_args : " NUM_MAKE_JOBS=16"
59
+ # - name: rocm6.2
60
+ # dockerfile: rocm6.2.x
61
+ # tags: superbench/main:rocm6.2
62
+ # platforms: linux/amd64
63
+ # runner: [self-hosted, linux/amd64, rocm]
64
+ # build_args: "NUM_MAKE_JOBS=16"
70
65
steps :
71
66
- name : Checkout
72
67
uses : actions/checkout@v2
@@ -162,3 +157,81 @@ jobs:
162
157
org.opencontainers.image.revision=${{ github.sha }}
163
158
- name : Echo image digest
164
159
run : echo ${{ steps.docker_build.outputs.digest }}
160
+ docker-merge :
161
+ needs : docker-build
162
+ name : Docker merge ${{ matrix.name }}
163
+ runs-on : self-hosted
164
+ timeout-minutes : 300
165
+ permissions :
166
+ contents : read
167
+ packages : write
168
+ strategy :
169
+ matrix :
170
+ include :
171
+ - name : cuda12.8
172
+ tags : superbench/main:cuda12.8
173
+ sources : >-
174
+ superbench/main:cuda12.8-amd64
175
+ superbench/main:cuda12.8-arm64
176
+ steps :
177
+ - name : Checkout
178
+ uses : actions/checkout@v4
179
+ - name : Prepare metadata
180
+ id : metadata
181
+ run : |
182
+ TAGS=${{ matrix.tags }}
183
+ SOURCES="${{ matrix.sources }}"
184
+ if [[ "${{ github.event_name }}" == "push" ]] && [[ "${{ github.ref }}" == "refs/heads/release/"* ]]; then
185
+ TAGS=$(sed "s/main:/release:${GITHUB_REF##*/}-/g" <<< ${TAGS})
186
+ SOURCES=$(sed "s/main:/release:${GITHUB_REF##*/}-/g" <<< ${SOURCES})
187
+ fi
188
+ if [[ "${{ github.event_name }}" == "pull_request" ]] && [[ "${{ github.base_ref }}" == "release/"* ]]; then
189
+ TAGS=$(sed "s/main:/release:${GITHUB_BASE_REF##*/}-/g" <<< ${TAGS})
190
+ SOURCES=$(sed "s/main:/release:${GITHUB_BASE_REF##*/}-/g" <<< ${SOURCES})
191
+ fi
192
+ if [[ "${{ github.event_name }}" == "release" ]]; then
193
+ TAGS=$(sed "s/main:/superbench:${GITHUB_REF##*/}-/g" <<< ${TAGS})
194
+ GHCR_TAG=$(cut -d, -f1 <<< ${TAGS} | sed "s#superbench/superbench#ghcr.io/${{ github.repository }}/superbench#g")
195
+ TAGS="${TAGS},${GHCR_TAG}"
196
+ fi
197
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
198
+ TAGS=$(sed "s/main:/dev:/g" <<< ${TAGS})
199
+ SOURCES=$(sed "s/main:/dev:/g" <<< ${SOURCES})
200
+ fi
201
+
202
+ echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
203
+ echo "sources=${SOURCES}" >> "$GITHUB_OUTPUT"
204
+ - name : Echo image tags
205
+ run : echo ${{ steps.metadata.outputs.tags }}
206
+ - name : Echo image sourcs
207
+ run : echo ${{ steps.metadata.outputs.sources }}
208
+ - name : Set up QEMU
209
+ uses : docker/setup-qemu-action@v3
210
+ - name : Set up Docker Buildx
211
+ uses : docker/setup-buildx-action@v3
212
+ - name : Login to Docker Hub
213
+ uses : docker/login-action@v3
214
+ if : ${{ github.event_name != 'pull_request' }}
215
+ with :
216
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
217
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
218
+ - name : Login to the GitHub Container Registry
219
+ uses : docker/login-action@v3
220
+ if : ${{ github.event_name == 'release' }}
221
+ with :
222
+ registry : ghcr.io
223
+ username : ${{ github.actor }}
224
+ password : ${{ secrets.GITHUB_TOKEN }}
225
+ - name : Merge and push
226
+ if : ${{ github.event_name != 'pull_request' }}
227
+ run : |
228
+ docker buildx imagetools create \
229
+ --annotation "index:org.opencontainers.image.source=${{ github.event.repository.html_url }}" \
230
+ --annotation "index:org.opencontainers.image.created=${{ github.event.repository.pushed_at }}" \
231
+ --annotation "index:org.opencontainers.image.revision=${{ github.sha }}" \
232
+ --tag ${{ steps.metadata.outputs.tags }} \
233
+ ${{ steps.metadata.outputs.sources }}
234
+ - name : Inspect image
235
+ if : ${{ github.event_name != 'pull_request' }}
236
+ run : |
237
+ docker buildx imagetools inspect $(echo "${{ steps.metadata.outputs.tags }}" | cut -d, -f1)
0 commit comments