docs: describe Molecule running in the molecule-controller image
The ci image's labels and doc, the consumer lists, the Molecule rules in .gitea/workflows/AGENTS.md and the accepted risk on pin bumps in SECURITY.md said Molecule runs in the ci image. They now name the molecule-controller image, its pin files and which pin files select scenarios. Closes #431 Assisted-by: Claude Code
This commit is contained in:
1 parent
89bd579e87
commit
4db1a2b3c9
8 files changed
+44
-38
No files matched your search
+7
-10
@@ -1,7 +1,9 @@
|
||||
# ci
|
||||
|
||||
The **CI tooling image** of the [`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Collection: everything the Lint, Build and
|
||||
Molecule workflows used to install on each run is baked in, so a job only checks out the code and runs.
|
||||
The **CI tooling image** of the [`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Collection: everything the Lint and Build
|
||||
workflows used to install on each run is baked in, so a job only checks out the code and runs. The Molecule workflow
|
||||
runs in the [`molecule-controller`](molecule-controller.md) image instead
|
||||
([ADR 0003](../adr/0003-molecule-controller-image.md)), so a tool bump only Lint uses selects no Molecule scenario.
|
||||
|
||||
## What is in it
|
||||
|
||||
@@ -59,25 +61,20 @@ jobs:
|
||||
pre-commit run --all-files --show-diff-on-failure
|
||||
```
|
||||
|
||||
The Molecule job runs on the `kamino-molecule` runner, a host executor, so it starts the image itself with
|
||||
`docker run`, as the runner user, with the Docker socket and the checkout mounted at the same path (molecule
|
||||
hands the daemon paths in the checkout); `scripts/run_molecule_in_ci_image.sh` does the same pin check inside it.
|
||||
Read `.gitea/workflows/molecule.yml` for the full command.
|
||||
|
||||
`/opt/ci-pins.sha256` lists the five pin files by their checkout-relative path, so `sha256sum -c` runs in the checkout root. When
|
||||
the checkout's `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml`, `extensions/molecule/requirements.yml` and `.pre-commit-config.yaml` match, the baked tools and
|
||||
collections are used as they are, and Lint and Build cut the network by environment (proxy variables and
|
||||
`PIP_NO_INDEX`) for all but the script tests, so a tool that downloads at run time fails the job. When a pull request changes a pin the check fails and the job installs the pinned
|
||||
tools and collections itself for that run
|
||||
(slower, same result), until the image is rebuilt from `main`. `lint.yml`, `build.yml`, `molecule.yml` and `gitea-release-key.yml`
|
||||
(slower, same result), until the image is rebuilt from `main`. `lint.yml`, `build.yml` and `gitea-release-key.yml`
|
||||
are the real consumers.
|
||||
|
||||
## Tags and pinning
|
||||
|
||||
- `<version>` is semver, independent of the Collection's version. A published version is never moved or
|
||||
rebuilt, so one digest belongs to exactly one version. `latest` is the newest version, for looking only.
|
||||
- Pin `ci:<version>@sha256:<digest>`; the digest decides what is pulled. Consumers: `lint.yml`, `build.yml`,
|
||||
`molecule.yml` and `gitea-release-key.yml`.
|
||||
- Pin `ci:<version>@sha256:<digest>`; the digest decides what is pulled. Consumers: `lint.yml`, `build.yml` and
|
||||
`gitea-release-key.yml`.
|
||||
- Renovate is configured to move the pins to a new version after the image is built on `main` (the rule is in
|
||||
`renovate.json`; the first pin of a brand-new image is made by hand).
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ checkout). In the checkout root, run `sha256sum --quiet -c /opt/molecule-pins.sh
|
||||
`requirements-molecule.lock`, `requirements.yml` or `extensions/molecule/requirements.yml`, install the pinned tools
|
||||
and collections for that run first (slower, same result), until the image is rebuilt from `main`.
|
||||
|
||||
No workflow consumes it yet; the Molecule workflow still runs in the [`ci`](ci.md) image until its first pin is made
|
||||
by hand.
|
||||
`.gitea/workflows/molecule.yml` is its consumer: it pins the image as `CONTROLLER_IMAGE`, and
|
||||
`scripts/run_molecule_in_ci_image.sh` runs the pin check inside it. Read the workflow for the full command.
|
||||
|
||||
## Tags and pinning
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ platforms:
|
||||
|
||||
systemd needs a writable cgroup (`cgroupns_mode: host`, the `/sys/fs/cgroup` mount and tmpfs on `/run`), the
|
||||
firewall tools need `NET_ADMIN`, AppArmor is left unconfined for the container (`apparmor=unconfined`), and
|
||||
nothing runs privileged. The docker driver needs molecule's docker plugin, which the ci image provides.
|
||||
nothing runs privileged. The docker driver needs molecule's docker plugin, which the molecule-controller image provides.
|
||||
|
||||
The scenario `extensions/molecule/image-smoke` tests this image against that contract (release,
|
||||
systemd, packages, the `dbus` and `ssh` units, the Python bindings, `NET_ADMIN`).
|
||||
|
||||
@@ -50,7 +50,7 @@ platforms:
|
||||
|
||||
systemd needs a writable cgroup (`cgroupns_mode: host`, the `/sys/fs/cgroup` mount and tmpfs on `/run`), the
|
||||
firewall tools need `NET_ADMIN`, AppArmor is left unconfined for the container (`apparmor=unconfined`), and
|
||||
nothing runs privileged. The docker driver needs molecule's docker plugin, which the ci image provides.
|
||||
nothing runs privileged. The docker driver needs molecule's docker plugin, which the molecule-controller image provides.
|
||||
|
||||
The scenario `extensions/molecule/image-smoke-2604` tests this image against that contract (release,
|
||||
systemd, packages, the `dbus` and `ssh` units, the Python bindings, `NET_ADMIN`).
|
||||
|
||||
Reference in new issue
Block a user