Skip to content

Add ACR cache-hit checks to avoid Docker Hub rate limits on Nexus image pulls#4918

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/reexamine-nexus-image-pull-process
Draft

Add ACR cache-hit checks to avoid Docker Hub rate limits on Nexus image pulls#4918
Copilot wants to merge 2 commits into
mainfrom
copilot/reexamine-nexus-image-pull-process

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

Every pipeline run unconditionally calls az acr import for the Nexus image, hitting Docker Hub even when the image is already cached in ACR. This causes intermittent 429: TOOMANYREQUESTS failures that block CI for up to 6 hours.

What is being addressed

  • bundle_runtime_image_build.sh always imports from Docker Hub on every publish, regardless of whether the image already exists in ACR.
  • deploy_nexus_container.sh proceeds directly to docker pull with no preflight check, giving a confusing retry-then-timeout failure if the image was never imported.

How is this addressed

  • devops/scripts/bundle_runtime_image_build.sh — before az acr import, query ACR for the target tag and skip the import if it already exists:

    if az acr repository show-tags \
      --name "${ACR_NAME}" \
      --repository "${image_name}" \
      --query "[?@=='${version}'] | [0]" \
      --output tsv 2>/dev/null | grep -qx "${version}"; then
      echo "Image ${image_name}:${version} already exists in ACR ${ACR_NAME}; skipping import"
      exit 0
    fi

    Query errors (repository not yet created, transient network blip) are suppressed so execution falls through to the import, which will surface real auth/network failures.

  • templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh — after ACR login succeeds, run docker manifest inspect before entering the pull retry loop. Exits immediately with a clear diagnostic if the image is absent:

    if ! docker manifest inspect "$NEXUS_IMAGE" > /dev/null 2>&1; then
      echo "ERROR - Image $NEXUS_IMAGE is missing from ACR ${ACR_NAME}. Ensure the bundle was published with the correct image tag."
      exit 1
    fi

- devops/scripts/bundle_runtime_image_build.sh: before az acr import,
  query ACR for the target tag; skip the import if it already exists.
  Errors from the query (e.g. repository not yet created) are suppressed
  intentionally so that any real auth/network failure is surfaced by the
  subsequent az acr import command.

- templates/shared_services/sonatype-nexus-vm/scripts/deploy_nexus_container.sh:
  after successful ACR login, run `docker manifest inspect` on the target
  image; exit immediately with a clear diagnostic message if the image is
  absent from ACR instead of silently falling back to Docker Hub.
Copilot AI changed the title [WIP] Reexamine Nexus image pull process due to rate limits Add ACR cache-hit checks to avoid Docker Hub rate limits on Nexus image pulls May 27, 2026
Copilot AI requested a review from rudolphjacksonm May 27, 2026 14:37
@microsoft microsoft deleted a comment from github-actions Bot May 27, 2026
@rudolphjacksonm
Copy link
Copy Markdown
Collaborator

/test-extended 84b2c45

@github-actions
Copy link
Copy Markdown

🤖 pr-bot 🤖

🏃 Running extended tests: https://github.com/microsoft/AzureTRE/actions/runs/26521694588 (with refid d8e27863)

(in response to this comment from @rudolphjacksonm)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reexamine Nexus image pull process

2 participants