Commit d7b57bf
authored
Improve S3 promotion: ordering, R2 grep fixes, and a per-target promoter (#8071)
## Summary
Three coordinated changes to the release promotion path.
### 1. Split `aws_promote` and reorder `s3_to_s3.sh`
`release/promote/common_utils.sh` now splits `aws_promote` into two
functions:
- `aws_promote` - server-side S3 copy only (fast).
- `aws_set_checksums` - the `manage_v2.py --set-checksum` loop, which
downloads every wheel from S3 to compute SHA256 (slow).
`release/promote/s3_to_s3.sh` now calls them in the new order: **S3 copy
→ R2 upload → S3 checksum recompute**. R2 previously waited on
the per-wheel SHA256 download loop because it ran *inside* the old
`aws_promote`; the new ordering unblocks R2 immediately after the
server-side S3 copy.
`aws_set_checksums` also skips automatically when the destination prefix
is not `whl` / `whl/test` (e.g. `libtorch`), since `manage_v2.py
--set-checksum` raises `ValueError: Prefix must be whl or whl/test` for
anything else.
### 2. Fix `r2_promote` grep bugs for glob package names and suffixes
`PACKAGE_INCLUDE_SUFFIX` (e.g. `*manylinux*`) and `PACKAGE_NAME` (e.g.
`libtorch-*`) are AWS S3 *globs* in `aws_promote`'s `--include` flag.
The old `r2_promote` passed them straight to `grep` where `*` is the
regex zero-or-more operator, so `triton-3.7.0*manylinux*` and
`libtorch-*-2.12.0*` matched nothing and R2 silently found 0 files. Both
now have their `*` expanded to `.*` before being plugged into `grep -E`,
so the same expression that selects files for `aws_promote` also selects
them for `r2_promote`.
### 3. New `--promote-from` flag in `update_dependencies.py`
`s3_management/update_dependencies.py` gains a `promote_target` function
and `--promote-from` CLI flag for promoting per-package wheel artifacts
across prefixes (e.g. `whl/test/cu132 -> whl/cu132`). For each entry in
`PACKAGES_PER_PROJECT`, it copies `.whl`, `.whl.metadata`, `.tar.gz`,
and `.tgz` files that exist at the source, matched by distribution name
(PEP 503 normalized), and skips any that already exist at the
destination. Also accepts `xpu` as a valid target name.
Example usage:
```bash
python3 s3_management/update_dependencies.py \
--promote-from whl/test \
--prefix whl \
--target cu132 \
--dry-run
```
## Test plan
- [x] Verified the new `promote_target` finds and copies the right files
for `cu132` in dry-run mode.
- [x] Verified `r2_promote` now matches both `*manylinux*`-filtered
wheels and `libtorch-*` globs after the regex fix.
- [x] Verified `aws_set_checksums` skips with a clean log line for the
libtorch promotion (prefix `libtorch` instead of `whl`).
- [x] Local syntax checks (`bash -n`, `python3 -c "ast.parse(...)"`)
pass for all three files.
- [ ] End-to-end run with `DRY_RUN=disabled` on a real release.
Authored with Claude Code.1 parent 313bb3d commit d7b57bf
3 files changed
Lines changed: 241 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
61 | 62 | | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
83 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
84 | 105 | | |
85 | 106 | | |
86 | 107 | | |
| |||
105 | 126 | | |
106 | 127 | | |
107 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
108 | 137 | | |
109 | 138 | | |
110 | 139 | | |
111 | 140 | | |
112 | | - | |
| 141 | + | |
113 | 142 | | |
114 | 143 | | |
115 | 144 | | |
| |||
129 | 158 | | |
130 | 159 | | |
131 | 160 | | |
132 | | - | |
| 161 | + | |
133 | 162 | | |
134 | 163 | | |
135 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
1082 | 1083 | | |
1083 | 1084 | | |
1084 | 1085 | | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + | |
| 1092 | + | |
| 1093 | + | |
| 1094 | + | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
1085 | 1242 | | |
1086 | 1243 | | |
1087 | 1244 | | |
| |||
1188 | 1345 | | |
1189 | 1346 | | |
1190 | 1347 | | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1191 | 1357 | | |
1192 | 1358 | | |
1193 | 1359 | | |
| |||
1211 | 1377 | | |
1212 | 1378 | | |
1213 | 1379 | | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
1214 | 1394 | | |
1215 | 1395 | | |
1216 | 1396 | | |
| |||
0 commit comments