Move docker-builds to OSDC runners - #22106
Conversation
OSDC runner pods have no docker daemon, so the ci-image builds move to the in-cluster BuildKit pool. build.sh switches to `docker buildx build --push` when REMOTE_BUILDKIT is set and is otherwise unchanged, and the workflow drives it through test-infra's docker-build-remote-buildkit action, which registers the per-architecture remote builder and rides out a cold builder pool. The tag is now computed in the workflow rather than by calculate-docker-image, but it is the same string that action produced for `ci-image:<name>` consumers (executorch/ci-image:<name>-$(git rev-parse HEAD:.ci/docker)), so jobs still on linux_job_v2 keep resolving their images while the v3 migration lands separately. The orchestrator runner only streams the .ci/docker context to BuildKit and waits, so it drops to the smallest label of the matching architecture, and executorch-ubuntu-22.04-cuda-windows moves off the GPU runner it never used. Authored with Claude Code.
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22106
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit d4c09e3 with merge base 9a2d135 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
A fork PR gets no OIDC token, so on OSDC a pull_request-triggered build cannot assume role/arc to push. Applying the ciflow/docker label tags the PR head and fires the push trigger with the PR's own SHA, which does work. pull_request stays for now and comes out once that path is proven. Authored with Claude Code.
Applying the label only pushes a tag if the tag is listed here, so the trigger added in the previous commit is inert without it. Authored with Claude Code.
Removing the pull_request trigger otherwise made rebuilding the images a thing contributors have to remember. The labeler applies ciflow/docker on the same paths docker-builds triggers on, which pytorchbot turns into the tag push. Authored with Claude Code.
a714fb0 to
0b1172b
Compare
arc.yaml maps linux.arm64.2xlarge to l-arm64g2-6-32 and ci-infra renamed that def to l-arm64g2-6-25, but neither name schedules: the three arm64 legs of the first run of this workflow sat queued for nearly four hours and were cancelled without a runner ever picking them up. mt-l-arm64g4-16-62 is the only arm64 label with live production evidence, and it is what pytorch/pytorch's own OSDC docker-builds uses. Authored with Claude Code.
0b1172b to
5723f87
Compare
The compiler stubs route through sccache, which resolves its S3 credentials from EC2 instance metadata. A BuildKit pod has none, so every compiler invocation died on a metadata timeout and took the PyTorch build's CMake compiler check with it. Dropping the S3 backend was the smaller change but not a viable one: the PyTorch build layer takes ~19 minutes against a 240 minute job timeout, which only holds because sccache is serving nearly all of it. So docker-builds hands the assumed-role credentials to the build as a BuildKit secret instead, which role/arc already has write access to the bucket for. A secret mount never lands in a layer. install_pytorch.sh falls back to a local cache when the secret is absent, so a build outside CI still works rather than failing on the first compile. Authored with Claude Code.
|
Follow-up, deliberately not in this PR: The plan is to cache on Note sccache already covers the expensive part: the PyTorch build layer is ~19 min of a ~40 min image build, almost entirely cache hits. |
|
Went through this and checked each piece against pytorch's already migrated workflow. The mechanics look right. A few things below. 1. Every PR touching these paths will build all 16 images twice
Cost: the last full matrix on main (run 32407405402) used about 610 job minutes, so this roughly doubles that on every push. On a fork it is also always red: the Suggestion: drop the 2. The build no longer retries
3. Docker Hub login is gone The old path fetched a read-only Docker Hub token and ran 4. Small comment fix
5. Question on the labeler rule Auto-applying Things I checked that look correct
|
Removing the pull_request trigger settles the duplicate-run problem: the labeler applies ciflow/docker on the same paths, so every PR touching them was building all 16 images twice, and the pull_request half was always red on a fork for want of an OIDC token. calculate-docker-image ran the build under three retries because it "frequently fails with network error downloading various stuffs". docker-build-remote-buildkit only retries failures from before BuildKit starts, so a hiccup downloading the QNN, MediaTek, Arm or Zephyr SDKs would now fail the job outright. Put an equivalent retry back around the build. Authored with Claude Code.
|
Thanks — addressed in 9ebfb7a..d4c09e3.
|
7aa5cce to
d4c09e3
Compare
|
Re-checked at the new head. My earlier items look addressed, and run 32799247406 built 16 of 16 images green, so the runner move and the sccache secret work. Four things left. 1. The retry has no per attempt limit. The old path killed each attempt at 90 minutes and tried again. The new 2. The tag does not cover 3. The tag trigger cannot be tested from here. 4. |
Part 1 of moving ExecuTorch's Linux CI to OSDC. #22107 migrates
linux_job_v2->v3, #22108 the native jobs.OSDC pods have no docker daemon, so the builds move to the in-cluster BuildKit pool:
build.shswitches todocker buildx build --pushunderREMOTE_BUILDKIT, driven by test-infra'sdocker-build-remote-buildkitaction. The tag is computed in the workflow now, but it is the same stringcalculate-docker-imageproduced, so jobs still on v2 keep resolving. That action only retries failures from before BuildKit starts, so the three retriescalculate-docker-imagewrapped the build in are kept around the SDK downloads.sccache resolved its S3 credentials from EC2 instance metadata, which a BuildKit pod has none of, so every compiler invocation died on a metadata timeout. They now reach the build as a BuildKit secret, and
install_pytorch.shcaches locally when it is absent. Dropping the S3 backend would have been the smaller change, but the PyTorch build layer takes ~19 minutes only because sccache serves nearly all of it, and uncached it would not fit the job timeout.pull_requestgives way tociflow/docker, since a fork PR gets no OIDC token and could never push. The tag is registered inpytorch-probot.ymland auto-applied on the paths that need a rebuild, so such a PR still rebuilds its images without anyone having to remember — the same rule pytorch has.All 16 images build and push green on OSDC in run 32799247406: 16–48 min each against 37–56 on EC2, arm64 included.
Authored with Claude Code.