Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/192522
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit b11e21b with merge base 411e87a ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Follow-up to pytorch#191508. That PR added two gates for docker-affecting PRs. The first, check_docker_builds_ready, requires the PR's own ciflow/docker builds to have run and passed -- that one stays. The second, check_no_docker_merge_skew, additionally required the .ci/docker tree of the *merge commit* to equal the tree ciflow/docker built on the PR head, and refused the merge otherwise: Refusing to merge: this PR modifies the CI docker images, but the .ci/docker tree of the merge commit (...) does not match the tree that ciflow/docker built and tested on the PR head (...) In practice that makes a docker PR win a race against the base branch. Rebasing only helps until the next docker-affecting PR lands, so on a busy day a PR can bounce indefinitely -- pytorch#190639 hit it twice in a row, with the PR-head tree moving (08b9699 -> 75ce86e) while the merge-commit tree stayed the same. Downgrade it to a warning: - The builds-are-green requirement is unchanged: check_docker_builds_ready still blocks (and MandatoryChecksMissingError still makes a normal merge wait). - A missing post-merge image is not fatal. docker-builds.yml runs on push to the default branch, so it publishes the merged tree's images right after the merge, and test-infra's calculate-docker-image polls for the image (docker manifest inspect, up to 120 min) before falling through to rebuilding it locally. So a skew costs time on the first trunk jobs rather than breaking them. - The mismatch is still printed to the merge job log, so a slow or rebuilding trunk job can be correlated with the land race that caused it. Renamed to warn_on_docker_merge_skew so the name matches the behaviour.
236e4a5 to
b11e21b
Compare
ezyang
left a comment
There was a problem hiding this comment.
I'm approving not because I think this is the right thing to do but because it will unblock Docker work. IMO we need a merge queue for Docker image changes in this case
ezyang
left a comment
There was a problem hiding this comment.
approving to unbreak docker lands, but a warn only with high volume means the gate isn't fixing the real problem
|
@pytorchmergebot merge -f "lint looks good, lets merge" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…arn (pytorch#192522) Follow-up to pytorch#191508. ## What pytorch#191508 added, and what changes here It added two gates for docker-affecting PRs, both in `merge_into` so force merges cannot bypass them: 1. **`check_docker_builds_ready`** — the PR's own `ciflow/docker` builds must have run and passed. **Unchanged by this PR.** Pending builds still raise `MandatoryChecksMissingError` so a normal merge waits; missing/failed builds are still refused. 2. **`check_no_docker_merge_skew`** — additionally required the `.ci/docker` tree of the *merge commit* to equal the tree `ciflow/docker` built on the PR head, and refused the merge otherwise. **This PR downgrades it to a warning.** So the "all the builds are green" requirement is fully retained; what goes away is the extra requirement that the base branch not have moved. ## Why Requiring the two trees to match means a docker PR has to win a race against the base branch, and a rebase only helps until the next docker-affecting PR lands. On a busy day a PR can bounce indefinitely. pytorch#190639 hit it twice in a row — the PR-head tree moved (`08b9699a` → `75ce86e4`) after a rebase while the merge-commit tree stayed `ab961773`: ``` Refusing to merge: this PR modifies the CI docker images, but the .ci/docker tree of the merge commit (ab96177...) does not match the tree that ciflow/docker built and tested on the PR head (75ce86e...) ``` **A missing post-merge image is not fatal**, which is the key point: - `docker-builds.yml` triggers on `push` to `main` / `release/*`, so the merged tree's images get built and pushed right after the merge lands. - test-infra's `calculate-docker-image` polls for the image before giving up — `docker manifest inspect` in a loop, `sleep 300` per iteration, up to 120 minutes for non-docker-build jobs — and then falls through to `rebuild=true` and builds it locally. So a skew costs **time** on the first trunk jobs after the merge (waiting for docker-builds, or a local rebuild with longer TTS), not a hard failure. Trading that against docker PRs being unable to land seems like the better default. ## Kept: the diagnostic The mismatch is still printed to the merge job log, so a slow or rebuilding trunk job can be correlated with the land race that caused it: ``` WARNING: docker land race on PR #NNNNN: the .ci/docker tree of the merge commit (...) does not match the tree that ciflow/docker built and tested on the PR head (...). ... the first trunk jobs after this merge may wait for docker-builds to publish the merged tree's images, or rebuild them locally. Merging anyway. ``` Renamed `check_no_docker_merge_skew` → `warn_on_docker_merge_skew` so the name matches the behaviour. ## Test plan - `python -m pytest .github/scripts/test_trymerge.py` → **74 passed, 2 skipped** (the 4 docker-gate tests included; none referenced the renamed function). - `py_compile` clean; no remaining references to the old name (`grep -rn check_no_docker_merge_skew .github/` → empty). - `MergeRuleFailedError` is still used in 7 other places, so the import is not orphaned. ## Trade-off, stated plainly This intentionally reopens the window that pytorch#191508 closed: a docker PR can now land whose post-merge images were never built or tested, which is the shape of the pytorch#190927 / pytorch#186302 land race cited in that PR. The mitigation is that the images are auto-published by `docker-builds.yml` on the merge and that jobs wait for them, so the failure mode is latency rather than red trunk. If dev-infra would rather keep a hard gate, an alternative is to keep refusing only when `check_docker_builds_ready` did **not** pass, i.e. exactly the unbuilt-image case, and always allow the pure-skew case — happy to switch to that. Pull Request resolved: pytorch#192522 Approved by: https://github.com/tinglvv, https://github.com/izaitsevfb, https://github.com/ezyang
Follow-up to #191508.
What #191508 added, and what changes here
It added two gates for docker-affecting PRs, both in
merge_intoso force mergescannot bypass them:
check_docker_builds_ready— the PR's ownciflow/dockerbuilds must haverun and passed. Unchanged by this PR. Pending builds still raise
MandatoryChecksMissingErrorso a normal merge waits; missing/failed builds arestill refused.
check_no_docker_merge_skew— additionally required the.ci/dockertree ofthe merge commit to equal the tree
ciflow/dockerbuilt on the PR head, andrefused the merge otherwise. This PR downgrades it to a warning.
So the "all the builds are green" requirement is fully retained; what goes away is
the extra requirement that the base branch not have moved.
Why
Requiring the two trees to match means a docker PR has to win a race against the
base branch, and a rebase only helps until the next docker-affecting PR lands. On
a busy day a PR can bounce indefinitely. #190639 hit it twice in a row — the
PR-head tree moved (
08b9699a→75ce86e4) after a rebase while the merge-committree stayed
ab961773:A missing post-merge image is not fatal, which is the key point:
docker-builds.ymltriggers onpushtomain/release/*, so the mergedtree's images get built and pushed right after the merge lands.
calculate-docker-imagepolls for the image before giving up —docker manifest inspectin a loop,sleep 300per iteration, up to 120minutes for non-docker-build jobs — and then falls through to
rebuild=trueand builds it locally.
So a skew costs time on the first trunk jobs after the merge (waiting for
docker-builds, or a local rebuild with longer TTS), not a hard failure. Trading
that against docker PRs being unable to land seems like the better default.
Kept: the diagnostic
The mismatch is still printed to the merge job log, so a slow or rebuilding trunk
job can be correlated with the land race that caused it:
Renamed
check_no_docker_merge_skew→warn_on_docker_merge_skewso the namematches the behaviour.
Test plan
python -m pytest .github/scripts/test_trymerge.py→ 74 passed, 2 skipped(the 4 docker-gate tests included; none referenced the renamed function).
py_compileclean; no remaining references to the old name(
grep -rn check_no_docker_merge_skew .github/→ empty).MergeRuleFailedErroris still used in 7 other places, so the import is notorphaned.
Trade-off, stated plainly
This intentionally reopens the window that #191508 closed: a docker PR can now
land whose post-merge images were never built or tested, which is the shape of the
#190927 / #186302 land race cited in that PR. The mitigation is that the images
are auto-published by
docker-builds.ymlon the merge and that jobs wait forthem, so the failure mode is latency rather than red trunk. If dev-infra would
rather keep a hard gate, an alternative is to keep refusing only when
check_docker_builds_readydid not pass, i.e. exactly the unbuilt-image case,and always allow the pure-skew case — happy to switch to that.