Repository navigation
chore(release): publish multi-arch CUDA images to GHCR - #3550
Conversation
Every release now gets a container image that matches its binaries. A new publish-images job in release.yml runs after both Linux CUDA build jobs succeed, builds docker/Dockerfile.cuda for linux/amd64 and linux/arm64 from the release zips just uploaded (the Dockerfile checks each against its .sha256), and pushes one manifest list per target to ghcr.io/lablup/mlxcel with BuildKit SBOM and max provenance plus a GitHub build provenance attestation. Only this job gets packages, id-token and attestations write. No QEMU is used: every RUN in the Dockerfile executes on the build platform. Versioned tags (vX.Y.Z-cuda13, -debug) are pushed first. The moving tags (vX.Y-cuda13, latest-cuda13 and their -debug twins) are added with imagetools create only after both images are pushed and attested, so a failed debug build cannot leave latest moved alone. scripts/ci/docker_image_tags.sh holds the rule: moving tags only for a release event of a stable vX.Y.Z (any hyphen suffix counts as a prerelease) that is a full release and the newest of its line, so dispatches, betas, backports and re-runs of older tags leave latest alone. A tag without docker/Dockerfile.cuda is skipped with a notice. ci.yml gains docker-build (runtime for both platforms, debug for amd64, from the newest release with all four CUDA zips, no login or push) on docker/** changes, and docker-image-tags running the tag rule's tests. Refs #3485
The spark1 dry run measured the buildx builder at 28.9 GB after the two-platform runtime build and 47.5 GB after the two-platform debug build. scripts/ci/free_docker_disk.sh now removes the preinstalled SDKs for both publish-images and docker-build and moves the Docker data root to /mnt when that disk has more room. docker-build now builds debug for both platforms as well, so that disk peak and the amd64-host arm64 build meet a hosted runner before a release does. publish-images skips with a notice when the tag predates the Dockerfile or the publish scripts, instead of failing on a self-healing dispatch of an older tag. Refs #3485
Implementation Review SummaryIntent
Findings AddressedNone needed. No CRITICAL or HIGH findings. Remaining Items
Verification
|
publish-images computed latest-cuda13 and vX.Y-cuda13 at the start of the job and applied them after two image builds of about an hour, so two stable releases finishing out of order could leave latest on the older one. The move step now re-reads the release list and re-runs docker_image_tags.sh right before imagetools create. The job condition uses !cancelled() instead of always(), so a cancelled run does not start publishing. Refs #3485
Security and performance review (head 186ae67)No CRITICAL or HIGH findings, so no commits. actionlint (shellcheck severity=error) is clean on both workflows, Checked and fine: permissions are default-deny at the top and job-scoped. MEDIUM / LOW, report only:
Not yet run (in addition to the known |
free_docker_disk.sh deletes system directories with sudo and prunes every Docker object. Security review noted nothing stops it from running on a self-hosted runner if the script is reused, so it now exits unless RUNNER_ENVIRONMENT is github-hosted. Refs #3485
The CUDA container image paragraph now states the behavior the final workflow has: publishing needs both Linux CUDA builds to succeed even when an unrelated job fails, tags without the Dockerfile or scripts are skipped with a notice, and moving tags are re-decided after the images and attestations are pushed. Validation: tag-rule test, shellcheck, actionlint 1.7.7 on both workflows, cross-repo refs and CUDA arch list checks pass. Refs #3485
Resolves the ci.yml conflict with #3549 by keeping both sides: the docker and docker_tags filters and jobs from this branch and the helm_chart filter and helm-chart job from main.
Bilingual reports for the eight PRs of epic #3488: #3508 (graceful drain), #3509 (CUDA PTX cache trust), #3530 (ROCm hsaco cache trust), #3540 (NVRTC redistributable headers), #3543 (CUDA container image), #3549 (Helm chart), #3550 (GHCR image publishing) and #3554 (chart OCI publishing and docs). Each report names what the PR record leaves unvalidated: a real GHCR push, a GPU pod on a cluster, the amd64 and debug images. The HuggingFace cache follow-up is #3570.
Summary
publish-imagesjob inrelease.yml: after both Linux CUDA build jobs succeed it buildsdocker/Dockerfile.cuda(runtime,debug) forlinux/amd64,linux/arm64from the release zips those jobs just uploaded and pushes one manifest list per target toghcr.io/lablup/mlxcel, with BuildKit SBOM,provenance: mode=max, and anactions/attestprovenance attestation pushed to the registry. Only this job getspackages,id-tokenandattestationswrite; every action in it is SHA-pinned. No QEMU: everyRUNexecutes on the build platform.vX.Y.Z-cuda13,-debug) are pushed first. Moving tags are added last withimagetools create, re-decided from a fresh release list at that point, so a failed debug build cannot leavelatestmoved alone and an older release finishing last cannot take it. The job condition uses!cancelled(), so a cancelled run does not publish.scripts/ci/docker_image_tags.shholds the tag rule: moving tags only for areleaseevent of a stablevX.Y.Zthat is a full release and the newest of its line. Any hyphen suffix counts as a prerelease (not onlyalpha|beta|rc), because betas are promoted to full releases and the release flag cannot tell them apart. Dispatches, betas, backports and re-runs of older tags never movelatest. Beyond the issue's tag contract,vX.Y-cuda13(and-debug) is added under the same rule.ci.yml:docker-build(ondocker/**,.dockerignore, the header allow-list or the disk script) builds both targets for both platforms from the newest release with all four CUDA zips, no login or push;docker-image-tagsruns the tag tests.scripts/ci/free_docker_disk.shremoves preinstalled SDKs and moves Docker's data root to/mntwhen that disk is larger; it refuses to run unlessRUNNER_ENVIRONMENTisgithub-hosted.Validation
actionlint1.7.7 with CI's shellcheck floor passes; full-severity finding count unchanged frommain.check_cuda_arch_lists.pypasses.docker_image_tags_test.sh: 20 cases pass on macOS and Linux; a mutation of the event gate is caught. With the real release list,v0.9.0gets the moving tags and a beta gets none.v0.9.0-beta.3into a loopbackregistry:2: both indexes listlinux/amd64,linux/arm64and two attestation manifests, with SPDX SBOM and provenance for both platforms and the index annotations.imagetools createforlatest-cuda13,v0.9-cuda13andlatest-cuda13-debugkept the same index digests. Builder storage peaked at 28.9 GB (runtime) and 47.5 GB (debug).docker-buildon this PR passed on a hosted amd64 runner in 12 minutes: both targets for both platforms fromv0.9.0-beta.3, so the amd64-host arm64 cross build works. Root had 113 GB free after cleanup, so the/mntmove did not trigger.v0.9.0-beta.3predates fix(cuda): make NVRTC JIT need only redistributable CUDA headers #3540, so the CLI fails oncooperative_groups.h. Every tag that has the Dockerfile contains fix(cuda): make NVRTC JIT need only redistributable CUDA headers #3540 (15e63955precedes66c13292).Not validated
GITHUB_TOKENpackage permissions,gh attestation verify, SBOM and attestation push on a hosted runner (docker-buildneither pushes nor attests), and the/mntrelocation branch..sha384is fetched from the same release.mode=maxprovenance records the resolved base digests.The first push creates the GHCR package as private; set it public once in the package settings.
Closes #3485