Skip to content

ci(docker): PR-side image build and run the GPU matrix inside the freshly built image - #1791

Merged
guapisolo merged 15 commits into
mainfrom
zhichen/te-wheel-version-gate
Jul 25, 2026
Merged

ci(docker): PR-side image build and run the GPU matrix inside the freshly built image#1791
guapisolo merged 15 commits into
mainfrom
zhichen/te-wheel-version-gate

Conversation

@Zhichenzzz

@Zhichenzzz Zhichenzzz commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Problem

build-and-push only runs after merge, so Dockerfile breakage lands on main first — and the tests that do run on a docker PR execute in the old dev image, proving nothing about the image the PR produces.

Change

PR-side docker CI, integrated into pr-test.yml. When a PR touches docker/Dockerfile, docker/build.py, docker/patch/**, or requirements.txt:

  • docker-paths detects the change; docker-build builds cu13-x86 and pushes a PR-scoped radixark/miles:pr-<num> tag (same-repo PRs; forks skip and stay on dev).
  • resolve-ci-image waits for the build and redirects every GPU suite into the freshly built image; a failed build stops the matrix instead of green-lighting the stale image. An explicit ci-image-tag: PR-body directive still wins.
  • docker-pr-tag-cleanup.yml deletes the tag when the PR closes; while the PR is open the tag stays available for re-runs.

Carried fixes, all surfaced by this pipeline validating itself:

  • TE patch step resolves the install dir via importlib.util.find_spec — TE 2.17 dlopens libcuda.so.1 at import, which doesn't exist in the GPU-less build container.
  • NVFP4 reference-quantizer import moved to quantization_ref_nvfp4 (TE 2.17 module rename); caught by the GPU matrix running inside the new image, where the old path no longer exists.
  • docs/ci/02-docker-build.md documents the new flow.

Verification

Self-validating on this PR (head 6bc79c4): docker-build 23:25→23:35, pr-1791 tag pushed 23:35:06, resolve-ci-image 23:35:34, GPU suites from 23:40 — strictly ordered after the fresh image. Full matrix (stage-b 2-GPU, stage-c 2/4/8-GPU on H100+H200) green inside radixark/miles:pr-1791.

TE 2.17 dlopens libcuda.so.1 at import time, which does not exist in the
GPU-less build container; find_spec returns the package path without
executing the module.
@Zhichenzzz
Zhichenzzz force-pushed the zhichen/te-wheel-version-gate branch from 736ddb2 to c44a3e9 Compare July 24, 2026 21:40
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Dockerfile changes were only build-tested by the post-merge push
workflow, so breakage landed on main first (#1781 -> #1789 -> this PR).
Single-arch cu13-x86 build, no registry push, cancels superseded runs.
Comment thread .github/workflows/docker-build-pr.yml Fixed
The build job pushes a pr-<num> tag (same-repo PRs), and a chained
_run-ci.yml call runs the stage-b 2-GPU suite in that image, so a
Dockerfile change is validated by tests rather than only by the build
finishing. Fork PRs still get the no-push build.
Comment thread .github/workflows/docker-build-pr.yml Fixed
Comment thread .github/workflows/docker-build-pr.yml Fixed
Comment thread .github/workflows/docker-build-pr.yml Fixed
Comment thread .github/workflows/docker-build-pr.yml Fixed
@Zhichenzzz Zhichenzzz changed the title docker: locate the TE install dir without importing it (fixes main build, follow-up to #1789) docker(ci): build-test Dockerfile changes on the PR before merge Jul 24, 2026
@guapisolo

Copy link
Copy Markdown
Collaborator

Use https://github.com/radixark/miles/blob/main/.claude/skills/doc-dev/SKILL.md to change CI docs.

@guapisolo

guapisolo commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Looks like the docker re-built is no exec before gpu job run.

@guapisolo

Copy link
Copy Markdown
Collaborator

Could we modify .github/workflows/pr-test.yml and redirect resolve-ci-image to docker-build-pr job ?

PRs touching the image inputs now build and push a pr-<num> tag first;
resolve-ci-image redirects every suite into that image, so GPU results
prove the new image rather than the stale dev one. The standalone
docker-build-pr workflow is superseded; the tag is deleted when the PR
closes so re-runs keep working while it is open.
cpu_runner stages run on bare ubuntu-latest and never use the container
image; needing resolve-ci-image only delayed their fast feedback behind
the image build on docker PRs.
TE 2.17 renamed custom_recipes.quantization_nvfp4 to
quantization_ref_nvfp4; import the new path with a fallback for
pre-2.17 environments.
@Zhichenzzz Zhichenzzz changed the title docker(ci): build-test Dockerfile changes on the PR before merge ci(docker): PR-side image build — run the GPU matrix inside the freshly built image Jul 25, 2026
@Zhichenzzz Zhichenzzz changed the title ci(docker): PR-side image build — run the GPU matrix inside the freshly built image ci(docker): PR-side image build and run the GPU matrix inside the freshly built image Jul 25, 2026
guapisolo and others added 2 commits July 25, 2026 01:23
docker-paths matches changed files by prefix, so an edit to
docker/Dockerfile.rocm also queued the PR-side cu13-x86 build — an image
that never consumes that file. Filter it out of the changed-file list
before the path regex so rocm-only PRs keep running on dev.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
resolve-ci-image assigns pr-<num> before it reads the PR body, so on a
docker PR a successful build wins and the ci-image-tag: directive only
applies when no PR image was built (non-docker or fork PRs). The doc
claimed the opposite precedence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@guapisolo guapisolo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@guapisolo
guapisolo merged commit 775c873 into main Jul 25, 2026
9 checks passed
@guapisolo
guapisolo deleted the zhichen/te-wheel-version-gate branch July 25, 2026 01:42
Zhichenzzz added a commit that referenced this pull request Jul 26, 2026
#1791 made resolve-ci-image depend on docker-build so that a docker PR runs its
suites inside the freshly built image. docker-build only runs when docker files
change, so on every other PR it is skipped -- and GitHub propagates a skip down
the entire needs closure, including through resolve-ci-image's always() guard.
stage-a-cpu carries no if: at all, so it was skipped, and stage-b/stage-c gate on
stage-a-cpu succeeding, so the whole matrix went with it.

The run still reports success, because a skipped job is not a failed one. Since
#1791 merged, PRs 1792/1793/1794 each completed "green" with zero test jobs
expanded; the last run that actually executed anything was #1790 at 07-24T21:17Z,
before the merge. #1791's own CI was green and did run, because it changed
docker/Dockerfile -- the regression could not appear in the PR that introduced it.

Fix keeps the new behavior and restores the old graph: docker-paths and
docker-build now always reach a conclusion instead of skipping, so nothing
downstream is poisoned. With nothing to build, docker-build no-ops on
ubuntu-latest rather than occupying a GPU runner, and reports built=false;
resolve-ci-image reads that output instead of the job result. All seven stage-*
jobs are byte-identical to their pre-#1791 definitions.

docker-paths also loses its `if: github.event_name == 'pull_request'`, which had
the same effect on the nightly cron: no PR context meant a skipped job and a
silently empty scheduled run. It now reports changed=false for non-PR events.
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.

3 participants