Repository navigation
ci: refresh the compliance baseline in auto-upgrade pipeline #14206
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3d3b0ca
ci: refresh the compliance baseline in the trtllm auto-upgrade pipeline
nv-anants 5256d4d
ci: run the dep-upgrade pipeline from the ref it was dispatched on
nv-anants f555993
ci: serialize auto-dep-upgrade runs per ref
nv-anants 0641642
ci: run the baseline capture on the Fastchecker group
nv-anants d821064
temp: exercise the upgrade pipeline on push to this branch
nv-anants 3614179
revert: drop the CI rig used to validate the upgrade pipeline
nv-anants c0c3488
fix: address review findings on the dep-upgrade pipeline
nv-anants 70488cd
Merge branch 'main' into anants/auto-dep-upgrade-baseline-refresh
nv-anants 86c35bf
Merge branch 'main' into anants/auto-dep-upgrade-baseline-refresh
nv-anants File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| #!/usr/bin/env python3 | ||
| # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| """Print the baseline_sbom stem a capture just recorded for an image:tag. | ||
|
|
||
| Reads the stem back out of the manifest rather than scraping capture logs. | ||
| container/context.yaml holds a single stem per framework and the licenses stage | ||
| appends -${TARGETARCH}, so per-arch stems that disagree are unrepresentable | ||
| downstream; this fails instead of shipping a half-right baseline. | ||
|
|
||
| Stdout: the bare stem, e.g. release@2366e4b4. | ||
| """ | ||
| from __future__ import annotations | ||
|
|
||
| import argparse | ||
| import json | ||
| import sys | ||
| from pathlib import Path | ||
|
|
||
| DEFAULT_MANIFEST = Path("container/compliance/base_sboms/manifest.json") | ||
|
|
||
|
|
||
| def stem_for(manifest: dict, image: str, tag: str, arches: list[str]) -> str: | ||
| """Return the shared baseline_sbom stem for image:tag across `arches`. | ||
|
|
||
| Raises SystemExit if any arch is missing, matches more than one row, has an | ||
| unexpected filename, or if the arches disagree on the stem. | ||
| """ | ||
| if not arches: | ||
| raise SystemExit("no architectures given; --arches must name at least one") | ||
| entries = manifest.get("entries", []) | ||
| stems: dict[str, str] = {} | ||
| for arch in arches: | ||
| rows = [ | ||
| e | ||
| for e in entries | ||
| if e.get("from_image") == image | ||
| and e.get("from_tag") == tag | ||
| and e.get("platform") == f"linux/{arch}" | ||
| ] | ||
| if len(rows) != 1: | ||
| raise SystemExit( | ||
| f"expected exactly 1 {arch} row for {image}:{tag}, found {len(rows)}" | ||
| ) | ||
| suffix = f"-{arch}.cdx.json" | ||
| name = rows[0].get("baseline_sbom", "") | ||
| if not name.endswith(suffix): | ||
| raise SystemExit(f"{arch} baseline_sbom {name!r} does not end in {suffix}") | ||
| stems[arch] = name[: -len(suffix)] | ||
| if len(set(stems.values())) != 1: | ||
| raise SystemExit(f"per-arch baseline stems disagree: {stems}") | ||
| return next(iter(stems.values())) | ||
|
|
||
|
|
||
| def main() -> int: | ||
| p = argparse.ArgumentParser(description=__doc__) | ||
| p.add_argument("--image", required=True, help="from_image, e.g. nvcr.io/nvidia/x") | ||
| p.add_argument("--tag", required=True, help="from_tag, e.g. 1.3.0rc25") | ||
| p.add_argument("--manifest", type=Path, default=DEFAULT_MANIFEST) | ||
| p.add_argument( | ||
| "--arches", | ||
| default="amd64,arm64", | ||
| help="comma-separated arches that must agree (default: %(default)s)", | ||
| ) | ||
| args = p.parse_args() | ||
|
|
||
| manifest = json.loads(args.manifest.read_text(encoding="utf-8")) | ||
| arches = [a.strip() for a in args.arches.split(",") if a.strip()] | ||
| print(stem_for(manifest, args.image, args.tag, arches)) | ||
| return 0 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main()) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.