|
34 | 34 |
|
35 | 35 | from torchci.clickhouse import get_clickhouse_client |
36 | 36 |
|
37 | | - |
38 | 37 | VLLM_REPO = "https://github.com/vllm-project/vllm.git" |
39 | 38 | PIPELINE = "CI" |
40 | 39 |
|
@@ -97,7 +96,9 @@ def find_latest_pair( |
97 | 96 | ) |
98 | 97 |
|
99 | 98 | def as_dict(row: Tuple) -> Dict[str, Any]: |
100 | | - return dict(zip(("number", "title", "commit", "created_at", "state", "url"), row)) |
| 99 | + return dict( |
| 100 | + zip(("number", "title", "commit", "created_at", "state", "url"), row) |
| 101 | + ) |
101 | 102 |
|
102 | 103 | parsed = [as_dict(r) for r in builds] |
103 | 104 | nightlies = [b for b in parsed if b["title"].startswith(TORCH_NIGHTLY_MSG)] |
@@ -228,10 +229,14 @@ def render( |
228 | 229 | for key, jobs in ordered: |
229 | 230 | states = sorted({j["state"] for j in jobs}) |
230 | 231 | exits = sorted({str(j["exit_status"]) for j in jobs}) |
231 | | - out.append(f"<details><summary><b>{key}</b> — {len(jobs)} job(s), " |
232 | | - f"{'/'.join(states)}, exit {','.join(exits)}</summary>\n") |
| 232 | + out.append( |
| 233 | + f"<details><summary><b>{key}</b> — {len(jobs)} job(s), " |
| 234 | + f"{'/'.join(states)}, exit {','.join(exits)}</summary>\n" |
| 235 | + ) |
233 | 236 | for j in sorted(jobs, key=lambda x: x["name"]): |
234 | | - out.append(f"- [{j['name']}]({j['url']}) — `{j['state']}` exit `{j['exit_status']}`") |
| 237 | + out.append( |
| 238 | + f"- [{j['name']}]({j['url']}) — `{j['state']}` exit `{j['exit_status']}`" |
| 239 | + ) |
235 | 240 | out.append("\n</details>") |
236 | 241 |
|
237 | 242 | out.append("\n### Infrastructure check\n") |
@@ -299,6 +304,16 @@ def fetch_cluster_logs( |
299 | 304 | try: |
300 | 305 | with urllib.request.urlopen(req, timeout=120) as resp: |
301 | 306 | body = resp.read().decode("utf-8", errors="replace") |
| 307 | + except urllib.error.HTTPError as exc: |
| 308 | + hint = "" |
| 309 | + if exc.code == 401: |
| 310 | + hint = ( |
| 311 | + " (401 => token invalid for this org. Check it has read_builds " |
| 312 | + "and read_build_logs, that the vllm organization is selected, and " |
| 313 | + "that the value has no trailing newline.)" |
| 314 | + ) |
| 315 | + print(f"skip {key}: HTTP {exc.code} {exc.reason}{hint}", file=sys.stderr) |
| 316 | + continue |
302 | 317 | except urllib.error.URLError as exc: |
303 | 318 | print(f"skip {key}: {exc}", file=sys.stderr) |
304 | 319 | continue |
@@ -366,7 +381,10 @@ def main() -> int: |
366 | 381 | if args.logs_dir and buckets["regressed"]: |
367 | 382 | import os as _os |
368 | 383 |
|
369 | | - token = _os.environ.get("BUILDKITE_TOKEN", "") |
| 384 | + # .strip() matters: a trailing newline in the value (easy to introduce when |
| 385 | + # pasting a token into a secret) makes the Authorization header invalid and |
| 386 | + # every request 401s. |
| 387 | + token = _os.environ.get("BUILDKITE_TOKEN", "").strip() |
370 | 388 | if not token: |
371 | 389 | # Not fatal: the report above is still useful without logs. |
372 | 390 | print("BUILDKITE_TOKEN unset; skipping log fetch", file=sys.stderr) |
|
0 commit comments