The image.yml matrix holds a hand-edited base (MAJOR.MINOR) per image instead of a version. On main, scripts/next_image_version.py compares a checksum of the image's inputs with the inputs-sha256 label of the newest published <base>.N and the job publishes <base>.N+1 when they differ, or builds nothing when they match. A published tag is still never moved. renovate.yml runs live on the successful completion of Images (workflow_run), so the pin pull request opens minutes after a push instead of on the schedule. Removed: bump_image_versions.py and its tests, check_image_versions.py bump, Lint's bump step, Renovate's postUpgradeTasks, and the bot-diff allowance for matrix version lines. Closes #165 Assisted-by: Claude Code:claude-opus-5-5
6.1 KiB
Image rules
Every rule for the CI and test images in images/ (ci, molecule-ubuntu2404,
molecule-ubuntu2604), their build in .gitea/workflows/image.yml, and the image-smoke
scenarios in extensions/molecule/, in full. Each gives its reason (Why) and how it is held
(Held): a control names its hook or check; review means a person other than the author sees the
change before it merges (images/ and .gitea/ are under CODEOWNERS); aspirational means
nothing checks it. "Until X (#N) lands" names a change that is planned and its backlog issue.
image.yml builds each image with kaniko on push to main, never on a pull request, and pushes
it to this repository's organisation in the Gitea registry as <version> and latest. CI assigns
<version>: the next patch of the matrix entry's base: when the image's inputs changed.
Versions and pins
- A published version is never moved and never rebuilt. The build publishes only a version
the registry does not have, and one whose inputs match the newest version's is not built;
there is no
sha-*tag, so one digest belongs to exactly one version. Why: a pin names exactly what a reviewer saw. Held: control:scripts/next_image_version.pyand the tag lookup inimage.yml's prepare step. - A pull request that changes an image input needs no version edit. On
main,scripts/next_image_version.pycompares a checksum of the image's inputs (its build context, or the files its Dockerfile copies from the repository root) with thenet.rkdr.mortis.inputs-sha256label of the newest published<base>.N, and the build publishes<base>.N+1when they differ. Editbase:by hand only for a minor or major. Why: a version a person must remember to raise is a version someone forgets. Held: control: the Images workflow assigns it (next_image_version.py, with its tests). - After the build pushes a new version, a second pull request moves the
image:<version>@sha256:<digest>pins inlint.yml,build.yml,molecule.ymlandgitea-release-key.ymlto it. Renovate opens it within minutes: the Images run's successful completion starts a live Renovate run (workflow_runinrenovate.yml). It changes no image input, so it publishes nothing. A new image's first pin is a hand-made pull request, and a major version is moved by hand. Why: consumers run exactly the digest a reviewer saw. Held: review. - Image-input bumps are no Collection release: these files are in
galaxy.ymlbuild_ignore, and their bumps need no changelog fragment and no newgalaxy.ymlversion. Why: they change neither the Collection nor what a consumer installs. Held: control for "not shipped":scripts/check_tarball.pyin the Build check allows only Collection files in the archive; review for the version.
Releases and the build container
- Each molecule image is one Ubuntu release, named after it; a new release is a new image,
added by hand (Renovate's major
ubuntuupdates are disabled). Roles are tested on every release a target host runs. Why: a role is only proven on the release it runs on. Held: review. - Retire an image when no host runs its release. Why: testing on a release nobody runs costs runner time and proves nothing. Held: aspirational.
- Each matrix entry's
job_image: ubuntu:<release>@sha256:...has the same release as theFROM ubuntu:of its Dockerfile. Moving an image to a new release is one edit: theFROM, and thejob_imagetag and digest. Digest drift within a release is tolerated. Ajob_image-only bump is not an image input: the post-merge Images run publishes nothing, and its prepare step is that bump's only exercise. Why: kaniko runs inside the job container and unpacks the image it builds over it. Held: control:check_image_versions.py pinsin the Lint check. - kaniko (the osscontainertools fork) is pinned by layer digests in
image.ymland bumped by hand when that fork publishes a release. Why: Renovate cannot compute the layer digests. Held: aspirational.
Contents and size
- Bake in: every tool, collection, hook environment and package a CI job uses is in its image; a job downloads at run time only on the slow path (a pull request that changes a pin file). Why: a run that downloads is slower and depends on the network. Held: review until the network-off check (#168) lands.
- Recorded speed: a speed optimisation that adds machinery states its measured saving where it lives (a comment next to it). Why: machinery is kept only for a saving someone can check. Held: review.
- Every pushed layer stays below 100 MB; when you change an image, estimate each layer's
compressed size and state the estimate in the pull request. The
cibuild prints the compressed size of each layer directory, and the registry stores about 9% more. Why: Cloudflare rejects larger request bodies with HTTP 413. Held: aspirational; the push failing onmainis the backstop, because there is no pull-request build, by the maintainer's choice.
Metadata
- Each Dockerfile carries the same label block (
org.opencontainers.image.*plusnet.rkdr.mortis.purpose,contentsandusage); the build addsversion,revision,createdandnet.rkdr.mortis.inputs-sha256. The readme-style text lives indocs/images/<name>.md, which thedocumentationlabel links to. Why: Gitea's package page shows the labels and links but renders no README. Editing that doc is not an image input; editing a label is, and publishes a new version. Held: control:check_image_versions.py pinsfails when a label or the doc is missing.
Image-smoke scenarios
extensions/molecule/image-smokeandimage-smoke-2604test the molecule images themselves (24.04 and 26.04), including that each runs the release its name says. Their image comes fromMOLECULE_IMAGEorMOLECULE_IMAGE_2604inmolecule.yml, so a pin pull request runs them. Why: an image is proven by its own pin pull request before a role depends on it. Held: control: the scenarios, in the Molecule check.