Repository navigation
ci: also publish release images to the China mirror - #6
Closed
zhanghaohit wants to merge 1 commit into
Closed
zhanghaohit wants to merge 1 commit into
zhanghaohit wants to merge 1 commit into
Conversation
Every image this workflow pushes to Docker Hub's 4pdosc is now copied to modelsphere.tencentcloudcr.com/4pdosc as well, under the same tags, for users who pull from mainland China, where Docker Hub is slow or blocked. The copy is by digest with crane, which copies manifests verbatim, so both registries serve identical bytes. (buildx imagetools create was ruled out: given a single manifest, such as an image built with provenance disabled, it wraps it in a new index and the digest changes.) crane is a pinned release, checked against its sha256. It runs as its own step after the Docker Hub push, so a mirror outage fails that step without stopping or half-finishing the Docker Hub release. Without the org secrets TCR_USERNAME / TCR_TOKEN it is skipped with a notice.
Collaborator
Author
|
Closing: measured from GitHub-hosted runners, pushing to the mainland-China registry runs at well under 1 MB/s (a 740 MiB image had not finished after more than an hour), so mirroring from the release job would stall releases. The mirror will be fed from a host inside China instead. |
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.
What
After each Docker Hub push to
4pdosc/*, copy the same image tomodelsphere.tencentcloudcr.com/4pdosc/*under the same tags. Pulling from mainland China, Docker Hub is slow or unreachable; the mirror is a public namespace, sodocker pull modelsphere.tencentcloudcr.com/4pdosc/<image>:<tag>works anonymously.How
docker/build-push-actionstep that pushes to Docker Hub. It reuses that step's own tag list and run condition, and copies by the digest that step reports, so it mirrors exactly what was pushed. Tags for other registries in the same list (e.g. ghcr.io) are left alone.crane copy, which copies manifests verbatim: both registries serve the same digest.docker buildx imagetools createwas tried first and rejected -- given a single manifest (an image built withprovenance: false), it wraps it in a new index and changes the digest.TCR_USERNAME/TCR_TOKEN; without them the step is skipped with a notice.Testing
RUNNER_TEMP: crane download + checksum, login, and copy of both tags of an existing release, digest unchanged.crane copywas checked to keep the digest for both a multi-platform index and a single plain manifest.