diff --git a/AGENTS.md b/AGENTS.md index 1934dcdd..dae16273 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -55,7 +55,7 @@ All local `just` targets run BuildStream inside the FSDK `bst2` container via `j | `just build-image` / `just export-image` | Build and export the release image set to `dist/diskless/`. | | `just dogfood` / `just dogfood-check` | Boot `dist/diskless/` diskless in QEMU with Secure Boot (interactive / headless probe). | | `just dogfood-install NEXT=` | QEMU end-to-end: diskless boot, install to disk, boot it, then A/B update to NEXT. | -| `just publish-oci REF [DIR] [PLAIN_HTTP]` | Push `dist/diskless/` as an ORAS OCI artifact tagged `,latest` (one layer per file). | +| `just publish-oci REF [DIR] [PLAIN_HTTP]` | Push `dist/diskless/` as an ORAS OCI artifact tagged `,latest` (one layer per file). Local rehearsal; CI publishes via `scripts/publish-release.sh`. | | `just build-sysext` / `just export-sysext` | Build and export the k0s and KubeStellar `systemd-sysext` images. | | `just build-zfs-sysext` / `just export-zfs-sysext` | Build and export the OpenZFS `systemd-sysext`. | diff --git a/Justfile b/Justfile index 654dd576..45f182c7 100644 --- a/Justfile +++ b/Justfile @@ -147,11 +147,16 @@ dogfood-installer: # REF=ghcr.io//bluefin-server or :30500/bluefin-server # (PLAIN_HTTP=1); log in with podman login first. One layer per file. +# Local rehearsal only: releases are published by scripts/publish-release.sh +# from .github/workflows/build.yml, which also verifies the pushed manifest +# against the local files. This recipe pushes the same artifact type, +# annotations and layout, and nothing else. # Publish an image set as an ORAS OCI artifact tagged and latest. [group('diskless')] publish-oci REF DIR="dist/diskless" PLAIN_HTTP="0": #!/usr/bin/env bash set -euo pipefail + revision="$(git rev-parse HEAD)" cd "{{DIR}}" uki="$(ls bluefin-server-netboot_*.efi)" ver="${uki#bluefin-server-netboot_}"; ver="${ver%.efi}" @@ -164,6 +169,8 @@ publish-oci REF DIR="dist/diskless" PLAIN_HTTP="0": {{oras_image}} push "${extra[@]}" \ --artifact-type application/vnd.projectbluefin.server.release.v1 \ --annotation "org.opencontainers.image.version=${ver}" \ + --annotation "org.opencontainers.image.source=${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY:-projectbluefin/server}" \ + --annotation "org.opencontainers.image.revision=${revision}" \ "{{REF}}:${ver},latest" "${files[@]}" # Boot dist/diskless/ in QEMU with Secure Boot, pulling /usr over HTTP. diff --git a/docs/skills/ddi-installer.md b/docs/skills/ddi-installer.md index ba6f414b..d4b5bc1e 100644 --- a/docs/skills/ddi-installer.md +++ b/docs/skills/ddi-installer.md @@ -45,7 +45,9 @@ GPT partition label with room to spare): A release publishes this directory as-is (GitHub Release `v` plus an ORAS OCI artifact); see the `release` job in [ci-tooling.md](ci-tooling.md). -`just publish-oci REF [DIR] [PLAIN_HTTP]` pushes the same artifact locally. +`just publish-oci REF [DIR] [PLAIN_HTTP]` pushes the same artifact locally, as +a rehearsal; CI publishes through `scripts/publish-release.sh`, which also +verifies the pushed manifest against the local files. The /usr image itself is built by `oci/bluefin-server-usr.bst` with an offline `systemd-repart`: an erofs partition (`bluefin_usr_`) plus its dm-verity diff --git a/docs/skills/systemd-sysupdate-verification.md b/docs/skills/systemd-sysupdate-verification.md index 43f51780..64790f92 100644 --- a/docs/skills/systemd-sysupdate-verification.md +++ b/docs/skills/systemd-sysupdate-verification.md @@ -113,10 +113,18 @@ tell a human or a policy engine which commit and workflow run produced it. OpenZFS sysext payloads. It lists one SPDX package per source (name, version, download URL, source kind). Build-only elements such as the signing keys are not runtime dependencies of that payload and never - appear. The image element stamps `creationInfo.created` and ships it as - `bluefin-server_.spdx.json`, listed in `SHA256SUMS`, so the GPG - signature covers it too. No transfer matches it, so nodes never download it. -- **Publishing.** `scripts/publish-release.sh` is the only publish path. + appear. SPDX requires a `creationInfo.created`, which the plugin leaves to + the build, so the image element stamps it from `SOURCE_DATE_EPOCH`. The + build runs in a BuildStream sandbox that fixes `SOURCE_DATE_EPOCH` to + BuildStream's own default (1321009871), so the field always reads + `2011-11-11T11:11:11Z`: it is a reproducibility placeholder, not a build + time. Use the SLSA provenance attestation (or the release tag) for when a + set was built. The SBOM ships as `bluefin-server_.spdx.json`, listed + in `SHA256SUMS`, so the GPG signature covers it too. No transfer matches + it, so nodes never download it. +- **Publishing.** In CI, `scripts/publish-release.sh` is the only publish + path (`just publish-oci` pushes to a local or personal registry for + rehearsal and runs none of the script's checks). `verify` checks what nodes will check (`gpgv` against the keyring, every `SHA256SUMS` entry present and matching), plus: every published file is listed, every file name carries the release version, and the SBOM is valid diff --git a/elements/oci/bluefin-server-image.bst b/elements/oci/bluefin-server-image.bst index 3468d85a..d07e75a3 100644 --- a/elements/oci/bluefin-server-image.bst +++ b/elements/oci/bluefin-server-image.bst @@ -175,6 +175,10 @@ config: # SPDX requires a creation time, which the plugin leaves to the build, # and unique SPDXIDs: FSDK bootstrap elements reached through two # junction paths are collected twice, as identical packages. + # SOURCE_DATE_EPOCH is BuildStream's fixed sandbox default (1321009871), + # so created is always 2011-11-11T11:11:11Z. That keeps the SBOM bit + # identical across rebuilds; the real build time lives in the SLSA + # provenance attestation, not here. jq --arg created "$(date -u -d "@${SOURCE_DATE_EPOCH}" +%Y-%m-%dT%H:%M:%SZ)" \ '.creationInfo.created = $created | .packages |= unique_by(.SPDXID) diff --git a/elements/oci/bluefin-server-sbom.bst b/elements/oci/bluefin-server-sbom.bst index e94f06da..552e9271 100644 --- a/elements/oci/bluefin-server-sbom.bst +++ b/elements/oci/bluefin-server-sbom.bst @@ -19,7 +19,9 @@ description: | oci/*-sysext.bst element for its own local sources (units, extension-release, config), and the element it stages them from. - oci/bluefin-server-image.bst stamps creationInfo.created and ships the + oci/bluefin-server-image.bst stamps creationInfo.created from the + sandbox's fixed SOURCE_DATE_EPOCH (always 2011-11-11T11:11:11Z, a + reproducibility placeholder rather than a build time) and ships the result as bluefin-server_.spdx.json inside the signed SHA256SUMS. (@):