feat(scripts): build the Track 2 image archives from the pins

The Track 2 add-on host loads skopeo archives that someone staged by hand on the control machine. A bench pass cannot prove that step. This adds one script that builds the archives from the pins, so a bench job can run it unattended and a pass also proves the transfer kit.

flowchart LR
  A[versions.yml pins] --> B[build_addon_archives.py]
  B -->|skopeo copy --all, by digest| C[oci-archives + manifest.json]
  C -->|addon_archive_name| D[addon_host_quadlet podman load]

What the script does:

  • Reads versions.yml and copies each add-on image by digest into ansible/.cache/addon-images/, the directory the role reads.
  • Takes each file name from the role's own addon_archive_name filter.
  • Writes manifest.json: name, source reference with digest, archive index digests and archive sha256.
  • Writes <archive>.source-digest where skopeo converts a manifest list and the index digest differs from the pin, as the runbook asks.
  • --dry-run prints the planned copies with no network. --only NAME builds one image.

The patched Siphon tables image is built, not copied, so the script copies only its upstream base. No pipeline job runs the script yet.

How I checked it:

  • python3 -m unittest discover -s scripts -p 'test_*.py' passes (142 tests). The new test is red without the script. It is also red when a pin has no archive mapping, when the role gains an image variable the script lacks, and when a mapping stops reading the pin the role reads.
  • A real copy of the nats pin gave docker.io_library_nats_2.14.6-alpine.tar. Its index.json digest equals the pin and the manifest sha256 equals shasum -a 256 of the file.

Checklist

  • Verified on a deployment, or the reason it was not: no role or Terraform change. Script tests and one real skopeo copy.
  • Runbook and README updated if a step, variable or default changed.
  • No secrets, hostnames or account IDs committed; certs stay in the git-ignored certs/.
  • Release and service image pins changed in ansible/group_vars/all/versions.yml; other pins edited where they sit. No pin changed.

Merge request reports

Loading
Loading