Commit 92f71b3
authored
[CI] Pre-install cmake and handle on Windows AMI (#7989)
## Summary
- Pre-install `cmake` (3.27.9 with `ADD_CMAKE_TO_PATH=System`) and
`handle` (Sysinternals) on the Windows runner AMI during image build
- Removes runtime dependency on Chocolatey CDN, which has had 3 separate
outages in 2 weeks causing false CI failures
## Why
**cmake**: The `ADD_CMAKE_TO_PATH=System` flag is required for CMake's
`FindMKL` module to locate MKL libraries during the PyTorch build.
Without it:
- CUDA builds fail with ~20 unresolved LAPACK/BLAS linker errors from
MAGMA (`error LNK2019: unresolved external symbol zgetrf_`, etc.)
- CPU builds produce binaries where `torch.backends.mkl.is_available()`
returns `False`
Currently cmake is installed at runtime via `choco upgrade cmake` in
`build_pytorch.bat`. When the Chocolatey CDN goes down, this step fails
and breaks the entire build.
**handle**: Used by `setup-win`/`teardown-win` workflow steps to
diagnose file locks. Currently installed at runtime via `choco install
handle` in the `setup-win` action. The `continue-on-error: true` flag
prevents job failure, but the diagnostic step becomes useless when the
CDN is down.
## Context
Chocolatey CDN outages have caused 3 incidents of false Windows CI
failures in 2 weeks:
- meta-pytorch/pytorch-gha-infra#1044
- meta-pytorch/pytorch-gha-infra#1049
- meta-pytorch/pytorch-gha-infra#1078
## Validation
- `packer validate` passes
- Dry-run AMI build (`skip_create_ami=true`) succeeded — all
provisioners including cmake and handle installs completed: [run
24684332723](https://github.com/pytorch/test-infra/actions/runs/24684332723)
- Real AMI build (`skip_create_ami=false`) hangs during AMI snapshot
phase — this is a pre-existing infra issue unrelated to this PR (all
recent real builds hang the same way)
## Rollout plan
1. **Land this PR** and build the new AMI (once the AMI snapshot infra
issue is resolved)
2. **Update AMI filter** in `pytorch-gha-infra`
(`runners/regions/us-east-1/main.tf`) to point to the new AMI
3. **Remove runtime choco calls** in `pytorch/pytorch` — cleanup PR to
remove `choco upgrade cmake` from `build_pytorch.bat` and `choco install
handle` from `setup-win/action.yml`
## Test plan
- [x] `packer validate` passes
- [x] Dry-run AMI build succeeds (all provisioners complete)
- [ ] Real AMI build succeeds (blocked by pre-existing AMI snapshot
hang)
- [ ] Update AMI filter in pytorch-gha-infra and verify Windows trunk
builds pass
- [ ] Land cleanup PR in pytorch/pytorch to remove runtime choco
installs
cc @atalman @tinglvv1 parent ff9c766 commit 92f71b3
1 file changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
6 | 16 | | |
7 | 17 | | |
8 | 18 | | |
| |||
11 | 21 | | |
12 | 22 | | |
13 | 23 | | |
| 24 | + | |
| 25 | + | |
14 | 26 | | |
0 commit comments