Repository navigation
CI: verify GPU driver installer SHA-256 before execution #3249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
64a8a2b
08cba07
2e775e1
4d2aa83
5151c9a
06707f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Ensure custom DRIVER entries in ci/test-matrix.yml carry valid, consistent SHA-256 hashes.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| from pathlib import Path | ||
|
|
||
| import pytest | ||
| import yaml | ||
|
|
||
| MATRIX_PATH = Path(__file__).resolve().parents[2] / "test-matrix.yml" | ||
| SHA256_RE = re.compile(r"^[0-9a-f]{64}$") | ||
| PREINSTALLED_DRIVERS = {"latest", "earliest"} | ||
|
|
||
|
|
||
| @pytest.mark.agent_authored(model="gemini-4-argon") | ||
| def test_test_matrix_custom_drivers_have_valid_consistent_sha256() -> None: | ||
| matrix = yaml.safe_load(MATRIX_PATH.read_text(encoding="utf-8")) | ||
| seen_hashes: dict[tuple[str, str, str, str], str] = {} | ||
| custom_rows = 0 | ||
|
|
||
| for platform in ("linux", "windows"): | ||
| for section_name, rows in matrix[platform].items(): | ||
| for index, row in enumerate(rows): | ||
| driver = row["DRIVER"] | ||
| if driver in PREINSTALLED_DRIVERS: | ||
| assert "DRIVER_SHA256" not in row, f"{platform}.{section_name}[{index}] sets DRIVER_SHA256" | ||
| continue | ||
| custom_rows += 1 | ||
| sha256 = row.get("DRIVER_SHA256", "") | ||
| assert SHA256_RE.fullmatch(sha256), f"{platform}.{section_name}[{index}] has invalid DRIVER_SHA256" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| key = (platform, str(row["ARCH"]), "" if platform == "linux" else str(row["GPU"]), str(driver)) | ||
| assert seen_hashes.setdefault(key, sha256) == sha256, f"Conflicting DRIVER_SHA256 for {key}" | ||
|
|
||
| assert custom_rows > 0 | ||
Uh oh!
There was an error while loading. Please reload this page.