Add ECR Public mirroring for slim images via dispatch - #286
Open
avallete wants to merge 1 commit into
Open
Conversation
Slim images are published to ghcr.io/supabase/cli/<service> only, so the CLI cannot pull them through public.ecr.aws like its other images, and mirror drift keeps surfacing as manifest-not-found failures in dependent CI. Reuse the mirror machinery and AWS credentials that already live in supabase/cli instead of provisioning AWS access for this repository. - scripts/ecr-mirror.sh sends a mirror-slim-image repository_dispatch to supabase/cli and polls public.ecr.aws/supabase/cli/<service>:<version> anonymously until its index digest matches the published GHCR digest. Its sync mode audits every published release and can re-request out-of-sync tags, which doubles as the backfill path. - service-release.yml gains a mirror-ecr job between publish-image and publish-release. It skips with a notice until the CLI_MIRROR_DISPATCH_TOKEN secret exists; once configured, an unverified mirror fails the release, and verified releases list the ECR references in their notes. - ecr-mirror-check.yml runs the sync audit daily. - docs/design/ecr-mirror-dispatch.md records the dispatch contract the supabase/cli handler must implement (digest-preserving copy, payload validation, repository creation) and the setup checklist. - scripts/test-ecr-mirror.sh covers the payload contract, input validation, and the token guard, and is wired into repository checks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YaJgsq9xTCpMnEhqesr87S
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.
Summary
This change adds automated mirroring of slim images from GHCR to AWS ECR Public by leveraging the existing mirror infrastructure in the
supabase/clirepository. Images are mirrored via arepository_dispatchevent, with verification that the destination digest matches the source before releasing.Key Changes
New
scripts/ecr-mirror.sh: Main script providing four subcommands:payload: Renders a repository_dispatch request body for a single releaserequest: Sends the dispatch event and polls the destination until the digest matchesverify: Polls the destination until the digest matches (no-op if already synced)sync: Compares all published releases against ECR Public and reports drift; with--requestflag, dispatches mirror requests for missing/mismatched tagsNew
scripts/test-ecr-mirror.sh: Comprehensive test suite validating:New
.github/workflows/ecr-mirror-check.yml: Daily scheduled workflow that:Updated
service-release.yml:mirror-ecrjob that runs afterpublish-imageregctlfor digest verificationpublish-releasedepend onmirror-ecrto ensure releases only happen when both registries are in syncNew
docs/design/ecr-mirror-dispatch.md: Design documentation covering:cli/namespace in ECR PublicUpdated test infrastructure: Added
test-ecr-mirror.shto the repository checks workflowImplementation Details
regctlfor anonymous digest verification, avoiding the need for ECR credentials in this repositoryCLI_MIRROR_DISPATCH_TOKENis configuredsynccommand can be used for backfilling existing releases that predate the mirroring featurehttps://claude.ai/code/session_01YaJgsq9xTCpMnEhqesr87S