Skip to content

fix(ci): use GHCR instead of ACR for workflow docker caches - #2264

Merged
baijumeswani merged 5 commits into
mainfrom
dev/sanaahamel/ci-docker-issues
Jul 7, 2026
Merged

fix(ci): use GHCR instead of ACR for workflow docker caches#2264
baijumeswani merged 5 commits into
mainfrom
dev/sanaahamel/ci-docker-issues

Conversation

@sanaa-hamel-microsoft

Copy link
Copy Markdown
Contributor

Azure resources should be read-only from GH workflows.

Copilot AI review requested due to automatic review settings July 6, 2026 16:33

Copilot AI 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.

Pull request overview

This PR aims to move GitHub Actions Docker image caching from Azure Container Registry (ACR) to GitHub Container Registry (GHCR) so GitHub workflows don’t require mutable Azure access.

Changes:

  • Update Docker image naming logic to stop hardcoding the *.azurecr.io hostname.
  • Switch Linux GPU x64 and Linux CPU ARM64 GitHub workflows to use GHCR as the container registry for build-cache images.
  • Add a new repository .ignore file.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
tools/ci_build/get_docker_image.py Changes how full_image_name is constructed when a container registry is provided (now assumes a full registry path).
.github/workflows/linux-gpu-x64-build.yml Updates the workflow to authenticate and push/pull cached images from GHCR instead of ACR.
.github/workflows/linux-cpu-arm64-build.yml Updates the workflow to authenticate and push/pull cached images from GHCR instead of ACR.
.ignore Introduces a new ignore configuration file with only negated patterns.

Comment thread tools/ci_build/get_docker_image.py
Comment thread .github/workflows/linux-gpu-x64-build.yml
Comment thread .github/workflows/linux-cpu-arm64-build.yml
Comment thread .ignore Outdated
@sanaa-hamel-microsoft
sanaa-hamel-microsoft force-pushed the dev/sanaahamel/ci-docker-issues branch 4 times, most recently from c031f8d to b484991 Compare July 6, 2026 19:28

@tianleiwu tianleiwu 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.

Reviewed the switch from ACR to GHCR for the GitHub-hosted docker build caches. The overall design is coherent and correct: GHCR gets read/write (push cache) via job-scoped packages: write, while the ADO pipelines keep pushing to ACR (onnxruntimebuildcache.azurecr.io), and all five in-repo --container-registry call sites were updated consistently for the new full-hostname semantics. Scoping permissions: {contents: read, packages: write} per job is a nice least-privilege touch.

One clarification for the record: the az acr login retained in the two GitHub workflows is not redundant. The Dockerfiles pull their base images FROM onnxruntimebuildcache.azurecr.io/... (e.g. Dockerfile.manylinux2_28_cuda_12.8 uses ARG BASEIMAGE=onnxruntimebuildcache.azurecr.io/..., and the aarch64 CPU Dockerfile has a hard-coded ACR FROM), so ACR pull access is still required. Removing those az login/az acr login steps would break the base-image pull. Keeping ACR pull-only (via the read-only managed identity, which the new object-id 161bbca8... appears to be) is exactly what "Azure resources read-only from GH workflows" means, so this looks intentional and fine.

Minor: the new .ignore file is missing a trailing newline and is unrelated to the CI cache change. Worth confirming which tool is meant to consume it (ripgrep/fd read .ignore and skip dot-dirs by default, so the negated entries do have an effect there, but the file reads as scope creep for this PR).

Suggestions inline. Nothing blocking.

Comment thread tools/ci_build/get_docker_image.py Outdated
Comment thread .github/workflows/linux-gpu-x64-build.yml
Comment thread .github/workflows/linux-cpu-arm64-build.yml
@sanaa-hamel-microsoft
sanaa-hamel-microsoft force-pushed the dev/sanaahamel/ci-docker-issues branch from b484991 to f25ce92 Compare July 7, 2026 17:29
baijumeswani
baijumeswani previously approved these changes Jul 7, 2026
@sanaa-hamel-microsoft
sanaa-hamel-microsoft enabled auto-merge (squash) July 7, 2026 19:14
@baijumeswani
baijumeswani disabled auto-merge July 7, 2026 22:54
@baijumeswani
baijumeswani merged commit 98db17a into main Jul 7, 2026
63 of 69 checks passed
@baijumeswani
baijumeswani deleted the dev/sanaahamel/ci-docker-issues branch July 7, 2026 22:54
tianleiwu pushed a commit that referenced this pull request Jul 11, 2026
Azure resources should be read-only from GH workflows.
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.

5 participants