ci(images): build and publish the molecule-controller image #484

Merged
Defame1297 merged 6 commits from ci/477-molecule-controller-image into main 2026-11-29 18:52:29 +00:00
Owner

What and why

Closes #477

This is the first half of ADR 0003. It adds the molecule-controller image and its inputs, but Molecule does not use the image yet; #431 pins it once the first build has been published from main.

The image

  • images/molecule-controller/Dockerfile is modelled on the ci image. It holds the venv with molecule and the collections the scenarios need, and writes its own pins checksum file.
  • Its final RUN checks the locked versions and collections, and fails on an empty locked version.

Requirements and locks

  • requirements-molecule.txt and the hash-pinned requirements-molecule.lock sit at the root.
  • They are not on the selector's IGNORED list, so this pull request runs every scenario.
  • ansible-core is 2.22.0, the same as the dev lock.
  • scripts/lock-requirements.sh now takes the requirements file as an argument. With no argument it behaves as before.

Workflows and scripts

  • image.yml gains the matrix entry and the push paths.
  • scripts/check_image_versions.py now knows the new image and lock, and checks that ansible-core is equal across the two locks.
  • scripts/check_bot_pr_diff.py allows the new pin files.
  • scripts/next_image_version.py treats a 404 on the first tags/list page as "no tags", so a repository that has never been pushed gets <base>.0 instead of failing the version step. A 404 on a manifest, or a 401 or 403, still fails.

Renovate and packaging

  • Renovate bumps the new requirements file with pip-compile, and its uv manager covers the new Dockerfile.
  • galaxy.yml build_ignore covers the new files.

Docs

  • docs/images/molecule-controller.md is new.
  • images/AGENTS.md records why this image has no image-smoke scenario.

The ci image keeps molecule. proxmoxer is left out: the only community.proxmox task is skipped in the pve_lxc scenario.

Verified

  • python -m unittest discover -s tests/scripts: 316 tests pass. They include new tests for lock-requirements.sh, the ansible-core equality check and the tags/list 404.
  • pre-commit run --all-files passes.
  • scripts/check_image_versions.py pins passes.
  • renovate-config-validator --strict at 44.161.0 passes. A full renovate --platform=local found the new file and pins, then stopped on an unsupported-Node-version error, so that run was not clean.
  • Two clean-context review rounds. The first found the new-repository 404 case, now fixed.
  • CI: this pull request's checks.

Not verified

  • The image build itself, its self-checks and its layer sizes are not run on a pull request. They are first exercised by image.yml after merge to main.
  • The registry's 404 for a repository that doesn't exist yet is assumed from the OCI distribution spec, not observed, because the registry needs a login to list tags.

  • I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.

Assisted-by: Claude Code

## What and why Closes #477 This is the first half of ADR 0003. It adds the `molecule-controller` image and its inputs, but Molecule does not use the image yet; #431 pins it once the first build has been published from main. **The image** - `images/molecule-controller/Dockerfile` is modelled on the ci image. It holds the venv with molecule and the collections the scenarios need, and writes its own pins checksum file. - Its final RUN checks the locked versions and collections, and fails on an empty locked version. **Requirements and locks** - `requirements-molecule.txt` and the hash-pinned `requirements-molecule.lock` sit at the root. - They are not on the selector's IGNORED list, so this pull request runs every scenario. - ansible-core is 2.22.0, the same as the dev lock. - `scripts/lock-requirements.sh` now takes the requirements file as an argument. With no argument it behaves as before. **Workflows and scripts** - `image.yml` gains the matrix entry and the push paths. - `scripts/check_image_versions.py` now knows the new image and lock, and checks that ansible-core is equal across the two locks. - `scripts/check_bot_pr_diff.py` allows the new pin files. - `scripts/next_image_version.py` treats a 404 on the first `tags/list` page as "no tags", so a repository that has never been pushed gets `<base>.0` instead of failing the version step. A 404 on a manifest, or a 401 or 403, still fails. **Renovate and packaging** - Renovate bumps the new requirements file with pip-compile, and its uv manager covers the new Dockerfile. - `galaxy.yml` `build_ignore` covers the new files. **Docs** - `docs/images/molecule-controller.md` is new. - `images/AGENTS.md` records why this image has no image-smoke scenario. The ci image keeps molecule. proxmoxer is left out: the only `community.proxmox` task is skipped in the `pve_lxc` scenario. ## Verified - `python -m unittest discover -s tests/scripts`: 316 tests pass. They include new tests for `lock-requirements.sh`, the ansible-core equality check and the tags/list 404. - `pre-commit run --all-files` passes. - `scripts/check_image_versions.py pins` passes. - `renovate-config-validator --strict` at 44.161.0 passes. A full `renovate --platform=local` found the new file and pins, then stopped on an unsupported-Node-version error, so that run was not clean. - Two clean-context review rounds. The first found the new-repository 404 case, now fixed. - CI: this pull request's checks. ## Not verified - The image build itself, its self-checks and its layer sizes are not run on a pull request. They are first exercised by `image.yml` after merge to main. - The registry's 404 for a repository that doesn't exist yet is assumed from the OCI distribution spec, not observed, because the registry needs a login to list tags. --- - [x] I confirm third-party material is recorded in `NOTICE` and `REUSE.toml`, or there is none. Assisted-by: Claude Code
Claude added this to the CI velocity (emergency) milestone 2026-11-29 18:12:09 +00:00
Claude added 5 commits 2026-11-29 18:12:09 +00:00
The molecule-controller image gets a requirements file and lock of its
own (ADR 0003), so the lock script takes the file to lock:
requirements-dev.txt by default, as before, or requirements-molecule.txt.
Any other argument is a usage error, so a typo cannot write a lock
somewhere else.

