Molecule now uses the same pinned toolchain as sanity and lint (spec: #206 item 5, #212 item 2, #256 item 1).
Pins:molecule==26.11.0 and molecule-plugins[docker]==26.11.0 are added to requirements-dev.txt. The lock is regenerated: it adds docker 7.2.0, enrich, molecule, molecule-plugins and selinux, and no existing version moved.
ci image:extensions/molecule/requirements.yml becomes an image input. It is copied, installed into /opt/collections, recorded in /opt/ci-pins.sha256 under its checkout path, and added to image.yml's paths:. A test asserts it is an input.
molecule.yml: the job is still a host executor on kamino-molecule. It runs docker run on the pinned ci image, with the Docker socket and the checkout mounted at the same path, as the runner user (uid, plus the socket's gid). HOME is inside the job tree. Run values go in through env: and -e. The container has a per-run name and label, and an always() step removes it. The selector and the stale sweep stay on the host. /opt/molecule-venv, the venv check and the host collection cache are gone.
Docker CLI: the host's docker CLI is mounted read-only into the container. The driver hardcodes the community.docker.docker connection plugin, which runs the CLI to reach each instance, and the image has no CLI. The host job already needs that CLI for docker run and the sweep, so the runner needs nothing new.
scripts/run_molecule_in_ci_image.sh (new, tested) runs inside the container:
It runs sha256sum -c /opt/ci-pins.sha256. When that fails, it installs the PR's lock and both collection files into the job tree, because /opt is not writable for the runner user, and puts them first.
It logs ansible --version and molecule --version.
It runs the scenarios.
The rule "Molecule tests the pull request's pins, as Lint and Build do" is added to .gitea/workflows/AGENTS.md.
run_molecule_scenarios.sh: per-scenario cleanup uses the Python Docker SDK, which comes with the driver.
Renovate: the molecule.yml regex manager now also matches CI_IMAGE, so the pin PR after the next ci build moves it together with lint and build.
Lint and Build: the pin rule and the warnings now name all five pin files.
gitea_runner (breaking): the role no longer installs the molecule venv and collections. With gitea_runner_molecule_enabled it still registers the <label>:host label and installs git and python3 on the host. Seven inputs are removed. The breaking_changes fragment tells consumers to delete the old directories by hand.
One PR instead of the body's two. This PR pins the current ci:0.2.39, which has no molecule. Because it changes requirements-dev.txt, the job takes the slow path and installs the PR's pins. After the merge, the image rebuilds and Renovate's pin PR moves molecule.yml to the new version. That PR runs every scenario on the baked toolchain.
Ruled out:
Docker CLI baked into the image: the image does not have it yet, so this PR's own run could not pass, and it would force the two-PR sequence. It can follow later if the host CLI becomes a problem.
Overriding the connection to community.docker.docker_api: it needs per-instance host_vars in 16 scenarios, whose names #166 changes.
Keeping the in-container logic inline in the step: shellcheck and tests cannot see it.
Sharing the slow path with Lint and Build: they install into /opt/venv as root in a job container. Out of scope here.
Layer estimate (gzip -6; the registry stores about 9% more):
Layer
Change
/opt/venv
63.1 MiB → 63.8 MiB (+0.76 MB)
/opt/collections
+0.63 MB (community.docker 5.4.0 and its dependency)
Every layer stays far below 100 MB.
Verified
pre-commit run --all-files passes, as do the commit hooks on every commit.
python3 -m unittest discover -s tests/scripts: 232 tests OK. This includes the new test_run_molecule_in_ci_image.py (baked path, slow path, stdin, failing venv/pip/galaxy) and the SDK cleanup tests.
Pre-push ansible-test sanity passes.
The lock installs with --require-hashes on Python 3.14. molecule drivers lists docker.
check_image_versions.py pins is ok.
Molecule run 5299 (before the CLI mount). It confirmed most of the new path:
the docker run container, the uid and gid and HOME;
the slow path, which installed the PR's pins;
creating and destroying instances through the SDK, image pulls included.
Every scenario then failed at its first connection, because no docker CLI was found. The CLI mount fixes that.
Not verified
Molecule after the CLI mount: run 5302 on this head is pending. The fast path is first tested by the post-merge ci pin PR.
The host CLI binary: it runs inside the Ubuntu 26.04 image, assumed to work because a newer glibc stays compatible with binaries built against an older one.
Cleanup after a cancel: I have not checked whether act_runner runs the always() cleanup step after a cancel. If it does not, the stale sweep does not match kamino-molecule-*. The sweep belongs to #166.
Renovate: I have not run the Renovate regex change with renovate --platform=local. I checked it with an equivalent Python regex against molecule.yml.
A pin-only PR selects no scenarios, as decided in #256. A core minor bump still runs them all through its meta/runtime.yml edit.
The push trigger: the new script is not in molecule.yml's push paths:. #166 removes that trigger.
I confirm third-party material is recorded in NOTICE and REUSE.toml, or there is none.
Assisted-by: Claude Code
## What and why
Closes #225
Molecule now uses the same pinned toolchain as sanity and lint (spec: #206 item 5, #212 item 2, #256 item 1).
- **Pins:** `molecule==26.11.0` and `molecule-plugins[docker]==26.11.0` are added to `requirements-dev.txt`. The lock is regenerated: it adds docker 7.2.0, enrich, molecule, molecule-plugins and selinux, and no existing version moved.
- **ci image:** `extensions/molecule/requirements.yml` becomes an image input. It is copied, installed into `/opt/collections`, recorded in `/opt/ci-pins.sha256` under its checkout path, and added to `image.yml`'s `paths:`. A test asserts it is an input.
- **molecule.yml:** the job is still a host executor on `kamino-molecule`. It runs `docker run` on the pinned `ci` image, with the Docker socket and the checkout mounted at the same path, as the runner user (uid, plus the socket's gid). `HOME` is inside the job tree. Run values go in through `env:` and `-e`. The container has a per-run name and label, and an `always()` step removes it. The selector and the stale sweep stay on the host. `/opt/molecule-venv`, the venv check and the host collection cache are gone.
- **Docker CLI:** the host's `docker` CLI is mounted read-only into the container. The driver hardcodes the `community.docker.docker` connection plugin, which runs the CLI to reach each instance, and the image has no CLI. The host job already needs that CLI for `docker run` and the sweep, so the runner needs nothing new.
- **`scripts/run_molecule_in_ci_image.sh`** (new, tested) runs inside the container:
- It runs `sha256sum -c /opt/ci-pins.sha256`. When that fails, it installs the PR's lock and both collection files into the job tree, because `/opt` is not writable for the runner user, and puts them first.
- It logs `ansible --version` and `molecule --version`.
- It runs the scenarios.
- The rule "Molecule tests the pull request's pins, as Lint and Build do" is added to `.gitea/workflows/AGENTS.md`.
- **`run_molecule_scenarios.sh`:** per-scenario cleanup uses the Python Docker SDK, which comes with the driver.
- **Renovate:** the molecule.yml regex manager now also matches `CI_IMAGE`, so the pin PR after the next ci build moves it together with lint and build.
- **Lint and Build:** the pin rule and the warnings now name all five pin files.
- **gitea_runner (breaking):** the role no longer installs the molecule venv and collections. With `gitea_runner_molecule_enabled` it still registers the `<label>:host` label and installs `git` and `python3` on the host. Seven inputs are removed. The `breaking_changes` fragment tells consumers to delete the old directories by hand.
**One PR instead of the body's two.** This PR pins the current `ci:0.2.39`, which has no molecule. Because it changes `requirements-dev.txt`, the job takes the slow path and installs the PR's pins. After the merge, the image rebuilds and Renovate's pin PR moves `molecule.yml` to the new version. That PR runs every scenario on the baked toolchain.
**Ruled out:**
- **Docker CLI baked into the image:** the image does not have it yet, so this PR's own run could not pass, and it would force the two-PR sequence. It can follow later if the host CLI becomes a problem.
- **Overriding the connection to `community.docker.docker_api`:** it needs per-instance `host_vars` in 16 scenarios, whose names #166 changes.
- **Keeping the in-container logic inline in the step:** shellcheck and tests cannot see it.
- **Sharing the slow path with Lint and Build:** they install into `/opt/venv` as root in a job container. Out of scope here.
**Layer estimate** (gzip -6; the registry stores about 9% more):
| Layer | Change |
|---|---|
| `/opt/venv` | 63.1 MiB → 63.8 MiB (+0.76 MB) |
| `/opt/collections` | +0.63 MB (community.docker 5.4.0 and its dependency) |
Every layer stays far below 100 MB.
## Verified
- `pre-commit run --all-files` passes, as do the commit hooks on every commit.
- `python3 -m unittest discover -s tests/scripts`: 232 tests OK. This includes the new `test_run_molecule_in_ci_image.py` (baked path, slow path, stdin, failing venv/pip/galaxy) and the SDK cleanup tests.
- Pre-push `ansible-test sanity` passes.
- The lock installs with `--require-hashes` on Python 3.14. `molecule drivers` lists docker.
- `check_image_versions.py pins` is ok.
- **Molecule run 5299 (before the CLI mount).** It confirmed most of the new path:
- the `docker run` container, the uid and gid and `HOME`;
- the slow path, which installed the PR's pins;
- creating and destroying instances through the SDK, image pulls included.
Every scenario then failed at its first connection, because no `docker` CLI was found. The CLI mount fixes that.
## Not verified
- **Molecule after the CLI mount:** run 5302 on this head is pending. The fast path is first tested by the post-merge ci pin PR.
- **The host CLI binary:** it runs inside the Ubuntu 26.04 image, assumed to work because a newer glibc stays compatible with binaries built against an older one.
- **Cleanup after a cancel:** I have not checked whether act_runner runs the `always()` cleanup step after a cancel. If it does not, the stale sweep does not match `kamino-molecule-*`. The sweep belongs to #166.
- **Renovate:** I have not run the Renovate regex change with `renovate --platform=local`. I checked it with an equivalent Python regex against `molecule.yml`.
- **A pin-only PR selects no scenarios,** as decided in #256. A core minor bump still runs them all through its `meta/runtime.yml` edit.
- **The push trigger:** the new script is not in molecule.yml's push `paths:`. #166 removes that trigger.
---
- [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-24 07:27:08 +00:00
Defame1297
was assigned by Claude2026-11-24 07:27:08 +00:00
Pin molecule and its Docker driver in requirements-dev.txt and bake them,
with the driver's collection, into the ci image. The Molecule job runs
docker run on the pinned ci image with the Docker socket and the checkout
mounted at the same path, as the runner user. A pull request whose pins
differ from the image installs its own pins first, so a core bump runs its
scenarios on the new core. gitea_runner no longer installs the molecule
venv and collections.
Closes#225
Assisted-by: Claude Code
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What and why
Closes #225
Molecule now uses the same pinned toolchain as sanity and lint (spec: #206 item 5, #212 item 2, #256 item 1).
molecule==26.11.0andmolecule-plugins[docker]==26.11.0are added torequirements-dev.txt. The lock is regenerated: it adds docker 7.2.0, enrich, molecule, molecule-plugins and selinux, and no existing version moved.extensions/molecule/requirements.ymlbecomes an image input. It is copied, installed into/opt/collections, recorded in/opt/ci-pins.sha256under its checkout path, and added toimage.yml'spaths:. A test asserts it is an input.kamino-molecule. It runsdocker runon the pinnedciimage, with the Docker socket and the checkout mounted at the same path, as the runner user (uid, plus the socket's gid).HOMEis inside the job tree. Run values go in throughenv:and-e. The container has a per-run name and label, and analways()step removes it. The selector and the stale sweep stay on the host./opt/molecule-venv, the venv check and the host collection cache are gone.dockerCLI is mounted read-only into the container. The driver hardcodes thecommunity.docker.dockerconnection plugin, which runs the CLI to reach each instance, and the image has no CLI. The host job already needs that CLI fordocker runand the sweep, so the runner needs nothing new.scripts/run_molecule_in_ci_image.sh(new, tested) runs inside the container:sha256sum -c /opt/ci-pins.sha256. When that fails, it installs the PR's lock and both collection files into the job tree, because/optis not writable for the runner user, and puts them first.ansible --versionandmolecule --version..gitea/workflows/AGENTS.md.run_molecule_scenarios.sh: per-scenario cleanup uses the Python Docker SDK, which comes with the driver.CI_IMAGE, so the pin PR after the next ci build moves it together with lint and build.gitea_runner_molecule_enabledit still registers the<label>:hostlabel and installsgitandpython3on the host. Seven inputs are removed. Thebreaking_changesfragment tells consumers to delete the old directories by hand.One PR instead of the body's two. This PR pins the current
ci:0.2.39, which has no molecule. Because it changesrequirements-dev.txt, the job takes the slow path and installs the PR's pins. After the merge, the image rebuilds and Renovate's pin PR movesmolecule.ymlto the new version. That PR runs every scenario on the baked toolchain.Ruled out:
community.docker.docker_api: it needs per-instancehost_varsin 16 scenarios, whose names #166 changes./opt/venvas root in a job container. Out of scope here.Layer estimate (gzip -6; the registry stores about 9% more):
/opt/venv/opt/collectionsEvery layer stays far below 100 MB.
Verified
pre-commit run --all-filespasses, as do the commit hooks on every commit.python3 -m unittest discover -s tests/scripts: 232 tests OK. This includes the newtest_run_molecule_in_ci_image.py(baked path, slow path, stdin, failing venv/pip/galaxy) and the SDK cleanup tests.Pre-push
ansible-test sanitypasses.The lock installs with
--require-hasheson Python 3.14.molecule driverslists docker.check_image_versions.py pinsis ok.Molecule run 5299 (before the CLI mount). It confirmed most of the new path:
docker runcontainer, the uid and gid andHOME;Every scenario then failed at its first connection, because no
dockerCLI was found. The CLI mount fixes that.Not verified
always()cleanup step after a cancel. If it does not, the stale sweep does not matchkamino-molecule-*. The sweep belongs to #166.renovate --platform=local. I checked it with an equivalent Python regex againstmolecule.yml.meta/runtime.ymledit.paths:. #166 removes that trigger.NOTICEandREUSE.toml, or there is none.Assisted-by: Claude Code