29
29
- name : Checkout code
30
30
uses : actions/checkout@v4
31
31
- name : Install Helm
32
- uses : azure/setup-helm@v4.2 .0
32
+ uses : azure/setup-helm@v4.3 .0
33
33
id : install
34
34
- run : helm lint deployments/gpu-operator/
35
35
validate-csv :
@@ -114,9 +114,9 @@ jobs:
114
114
- run : make docker-build
115
115
116
116
# ## Image builds ###
117
- build-gpu-operator :
117
+ build-gpu-operator-arm64 :
118
118
needs : [go-check, go-test, go-build]
119
- runs-on : ubuntu-latest
119
+ runs-on : ubuntu-24.04-arm
120
120
strategy :
121
121
matrix :
122
122
dist : [ubi9]
@@ -141,11 +141,7 @@ jobs:
141
141
GENERATE_ARTIFACTS="true"
142
142
fi
143
143
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
144
- echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
145
- - name : Set up QEMU
146
- uses : docker/setup-qemu-action@v3
147
- with :
148
- image : tonistiigi/binfmt:master
144
+ echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/arm64" >> $GITHUB_ENV
149
145
- name : Set up Docker Buildx
150
146
uses : docker/setup-buildx-action@v3
151
147
- name : Login to GitHub Container Registry
@@ -157,11 +153,54 @@ jobs:
157
153
- name : Build image
158
154
env :
159
155
IMAGE_NAME : ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator
160
- VERSION : ${COMMIT_SHORT_SHA}
156
+ VERSION : ${COMMIT_SHORT_SHA}-arm64
157
+ run : |
158
+ echo "${VERSION}"
159
+ make build-${{ matrix.dist }}
160
+ build-gpu-operator-validator-arm64 :
161
+ needs : [go-check, go-test, go-build]
162
+ runs-on : ubuntu-24.04-arm
163
+ strategy :
164
+ matrix :
165
+ dist : [ubi9]
166
+ steps :
167
+ - uses : actions/checkout@v4
168
+ name : Check out code
169
+ - name : Calculate build vars
170
+ id : vars
171
+ run : |
172
+ echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
173
+ echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
174
+
175
+ GENERATE_ARTIFACTS="false"
176
+ if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then
177
+ GENERATE_ARTIFACTS="false"
178
+ elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then
179
+ GENERATE_ARTIFACTS="true"
180
+ elif [[ "${{ github.event_name }}" == "push" ]]; then
181
+ GENERATE_ARTIFACTS="true"
182
+ fi
183
+ echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
184
+ echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/arm64" >> $GITHUB_ENV
185
+ - name : Set up Docker Buildx
186
+ uses : docker/setup-buildx-action@v3
187
+ - name : Login to GitHub Container Registry
188
+ uses : docker/login-action@v3
189
+ with :
190
+ registry : ghcr.io
191
+ username : ${{ github.actor }}
192
+ password : ${{ secrets.GITHUB_TOKEN }}
193
+ - name : Build image
194
+ env :
195
+ IMAGE_NAME : ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator
196
+ VERSION : ${COMMIT_SHORT_SHA}-arm64
197
+ SUBCOMPONENT : validator
161
198
run : |
162
199
echo "${VERSION}"
163
200
make build-${{ matrix.dist }}
164
- build-gpu-operator-validator :
201
+
202
+ # ## Image builds ###
203
+ build-gpu-operator-amd64 :
165
204
needs : [go-check, go-test, go-build]
166
205
runs-on : ubuntu-latest
167
206
strategy :
@@ -188,11 +227,48 @@ jobs:
188
227
GENERATE_ARTIFACTS="true"
189
228
fi
190
229
echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
191
- echo "BUILD_MULTI_ARCH_IMAGES=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
192
- - name : Set up QEMU
193
- uses : docker/setup-qemu-action@v3
230
+ echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/amd64" >> $GITHUB_ENV
231
+ - name : Set up Docker Buildx
232
+ uses : docker/setup-buildx-action@v3
233
+ - name : Login to GitHub Container Registry
234
+ uses : docker/login-action@v3
194
235
with :
195
- image : tonistiigi/binfmt:master
236
+ registry : ghcr.io
237
+ username : ${{ github.actor }}
238
+ password : ${{ secrets.GITHUB_TOKEN }}
239
+ - name : Build image
240
+ env :
241
+ IMAGE_NAME : ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator
242
+ VERSION : ${COMMIT_SHORT_SHA}-amd64
243
+ run : |
244
+ echo "${VERSION}"
245
+ make build-${{ matrix.dist }}
246
+
247
+ build-gpu-operator-validator-amd64 :
248
+ needs : [go-check, go-test, go-build]
249
+ runs-on : ubuntu-latest
250
+ strategy :
251
+ matrix :
252
+ dist : [ubi9]
253
+ steps :
254
+ - uses : actions/checkout@v4
255
+ name : Check out code
256
+ - name : Calculate build vars
257
+ id : vars
258
+ run : |
259
+ echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
260
+ echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
261
+
262
+ GENERATE_ARTIFACTS="false"
263
+ if [[ "${{ github.actor }}" == "dependabot[bot]" ]]; then
264
+ GENERATE_ARTIFACTS="false"
265
+ elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then
266
+ GENERATE_ARTIFACTS="true"
267
+ elif [[ "${{ github.event_name }}" == "push" ]]; then
268
+ GENERATE_ARTIFACTS="true"
269
+ fi
270
+ echo "PUSH_ON_BUILD=${GENERATE_ARTIFACTS}" >> $GITHUB_ENV
271
+ echo "DOCKER_BUILD_PLATFORM_OPTIONS=--platform=linux/amd64" >> $GITHUB_ENV
196
272
- name : Set up Docker Buildx
197
273
uses : docker/setup-buildx-action@v3
198
274
- name : Login to GitHub Container Registry
@@ -204,21 +280,61 @@ jobs:
204
280
- name : Build image
205
281
env :
206
282
IMAGE_NAME : ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator
207
- VERSION : ${COMMIT_SHORT_SHA}
283
+ VERSION : ${COMMIT_SHORT_SHA}-amd64
208
284
SUBCOMPONENT : validator
209
285
run : |
210
286
echo "${VERSION}"
211
287
make build-${{ matrix.dist }}
212
288
289
+ build-multi-arch-images :
290
+ needs : [build-gpu-operator-arm64, build-gpu-operator-validator-arm64, build-gpu-operator-amd64, build-gpu-operator-validator-amd64]
291
+ runs-on : ubuntu-latest
292
+ strategy :
293
+ matrix :
294
+ dist : [ubi9]
295
+ steps :
296
+ - uses : actions/checkout@v4
297
+ name : Check out code
298
+ - name : Calculate build vars
299
+ id : vars
300
+ run : |
301
+ echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
302
+ echo "LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')" >> $GITHUB_ENV
303
+ - name : Login to GitHub Container Registry
304
+ uses : docker/login-action@v3
305
+ with :
306
+ registry : ghcr.io
307
+ username : ${{ github.actor }}
308
+ password : ${{ secrets.GITHUB_TOKEN }}
309
+ - name : Build Manifest
310
+ env :
311
+ OPERATOR_IMAGE_ARM : ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator:${{ env.COMMIT_SHORT_SHA }}-arm64
312
+ OPERATOR_IMAGE_AMD : ghcr.io/${{ env.LOWERCASE_REPO_OWNER}}/gpu-operator:${{ env.COMMIT_SHORT_SHA }}-amd64
313
+ VALIDATOR_IMAGE_ARM : ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator/gpu-operator-validator:${{ env.COMMIT_SHORT_SHA }}-arm64
314
+ VALIDATOR_IMAGE_AMD : ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator/gpu-operator-validator:${{ env.COMMIT_SHORT_SHA }}-amd64
315
+ OPERATOR_MULTIARCH_IMAGE : ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator:${{ env.COMMIT_SHORT_SHA }}
316
+ VALIDATOR_MULTIARCH_IMAGE : ghcr.io/${{ env.LOWERCASE_REPO_OWNER }}/gpu-operator/gpu-operator-validator:${{ env.COMMIT_SHORT_SHA }}
317
+ run : |
318
+ docker manifest create \
319
+ ${OPERATOR_MULTIARCH_IMAGE} \
320
+ ${OPERATOR_IMAGE_AMD} \
321
+ ${OPERATOR_IMAGE_ARM}
322
+ docker manifest push ${OPERATOR_MULTIARCH_IMAGE}
323
+ docker manifest create \
324
+ ${VALIDATOR_MULTIARCH_IMAGE} \
325
+ ${VALIDATOR_IMAGE_AMD} \
326
+ ${VALIDATOR_IMAGE_ARM}
327
+ docker manifest push ${VALIDATOR_MULTIARCH_IMAGE}
328
+
213
329
# ## e2e tests ###
214
330
e2e-tests-containerd :
215
- needs : [build-gpu-operator, build-gpu-operator-validator ]
331
+ needs : [build-multi-arch-images ]
216
332
runs-on : linux-amd64-cpu4
217
333
steps :
218
334
- uses : actions/checkout@v4
219
335
name : Check out code
220
336
- name : Set up Holodeck
221
-
337
+
222
338
with :
223
339
aws_access_key_id : ${{ secrets.AWS_ACCESS_KEY_ID }}
224
340
aws_secret_access_key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -264,13 +380,13 @@ jobs:
264
380
retention-days : 15
265
381
266
382
e2e-tests-nvidiadriver :
267
- needs : [build-gpu-operator, build-gpu-operator-validator ]
383
+ needs : [build-multi-arch-images ]
268
384
runs-on : linux-amd64-cpu4
269
385
steps :
270
386
- uses : actions/checkout@v4
271
387
name : Check out code
272
388
- name : Set up Holodeck
273
-
389
+
274
390
with :
275
391
aws_access_key_id : ${{ secrets.AWS_ACCESS_KEY_ID }}
276
392
aws_secret_access_key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@@ -315,10 +431,39 @@ jobs:
315
431
path : ./logs/
316
432
retention-days : 15
317
433
318
- push- gpu-operator-bundle -image :
434
+ release-latest- gpu-operator-and-validator -image :
319
435
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Runs only if the event is a push to the main branch
320
436
needs : [e2e-tests-containerd, e2e-tests-nvidiadriver]
321
- runs-on : ubuntu-latest
437
+ runs-on : linux-amd64-cpu4
438
+ steps :
439
+ - uses : actions/checkout@v4
440
+ name : Check out code
441
+ - name : set-up regctl
442
+ run : |
443
+ export REGCTL_VERSION=v0.8.2
444
+ mkdir -p bin
445
+ curl -sSLo bin/regctl https://github.com/regclient/regclient/releases/download/${REGCTL_VERSION}/regctl-linux-amd64
446
+ chmod a+x bin/regctl
447
+ echo "$(pwd)/bin" >> $GITHUB_PATH
448
+ - name : Set environment variables
449
+ id : vars
450
+ run : |
451
+ COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}
452
+ LOWERCASE_REPO_OWNER=$(echo "${GITHUB_REPOSITORY_OWNER}" | awk '{print tolower($0)}')
453
+ echo "OPERATOR_VERSION=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
454
+ echo "OPERATOR_IMAGE=ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator" >> $GITHUB_ENV
455
+ echo "VALIDATOR_VERSION=${COMMIT_SHORT_SHA}" >> $GITHUB_ENV
456
+ echo "VALIDATOR_IMAGE=ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/gpu-operator-validator" >> $GITHUB_ENV
457
+ - name : Retag gpu-operator and gpu-operator-validator
458
+ run : |
459
+ regctl registry login ghcr.io -u $GITHUB_ACTOR -p ${{ secrets.GITHUB_TOKEN }}
460
+ regctl image copy ${OPERATOR_IMAGE}:${OPERATOR_VERSION} ${OPERATOR_IMAGE}:main-latest
461
+ regctl image copy ${VALIDATOR_IMAGE}:${VALIDATOR_VERSION} ${VALIDATOR_IMAGE}:main-latest
462
+
463
+ push-gpu-operator-bundle-image :
464
+ if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} # Runs only if the event is a push to the main branch
465
+ needs : [release-latest-gpu-operator-and-validator-image]
466
+ runs-on : linux-amd64-cpu4
322
467
steps :
323
468
- uses : actions/checkout@v4
324
469
name : Check out code
0 commit comments