Skip to content

Fixes CI base image pulls when the registry refuses the inherited credential - #7741

Merged
kellyguo11 merged 3 commits into
isaac-sim:developfrom
myurasov-nv:myurasov/ngc-anon-fallback-develop
Sep 11, 2026
Merged

kellyguo11 merged 3 commits into
isaac-sim:developfrom
myurasov-nv:myurasov/ngc-anon-fallback-develop

Conversation

@myurasov-nv

@myurasov-nv myurasov-nv commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

Description

A job that pulls a public nvcr.io/nvidia/* base image fails with denied: 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-config now takes an optional base-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-hash stops swallowing an unreadable base image manifest, which silently dropped the digest from the dependency-cache key.

Before After
load metadata for nvcr.io/nvidia/isaac-sim:6.1.0 fails with failed 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 The credential is dropped for nvcr.io only when it is provably the obstacle, the pull proceeds anonymously, and an unreadable manifest fails with a named ::error::

Reproduction

  1. Point .github/workflows/config.yaml at a public base image:
    isaacsim_image_name: nvcr.io/nvidia/isaac-sim and isaacsim_image_tag: 6.1.0.
  2. Open a pull request from a fork, so no NGC_API_KEY is available and the runner's ambient credential is the only one present.
  3. Observe any job that builds the base image, for example Docker Dependency Licenses Check:
#3 [auth] nvidia/isaac-sim:pull token for nvcr.io
#4 [internal] load metadata for nvcr.io/nvidia/isaac-sim:6.1.0
#4 ERROR: failed to authorize: failed to fetch oauth token: denied: Access Denied
ERROR: failed to build: failed to solve: failed to fetch oauth token: denied: Access Denied
  1. The same step also logs 🔵 Base image ID: nvcr.io/nvidia/isaac-sim:6.1.0 with no sha256: suffix, which is the silent digest fallback in compute-deps-hash.

Scope

Every workflow on this branch pins the private nvcr.io/0947644777160149/internal/isaac-sim image 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

  • Bug fix (non-breaking change which fixes an issue)

Release backport

  • Backport this pull request to the active release branch after it merges into develop

Screenshots

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 docker and a realistic three-registry config (nvcr.io, ECR, Docker Hub):

  • Public nvcr.io image, credentials denied, anonymous readable: the nvcr.io entry is dropped and the ECR and Docker Hub entries survive, so pushes keep working.
  • ubuntu:24.04, which kitless-docker.yml passes: the ref is not an nvcr.io image, so the config is left untouched and the Docker Hub credential keeps its pull-rate budget.
  • Private internal image readable with credentials: no probe fallback, no change.
  • Registry 503 rather than an authorization refusal: retried, then a warning, and the credential is kept, so a transient error cannot cost a working credential.
  • A docker config this action did not create: left unchanged, so a runner-level DOCKER_CONFIG is never edited.
  • NVCR.IO/... and nvcr.io:443/... resolve to the same registry as nvcr.io/...; nvcr.io.evil.com/... does not match.
  • compute-deps-hash: a digest-pinned tag such as latest-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.
  • These are committed as .github/actions/_lib/test_registry_credential_fallback.py (14 tests, the co-located pattern of run-package-tests/test_cleanup_docker_storage.py) and registered in tools-tests.yml so they run in CI.
  • Mutation checks: removing the nvcr.io scope, the exact-digest check, the ownership guard, or the credHelpers handling each makes the corresponding test fail, so the suite exercises the intended behavior rather than only the happy path.
  • python -m py_compile on the new helper, bash -n on every run: block in the five changed files, YAML parse of each, and codespell clean.

Checklist

  • I have read and understood the contribution guidelines
  • I have run the pre-commit checks with ./isaaclab.sh --format — not run; this change touches only .github/, validated with bash -n, py_compile, a YAML parse and codespell, and the repository's own pre-commit check on this branch
  • I have made corresponding changes to the documentation — the action's description and the new input document the fallback
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a changelog fragment under source/<pkg>/changelog.d/ for every touched package (do not edit CHANGELOG.rst or bump extension.toml — CI handles that) — not applicable; no package is touched
  • I have added my name to the CONTRIBUTORS.md or my name already exists there

…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.
@greptile-apps

greptile-apps Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The PR should not merge until the anonymous-access probe handles transient failures without retaining a credential already proven to be denied.

Findings

  1. P1 Anonymous Probe Is Not Retried ▶

Summary

  • Probes the configured credential before selectively removing nvcr.io authentication from an action-owned Docker configuration.
  • Preserves credentials for unrelated registries and validates digest-based cache identities.
  • Wires the base-image reference through build actions and license checks.
  • Adds co-located tests to the tools-test workflow.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Create or reuse temporary Docker config] --> B{Base image is on nvcr.io?}
  B -- No --> C[Keep configuration unchanged]
  B -- Yes --> D{Configured probe succeeds?}
  D -- Yes --> C
  D -- Authorization denied --> E{Anonymous probe succeeds?}
  D -- Other failure after retries --> C
  E -- Yes --> F[Remove nvcr.io auth and credential-helper entries]
  E -- No --> C
  F --> G[Build or inspect image anonymously]
Loading

Reviews (1) · Last reviewed commit: "Fix CI base image pulls when the registr..."

Comment on lines +117 to +120
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@isaaclab-review-bot isaaclab-review-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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-ref input 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 auths and credHelpers entries 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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.
@myurasov-nv myurasov-nv added the ci:run-docker Trigger the on-demand Docker and GPU CI workflow label Sep 10, 2026
@kellyguo11
kellyguo11 merged commit 41d47ce into isaac-sim:develop Sep 11, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:run-docker Trigger the on-demand Docker and GPU CI workflow infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants