Skip to content

[CI] docker_pull_with_retry: Fall back to mirror.gcr.io when a Docker Hub pull fails - #7694

Merged
gyohuangxin merged 2 commits into
ROCm:mainfrom
syang-genai:ci/docker-pull-mirror-fallback
Nov 10, 2026
Merged

gyohuangxin merged 2 commits into
ROCm:mainfrom
syang-genai:ci/docker-pull-mirror-fallback

Conversation

@syang-genai

@syang-genai syang-genai commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fork PRs often fail the Aiter Test gate without being tested: their wheel build can't pull rocm/pytorch because Docker Hub rate-limits the anonymous pull (429 Too Many Requests). docker_pull_with_retry.sh now falls back to mirror.gcr.io, checks that the image's manifest digest matches Docker Hub's, and retags it under its original name.

Motivation

aiter-test.yaml skips "Docker login" for fork PRs, which keeps registry secrets away from fork code. The build-only-aiter runners start without the image, so "Pull Aiter build image" pulls it anonymously, sharing the runner's per-IP limit. When that limit is hit, all 5 attempts get 429 (60 s apart), the wheel build fails, the GPU tests are skipped, and the test gate fails.

Of the last 49 pull_request Aiter Test runs (2026-11-09/10):

PR source completed (not cancelled) failed failed at "Pull Aiter build image"
same repo 23 0 0
fork 15 7 6

The seventh fork failure was in "Standard Tests". One of the six is #7576 (job log). A re-run passes only if the limit has reset or the job lands on a runner that already has the image.

Changes

  • .github/scripts/docker_pull_with_retry.sh: after a failed docker pull of a Docker Hub image, each attempt also tries mirror.gcr.io/<repo>:<tag>, which is Google's public Docker Hub mirror. The mirror image is used only if its manifest digest equals the one Docker Hub serves for that tag, read with a manifest HEAD request (which doesn't count toward the pull limit). Only then is it retagged under the original name, so docker run, docker image inspect and the rest of each workflow are unchanged.
  • The fallback isn't used for images that name another registry (ghcr.io/..., localhost:5000/...) or are pinned by digest. DOCKER_PULL_MIRROR="" turns it off, and DOCKER_PULL_MIRROR=<host> points it at another Docker Hub mirror.
  • A successful Docker Hub pull takes the same path as before. All callers get the fallback: aiter-test, flash_attention_integration, prepare-triton-wheel, vllm_benchmark and vllm-disagg-ci-smoke.

Testing

  • Unit tests added or updated
  • Performance benchmarks run
  • Tested on MI250X
  • Tested on MI300X

See "Validation and unverified scope" below.

Documentation

  • No documentation change is needed, with the reason stated below

The behavior is described in the script's comments; no user-facing docs cover CI image pulls.

Dependencies

  • No new third-party dependencies added

The script now uses curl and sed, both already on the runners.

Breaking Changes

None.

PR Self-Review

Reviewed revision

55b8ef7

Behavior and intent

When Docker Hub refuses an anonymous pull, the script now gets the same image, verified by manifest digest, from mirror.gcr.io. Fork PRs stop failing the Aiter Test gate at "Pull Aiter build image" on a 429.

Validation and unverified scope

  • Both CI images, rocm/pytorch:rocm7.2.4_ubuntu24.04_py3.12_pytorch_release_2.10.0 and ..._ubuntu22.04_py3.10_..., have the same manifest digest on mirror.gcr.io and Docker Hub (sha256:4449f856… and sha256:3b71b642…).

  • The script against a stub docker, with the real Docker Hub digest lookup, over 12 cases:

    Case Result
    Docker Hub pull succeeds used directly; no mirror request
    Docker Hub 429, mirror digest matches (py3.12 and py3.10 tags; also with a docker.io/ prefix) pulled from the mirror and retagged
    mirror digest differs, or Docker Hub's digest can't be read mirror image not used; the script fails as before
    mirror pull fails the script fails as before
    ghcr.io, localhost:5000 or digest-pinned image no mirror request
    DOCKER_PULL_MIRROR="" no mirror request
    no arguments usage error (exit 2), as before
  • shellcheck 0.11.0 is clean.

Unverified: a real docker pull from mirror.gcr.io on a build-only-aiter runner, which a fork PR's CI here would show. I also haven't measured whether mirror.gcr.io throttles these runners, though it publishes no per-IP limit like Docker Hub's. If the fallback fails, the script fails exactly as it does today.

PR-specific question

  • Permissions. No new permission, secret or token. The script runs inside the existing job steps. Fork jobs still skip Docker login, and the mirror pull and the digest lookup are both anonymous.
  • Untrusted input. The image name comes from ci-config.yaml or the calling workflow, not from PR text. The script builds the mirror and Docker Hub URLs from it with fixed hosts and doesn't evaluate it. A fork PR can already change these files in its own run, so this adds no new path.
  • Privileged path. The one thing that outlives the job is the retagged image in a persistent runner's Docker cache, which later same-repo jobs reuse through docker image inspect. That is why the digest check exists: a mirror image is only given the Docker Hub name when its manifest digest equals the one Docker Hub serves for that tag. Without a match, it isn't tagged.

Changed op tests

None.

… Hub pull fails

Fork PRs get no Docker Hub credentials (aiter-test.yaml skips "Docker login"
for them), so the build runner pulls rocm/pytorch anonymously and shares the
per-IP rate limit. Docker Hub then answers 429 Too Many Requests on every
retry, the wheel build fails, the GPU tests are skipped and the test gate
fails without testing the change. Of the last 15 completed fork-PR Aiter Test
runs, 7 failed, 6 of them at "Pull Aiter build image"; same-repo PRs had none
in the same window.

mirror.gcr.io, Google's public Docker Hub mirror, serves the same images.
After a failed Docker Hub pull, the script pulls the image from the mirror,
checks that its manifest digest is the one Docker Hub serves for that tag
(a manifest HEAD, which doesn't count toward the pull limit), and only then
retags it under its original name, so later steps are unchanged. If the
digests differ or Docker Hub's can't be read, the mirror image isn't used.
Images that name another registry or are pinned by digest are not
redirected, and DOCKER_PULL_MIRROR="" turns the fallback off.

Signed-off-by: syang-genai <[email protected]>
@syang-genai
syang-genai requested a review from a team November 10, 2026 02:17
@github-actions

Copy link
Copy Markdown
Contributor

🏷️ CI Guide

Runs automatically on every PR:

  • ✅ Pre-checks (submodule verification, code formatting)
  • ✅ Aiter standard tests on MI35X
  • ✅ Triton tests on MI35X (only when aiter/ops/triton/** or related paths are changed)

Extended tests (opt-in via labels):

Label Tests
ci:mi300x Run Aiter standard tests on MI300X in PRs; main branch always runs them
ci:gfx1250-ffm-triton Run the five-shard gfx1250 FFM Triton test suite
ci:triton-300x Run an additional Triton test job on MI300X in PRs (added automatically when gfx942 configs change); main branch always runs both MI35X and MI300X
ci:triton-355 Run the full Triton test suite on MI35X, not only the tests the change affects
ci:windows Windows JIT op smoke test on the Radeon R9700 ROCm runner
ci:multi-gpu Aiter multi-GPU tests on the 8-GPU runner
ci:sglang SGLang integration tests: DeepSeek-R1-MXFP4 accuracy, Qwen 3.5 accuracy
ci:atom ATOM benchmark: DeepSeek-R1-0528, GPT-OSS-120B
ci:atom_full ATOM accuracy suite for PR and main models from ATOM models_accuracy.json
ci:vllm vLLM benchmark: DeepSeek-V4-Pro, MiniMax-M3-MXFP4
ci:all All standard extended tests (excludes ci:atom_full)

Only add ci:atom_full for FlyDSL or Triton upgrades.
Add labels via the sidebar or gh pr edit 7694 --add-label <label>

One backend per PR:
A PR changes one kernel backend: [Triton/Gluon] (Triton and Gluon count as one), [HIP], [ASM], [CK], [OPUS] or [FlyDSL]. If the title ends up with two backend tags, split the PR -- as stacked pull requests when one part cannot merge without the other.

PR title tags & labels:
Component tags ([Triton/Gluon], [HIP], [CK], [ASM], ...) are added to the PR title and as PR labels automatically from the changed files and re-synced on every push — change-type tags like [fix]/[Perf], op tags like [MLA], and human labels (ci:*) are left untouched. Add the no-auto-title label to stop the title rewrites; labels stay in sync either way.

Reviews:
A reviewer is usually assigned within one working day after the PR is ready for review (see Code Review Process). If nobody has responded for about a week, mention the area contact listed in CONTACTS.md. Want to help review? See REVIEWERS.md.

@github-actions github-actions Bot added the CI label Nov 10, 2026
@aiter-bot

aiter-bot commented Nov 10, 2026 •

Copy link
Copy Markdown

WAITING ON AUTHOR

PR Self-Review

Revision 187a7d4c5751 · mode shadow

Waiting for the PR author. The readiness report will appear after the self-review answers are complete for this revision.

Questions to answer in the PR description

  1. What behavior does this PR change, and why is the existing behavior insufficient?
  2. What did you validate, and what remains unverified? Include commands, hardware/configuration and results.
  3. What permissions and untrusted-input boundary does this CI change have, and can fork PR code or text reach a privileged execution path?
  4. For every changed op_tests/ file, what behavior does it cover and why is it not redundant? Write None if no op test changed.

Edit the PR Self-Review section in the PR description. Include the current revision SHA; this comment refreshes automatically.

Missing or invalid answers

  • FAIL — Reviewed revision must contain at least the first 7 characters of the current head SHA

Shadow mode reports what would block but keeps the status successful. Set AITER_PR_SELF_REVIEW_MODE=enforce only after reviewing real false positives.

@gyohuangxin gyohuangxin self-assigned this Nov 10, 2026

@gyohuangxin gyohuangxin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, @syang-genai thanks for the optimization!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants