Repository navigation
Fixes CI base image pulls when the registry refuses the inherited credential - #7741
kellyguo11 merged 3 commits into
Conversation
…ntial Runners carry an ambient docker credential for a private NGC organization, and nvcr.io refuses that credential a pull token for a public repository instead of downgrading the request to anonymous, so a public base image is unreadable. setup-docker-config takes an optional base-image-ref and, when the configured credentials are denied that image while anonymous access can read it, drops the stored nvcr.io credential from the job's temp config. The fallback is scoped to nvcr.io, only edits a config this action created, and only reacts to an authorization refusal, so other registries and the runner's persistent config are left alone. compute-deps-hash no longer swallows an unreadable base image manifest, which silently dropped the digest from the dependency-cache key. A digest-pinned tag is used directly, a transient failure is retried, and an authorization refusal fails immediately. Co-located tests run the extracted action bodies under bash against stubbed executables and are registered in tools-tests.yml.
|
| if ! DOCKER_CONFIG="${anon_config_dir}" \ | ||
| docker buildx imagetools inspect "${BASE_IMAGE_REF}" >/dev/null 2>&1; then | ||
| echo "::warning::${BASE_IMAGE_REF} is unreadable with the configured credentials and anonymously; leaving the docker config unchanged" | ||
| exit 0 |
There was a problem hiding this comment.
Anonymous Probe Is Not Retried
When configured credentials are denied, anonymous access is tested only once. A transient registry failure during that probe causes the action to retain the known-denied credential and continue, so the subsequent build still attempts to pull the public image with that credential and fails. Retry the anonymous probe before deciding that anonymous access is unavailable.
There was a problem hiding this comment.
Good catch, and it was an inconsistency rather than a deliberate choice: the credentialed probe above already retried a transient failure while this one ran once. Fixed in f2ad0fc, which gives the anonymous probe the same three attempts with the same bounded backoff.
A regression test covers it: a stub that fails the anonymous probe once with a 503 and succeeds on the retry must still end with the nvcr.io credential dropped. Reverting the loop to a single attempt makes test_transient_anonymous_failure_is_retried fail.
The credentialed probe retried a transient failure while the anonymous probe ran once, so a registry blip during that single attempt kept a credential already proven to be denied and the build then failed on the pull this fallback exists to rescue. The anonymous probe now uses the same bounded backoff, and a regression test covers a flaky probe that succeeds on a later attempt.
There was a problem hiding this comment.
Isaac Lab Review Bot
The nvcr.io credential fallback and strict base-image digest handling are narrowly scoped and covered by focused tests. One public action-description mismatch should be corrected before merge: re-invocation is no longer always a no-op when base-image-ref is supplied.
- Design and architecture: The fallback is constrained to nvcr.io, edits only an action-owned temporary Docker config, preserves credentials for other registries, and verifies anonymous readability before removing nvcr.io authentication. Repeated invocations can now rerun the probe and mutate credentials, contrary to the retained no-op description.
- API: The optional
base-image-refinput preserves behavior for callers that omit it, and changed callers pass the configured base-image reference consistently. However, the action description still promises that re-invocation is a no-op even though supplying this input causes the base-image checks to run again and may remove nvcr.io credentials; the description should document the new contract. - Implementation: The implementation validates digests strictly, separates stderr from digest output, retries transient failures, distinguishes authorization failures, and removes matching
authsandcredHelpersentries without affecting ECR or Docker Hub credentials. The remaining requested fix is documentation alignment rather than a flaw in these implementation paths.
Minor fixes needed. Posted 1 actionable finding inline.
Automated review; human maintainers own approval decisions.
| Idempotent: re-invoking it in the same job is a no-op, so callers (e.g. | ||
| ecr-build-push-pull delegating to docker-build) don't need to coordinate. | ||
| Reads NGC_API_KEY from the environment (optional; warns when missing). | ||
| When base-image-ref names an nvcr.io image that the configured credentials are |
There was a problem hiding this comment.
🔵 Suggestion · Api — Description still promises re-invocation is a no-op
Lines 10-11 still state that re-invoking the action in the same job is a no-op so callers need not coordinate, but with base-image-ref set a second invocation now re-runs up to six imagetools inspect probes with sleeps and may delete the stored nvcr.io credential. ecr-build-push-pull delegating to docker-build hits exactly this path. Update the description to say the config is reused but the base-image check re-runs, or record a marker and skip an already-checked ref.
There was a problem hiding this comment.
You are right, and the marker is the better half of that suggestion, so f544df1 does both: a reference already checked in this job is recorded in $GITHUB_ENV and skipped on the second invocation, and the description now says the config is reused and an already-checked reference is not probed again rather than claiming a blanket no-op.
That removes the redundant probes on the ecr-build-push-pull to docker-build path instead of just documenting them. A regression test covers it: with the marker set, a stub that fails if it runs at all still exits 0 with the credential intact, and removing the marker check makes test_already_checked_reference_is_not_probed_again fail.
ecr-build-push-pull delegates to docker-build, so the action can run twice in one job with the same reference. The probes are network calls with backoff and the first run already settled the outcome, so a reference checked in this job is recorded and not probed again. The description said re-invocation was a no-op, which stopped being true once the check existed; it now says what happens.
Description
A job that pulls a public
nvcr.io/nvidia/*base image fails withdenied: Access Denied. The runners carry an ambient docker credential for a private NGC organization, and nvcr.io refuses that credential a pull token for a public repository instead of downgrading the request to anonymous._lib/setup-docker-confignow takes an optionalbase-image-ref: when the configured credentials are denied that image and anonymous access can read it, the stored nvcr.io credential is dropped from the job's temp config so the pull proceeds anonymously._lib/compute-deps-hashstops swallowing an unreadable base image manifest, which silently dropped the digest from the dependency-cache key.load metadata for nvcr.io/nvidia/isaac-sim:6.1.0fails withfailed to fetch oauth token: denied: Access Denied, and an unreadable manifest degrades the deps-cache key to a bare tag string with only a🟠note::error::Reproduction
.github/workflows/config.yamlat a public base image:isaacsim_image_name: nvcr.io/nvidia/isaac-simandisaacsim_image_tag: 6.1.0.NGC_API_KEYis available and the runner's ambient credential is the only one present.Docker Dependency Licenses Check:🔵 Base image ID: nvcr.io/nvidia/isaac-sim:6.1.0with nosha256:suffix, which is the silent digest fallback incompute-deps-hash.Scope
Every workflow on this branch pins the private
nvcr.io/0947644777160149/internal/isaac-simimage today, where the configured credentials succeed and the fallback stays dormant. This change is the prerequisite that lets a public base image be configured without the failure above; it does not change which image any workflow uses.Type of change
Release backport
developScreenshots
Not applicable; this changes CI action behavior only.
Validation
The fallback only narrows credentials, never widens them, so each guard was exercised against a stubbed
dockerand a realistic three-registry config (nvcr.io, ECR, Docker Hub):ubuntu:24.04, whichkitless-docker.ymlpasses: the ref is not an nvcr.io image, so the config is left untouched and the Docker Hub credential keeps its pull-rate budget.DOCKER_CONFIGis never edited.NVCR.IO/...andnvcr.io:443/...resolve to the same registry asnvcr.io/...;nvcr.io.evil.com/...does not match.compute-deps-hash: a digest-pinned tag such aslatest-develop@sha256:...is used directly with no network call, a malformed digest pin fails with a named error, an authorization refusal fails immediately, a transient failure is retried 5 times over about 50 seconds, and a warning on stderr during a successful read is no longer concatenated into the digest..github/actions/_lib/test_registry_credential_fallback.py(14 tests, the co-located pattern ofrun-package-tests/test_cleanup_docker_storage.py) and registered intools-tests.ymlso they run in CI.credHelpershandling each makes the corresponding test fail, so the suite exercises the intended behavior rather than only the happy path.python -m py_compileon the new helper,bash -non everyrun:block in the five changed files, YAML parse of each, andcodespellclean.Checklist
pre-commitchecks with./isaaclab.sh --format— not run; this change touches only.github/, validated withbash -n,py_compile, a YAML parse andcodespell, and the repository's ownpre-commitcheck on this branchdescriptionand the new input document the fallbacksource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that) — not applicable; no package is touchedCONTRIBUTORS.mdor my name already exists there