Skip to content

ci: generate release SBOMs where images are built, and reuse them by digest - #13664

Merged
cv merged 2 commits into
v1from
ci/sbom-by-digest
Oct 23, 2026
Merged

cv merged 2 commits into
v1from
ci/sbom-by-digest

Conversation

@cv

@cv cv commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Failure

Staging v0.1.0-rc3 took 41 minutes, 30 of them in the stage job, because #13590 scans every release platform image with Syft from the registry, one after another. That's 28 images, including about 10 GB per vLLM platform, downloaded by a runner that built none of them. Before SBOMs the stage job took about 2.5 minutes.

Decision

Scan each image where it is built, and keep the result by digest.

  • .github/scripts/image-sbom.sh: given a pushed image, finds its platform manifest digest. If v1-ci has no sbom-DIGEST yet, it scans the image with the pinned Syft (locally if Docker has it, otherwise from the registry) and pushes the SPDX document there as a tiny FROM scratch image.
  • Image workflow: on image-affecting v1 pushes, it records each agent and proxy image's SBOM right after pushing it. Local scans take about 10–30 seconds per image.
  • Staging's runtime jobs: record the vLLM and Ollama images' SBOMs after building them. Runtime images build reproducibly, so an unchanged image's SBOM is already there and isn't rescanned. vLLM's scan (about 3–6 minutes) is paid only when its inputs change.
  • Staging: copies each release platform's document from v1-ci with docker create and docker cp, and falls back to the registry scan only for an image without one, such as images pushed before this change.
  • The sbom- tags age out with the per-commit images under ci: prune per-commit images after each v1 push #13574's pruning.

Why not BuildKit's own SBOM attestations: tried on the proxy image, BuildKit's scanner found 1 package where the pinned Syft with the Cargo lockfile cataloger finds 79, including hyper, serde and tokio. It also uses a moving tag, docker/buildkit-syft-scanner:stable-1.

Validation

  • Against the real v1-ci package, on a DGX Spark:
    • recording an Ollama proxy image's SBOM took 11 s;
    • a second run found it and skipped scanning (4 s);
    • copying it out the way staging does gave an SPDX 2.3 document with 79 packages, including the Rust dependencies.
    • The package stayed internal.
  • Local scan times with the same Syft: OpenClaw (4.35 GB) in 30 s, vLLM (35.4 GB) in 200 s.
  • shellcheck and actionlint are clean, and fern check reports 0 errors.
  • The workflows themselves run at the next image-affecting v1 push and the next staging. Until then, staging's registry fallback covers images without a stored SBOM.

@cv
cv enabled auto-merge (squash) October 23, 2026 10:49
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 2e94ff2 into v1 Oct 23, 2026
49 checks passed
@cv
cv deleted the ci/sbom-by-digest branch October 23, 2026 10:57
cv added a commit that referenced this pull request Oct 23, 2026
## Failure

Several image pins trail their upstream releases or carry stale base
images:

- Node.js 24.22.0, now 24.22.1;
- Python 3.13.16, now 3.13.17;
- uv 0.13.3, now 0.13.5;
- Bun 1.4.3 (OpenCode), now 1.4.4;
- the three Rust 1.99.1 images (Alpine for the Ollama proxy, bookworm
for the supervisor, slim-trixie for the agent build), whose tags
upstream has rebuilt with base OS updates.

## Decision

Update those pins by tag and digest, with the matching mentions in the
build docs and the docs tooling's Node.js version. Ollama 0.40.9 changes
the model server itself, so it gets its own PR with a live
managed-Ollama test.

This is also the image-affecting `v1` push that records SBOMs by digest
for the first time (#13664).

## Validation

- Each new digest comes from its registry, and the Node.js, Python, and
Bun images cover linux/amd64 and linux/arm64.
- On a DGX Spark (linux/arm64): `cargo images build` built the OpenCode
(Bun) and Pi (Node.js, Python, uv) images, and both passed `cargo images
qualify`; the Ollama proxy (Rust Alpine) built; `docker buildx bake
check` passed.
- CI's image jobs build and check every image on both architectures.

Signed-off-by: Carlos Villela <[email protected]>
cv added a commit that referenced this pull request Oct 23, 2026
…13677)

## Failure