The new test runs the script against a stub interpreter, so it needs
no network.

Refs #477

Assisted-by: Claude Code
ADR 0003 moves Molecule out of the ci image, so a ci bump for a tool
only Lint uses stops selecting every scenario. This builds and publishes
the image; nothing pins it yet (#431).

It bakes requirements-molecule.lock (ansible-core, molecule,
molecule-plugins[docker]) on the Python of .python-version and the
collections of both requirements.yml files, and records their checksums
in /opt/molecule-pins.sha256. Its last RUN checks the tool versions
against the lock, the Docker driver, every pinned collection and the
pin record, so a broken image fails its build. It has no image-smoke
scenario: it is the controller of every scenario, and the full run of
its pin pull request proves it; images/AGENTS.md records the exception.

check_image_versions.py pins now checks the Python header of both locks
and fails when their ansible-core pins differ, so Lint and Molecule
judge the code with one ansible-core. The new requirements files stay
off the selector's IGNORED list, so a bump there runs every scenario.

Refs #477

Assisted-by: Claude Code
Renovate's pip-compile manager now reads requirements-molecule.lock, and
its uv manager reads the controller Dockerfile's uv pin. The bot-PR
guard holds the controller requirements and lock to the same rules as
requirements-dev.txt and its lock, so the bot's pull requests for them
are neither refused nor freer than the ci ones. The ansible tooling
group spans both locks, so one pull request moves both ansible-core
pins, which check_image_versions.py holds equal.

Checked with renovate 44.161.0 --platform=local: it extracts
requirements-molecule.txt with requirements-molecule.lock, and the uv
pin of images/molecule-controller/Dockerfile.

Refs #477

Assisted-by: Claude Code
The registry answers tags/list for a repository that does not exist yet
with 404 NAME_UNKNOWN (OCI distribution spec), which failed the Images
version step for the first build of a new image such as
molecule-controller. A 404 on the first tags/list page now reads as no
tags, so the image gets <base>.0; a 404 on a manifest stays an error.

Refs #477

Assisted-by: Claude Code
ci(images): fail the controller self-check on an empty locked version
Build / build (pull_request) Successful in 33s
Lint / lint (pull_request) Successful in 3m25s
Molecule / molecule (pull_request) Canceled after 7m3s
56c5c6dd72
The self-check reads the ansible-core and molecule versions from the
lock with sed; an empty result made the grep match any version. It now
fails the build instead.

Refs #477

Assisted-by: Claude Code
CODEOWNERS rules requested review from Defame1297 2026-11-29 18:12:09 +00:00
Defame1297 approved these changes 2026-11-29 18:19:18 +00:00
Defame1297 added 1 commit 2026-11-29 18:19:43 +00:00
Merge branch 'main' into ci/477-molecule-controller-image
Build / build (pull_request) Successful in 29s
Lint / lint (pull_request) Successful in 3m21s
Molecule / molecule (pull_request) Successful in 32m9s
1289da3104
Defame1297 scheduled this pull request to auto merge when all checks succeed 2026-11-29 18:19:49 +00:00
Defame1297 merged commit ac9a11413d into main 2026-11-29 18:52:29 +00:00
Defame1297 deleted branch ci/477-molecule-controller-image 2026-11-29 18:57:48 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#484