Repository navigation
bugfix: a release can run different image versions on amd64 and arm64 - #28
Merged
Merged
Conversation
Every workflow run pushes the same per-architecture tags, and the publish job combined whatever they held, so an overlapping run could replace one architecture before a release was published. wodby/mariadb r19 shipped different MariaDB versions on amd64 and arm64 this way. Build jobs now push through wodby/images arch-image-push, which records the pushed digest. Publish jobs load those records with arch-image-pins, and the Makefile resolves each buildx imagetools create source to its recorded digest, failing when this run did not push it. A per-ref concurrency group keeps runs of one branch or tag from overlapping, so an older master run cannot finish last and move floating tags back.
GitHub replaces a pending run with a newer one in the same concurrency group. With only the ref in the group, a scheduled or manual run on master could replace a queued push run, and that commit would never be built. The group now includes the event name, so only a newer run of the same event supersedes a pending one. This also restores the blank line between jobs that the previous commit dropped after the push step.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
A release of
wodby/pythoncan publish a multi-arch image whose amd64 and arm64 images come from different builds, so the two architectures run different versions. This happened towodby/mariadbr19, which shipped MariaDB 10.11.19 on amd64 and 10.11.20 on arm64. This repository publishes the same way.Cause
Each architecture is built on its own runner and pushed to a shared per-architecture tag such as
<version>-amd64. The publish step then joins whatever those tags hold. Release tag runs often start alongsidemasterruns, and every run pushes the same per-architecture tags. When runs overlap, one run can replace a tag just before another run publishes, so the release picks up the other run's image.Solution
Each build now remembers the exact image it pushed, and the publish step joins those remembered images. Another run's push can no longer end up in a release. If this run did not push an image, publishing stops with an error instead of using the shared tag. Pushes to the same branch also wait for each other, so an older
masterrun cannot finish after a newer one and move floating tags back. Image names, tags, and localmaketargets stay the same.Changes
wodby/images/.github/actions/arch-image-push(from bugfix: multi-arch image releases can run different versions on amd64 and arm64 images#71) instead ofmake push. It runsdocker pushon the samemake image-refimage that was tested and scanned, then records the resulting digest.wodby/images/.github/actions/arch-image-pinsbefore./.github/actions.Makefileresolves eachbuildx imagetools createsource through the newarch-imagelookup, which fails when this run recorded no digest for the source.concurrency: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}withcancel-in-progress: false. Tag runs are unaffected because each tag is its own group. The event is part of the group because GitHub replaces a pending run with a newer one in the same group, and a scheduled or manual run must not replace a queued push run.Validation
actionlintpasses.tests/check_image_publishers.pyfrom bugfix: multi-arch image releases can run different versions on amd64 and arm64 images#71) renders every release case with records and confirms that each source becomes its recordedwodby/python@sha256:…digest. It also confirms that a missing record stops publishing. WithoutARCH_IMAGE_PINS, the sources stay the per-architecture tags.make image-ref, which prints$(REPO):$(TAG), the same referencemake pushpushed, with the same step environment.masterand tags.masterrun, check that the publish log combineswodby/python@sha256:…sources and that every architecture of each published tag reports the same version.Deployment
Merge wodby/images#71 first. The pin references its branch commit, which a merge commit keeps reachable.