Staging `v0.1.0-rc4` twice from the same commit produced different
digests for every runtime image (vLLM and Ollama, both architectures),
so #13664's SBOM reuse never applied to them and vLLM was scanned on
every staging (about 9 minutes per architecture). It also breaks the
docs' promise that rebuilding the same sources keeps the same digest.

The cause: the base layers matched, but every layer NemoClaw adds
differed, because the directories in those layers carried each build's
actual time. The runtime jobs pushed straight from the build
(`type=image,push=true,rewrite-timestamp=true`) on the hosted runners'
classic Docker image store, which silently ignores `rewrite-timestamp`.
In the containerd image store, the same option conflicts with unpacking
and fails.

## Decision

Build the runtime images the way the bake targets define, in the
containerd image store:

- the runtime jobs switch the runner to the containerd store with the
existing `containerd-store` action, as the live suites and the bundle
job already do;
- bake uses the targets' own output
(`type=docker,rewrite-timestamp=true,unpack=false`), which loads each
image with clamped timestamps;
- `docker push` then pushes each tag, keeping that digest.

The images are now also local when the SBOM script runs, so it scans
them directly instead of downloading them.

## Validation

- Compared `v0.1.0-rc4`'s two Ollama arm64 manifests: identical base
layers; every added layer's tar differed only in directory times
(`opt/`, `opt/nemoclaw/`, `opt/nemoclaw/source/`), while the files
matched.
- On a DGX Spark, against a local registry: two builds of the Ollama
runtime image without cache, loaded and pushed this way, produced the
same digest (`sha256:9f96168e...`). Staging's old output failed there
with `exporter option "rewrite-timestamp" conflicts with "unpack"`.
- `actionlint` is clean.
- The CI check comes with the next release candidate: staging it twice
should show unchanged runtime digests, reused SBOMs, and no vLLM scan.

Signed-off-by: Carlos Villela <[email protected]>
cv added a commit that referenced this pull request Oct 23, 2026
#13685)

## Failure

The `v0.1.0-rc6` draft's 24 agent and proxy SBOMs don't name the image
they describe. Each document's subject is `nc-fabric@sha256:...`, a
digest that is neither the platform manifest it is stored under nor the
image config: #13664 scanned the local image, and Syft names the copy
Docker exports. Only the four runtime SBOMs, scanned from the registry,
name their manifest digest. Their contents are right: rescanning five
rc6 platforms from their release digests gave identical packages, files,
and relationships. But a reader can't tell from a document which image
it describes, and staging copied whatever `sbom-DIGEST` held without
checking.

## Decision

- `image-sbom.sh` scans the pushed platform manifest from the registry,
so the document's subject is the digest it is stored under, and it
refuses to record a document that names another one.
- It reuses a recorded document only when that document names its
digest; otherwise it scans again and replaces it. That replaces the rc6
records the next time each image is pushed or staged.
- Staging calls the same script, with an output path, in place of its
own copy-or-scan code. A scan there records its result, so a rerun
reuses it.
- The record is built for the image's platform, so staging can record an
arm64 document from an amd64 runner.

The first staging after this rescans the current agent and proxy images
once, since their records name exported copies. Each image workflow push
now pulls the pushed image to scan it; rescans of rc6 agent images from
the registry took 16 to 30 s each on a workstation.

The prune job needs no change: simulated on the package's current
versions with 10 down to 1 kept commits, it never deletes an SBOM whose
image it keeps, because a record is always pushed after its image.

## Validation

- Against a local registry: the `origin/v1` script recorded a document
naming another digest (RED). This script replaced it with one naming the
stored digest, reused it from a digest reference with an output path,
and recorded and reused an amd64 image's document from an arm64 host.
- `shellcheck -s sh` is clean; `actionlint` reports the same findings as
`origin/v1`.
- Deferred to CI: the next image-affecting `v1` push records agent SBOMs
through the registry, and the next release candidate's staging replaces
the old records once and reuses them on a rerun.

Signed-off-by: Carlos Villela <[email protected]>
@wscurran wscurran added v1 NemoClaw v1 branch area: ci CI workflows, checks, release automation, or GitHub Actions area: packaging Packages, images, registries, installers, or distribution chore Build, CI, dependency, or tooling maintenance labels Oct 27, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: packaging Packages, images, registries, installers, or distribution chore Build, CI, dependency, or tooling maintenance v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants