Skip to content

Commit 535a241

Browse files
committed
make src image multi-arch; remove NGC logic
Signed-off-by: Mitchell <mitch_dz@hotmail.com>
1 parent 54972be commit 535a241

File tree

1 file changed

+24
-28
lines changed

1 file changed

+24
-28
lines changed

.github/workflows/build_package_sources.yml

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@
2424
on:
2525
workflow_dispatch:
2626
inputs:
27-
push_to_NGC:
28-
required: false
29-
type: boolean
30-
default: false
31-
description: 'Push the built source image to NGC, otherwise push to GHCR.'
32-
environment:
33-
required: false
34-
type: string
3527
artifact_url:
3628
required: false
3729
type: string
@@ -378,39 +370,43 @@ jobs:
378370
push: false
379371

380372
- name: Log in to GitHub CR
381-
if: github.event.inputs.push_to_NGC != 'true'
382373
uses: docker/login-action@v3
383374
with:
384375
registry: ghcr.io
385376
username: ${{ github.actor }}
386377
password: ${{ github.token }}
387378

388-
- name: Log in to NGC
389-
if: github.event.inputs.push_to_NGC == 'true'
390-
uses: docker/login-action@v3
391-
with:
392-
registry: nvcr.io
393-
username: '$oauthtoken'
394-
password: ${{ secrets.NGC_CREDENTIALS }}
395-
396-
- name: Tag and push to GHCR or NGC
379+
- name: Tag and push amd64 image
397380
id: push
398381
run: |
399382
docker load --input /tmp/package-sources.tar
400383
cuda_major=$(echo "${{ matrix.cuda }}" | cut -d. -f1)
401384
target_image="nvcr.io/nvidia/nightly/cuda-quantum:cu${cuda_major}-latest"
402385
tag_suffix="${target_image##*:}"
403-
if [ "${{ github.event.inputs.push_to_NGC }}" = "true" ]; then
404-
# Derive push destination from target_image: .../cuda-quantum:tag -> .../cuda-quantum-src:tag
405-
repo_part="${target_image%:*}"
406-
tag="${repo_part}-src:${tag_suffix}"
407-
else
408-
owner_lower=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
409-
tag="ghcr.io/${owner_lower}/cuda-quantum-src:${tag_suffix}"
410-
fi
411-
docker tag package-sources:latest "$tag"
412-
docker push "$tag"
386+
owner_lower=$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
387+
tag="ghcr.io/${owner_lower}/cuda-quantum-src:${tag_suffix}"
388+
tag_amd64="${tag}-amd64"
389+
docker tag package-sources:latest "$tag_amd64"
390+
docker push "$tag_amd64"
413391
echo "image_tag=$tag" | tee -a $GITHUB_OUTPUT
392+
echo "tag_amd64=$tag_amd64" | tee -a $GITHUB_OUTPUT
393+
394+
- name: Create arm64 manifest from amd64 (same contents)
395+
run: |
396+
tag="${{ steps.push.outputs.image_tag }}"
397+
tag_amd64="${{ steps.push.outputs.tag_amd64 }}"
398+
tag_arm64="${tag}-arm64"
399+
docker run --rm \
400+
-v $HOME/.docker/config.json:/root/.docker/config.json:ro \
401+
gcr.io/go-containerregistry/crane:latest \
402+
copy --platform=linux/arm64 "$tag_amd64" "$tag_arm64"
403+
404+
- name: Create and push multi-arch manifest
405+
run: |
406+
tag="${{ steps.push.outputs.image_tag }}"
407+
tag_amd64="${{ steps.push.outputs.tag_amd64 }}"
408+
tag_arm64="${tag}-arm64"
409+
docker buildx imagetools create --tag "$tag" "$tag_amd64" "$tag_arm64" --push
414410
415411
- name: Summary
416412
run: |

0 commit comments

Comments
 (0)