Molecule and Renovate on the shared runner: isolation, capacity and cost #212

Closed
opened 2026-11-16 06:10:53 +00:00 by Claude · 3 comments
Owner

Part of #87

Question

CI image pipeline: keep, simplify or replace serialises Molecule with one concurrency group so the runner can go to capacity 2, and Renovate automerge posture runs Renovate on every push to main. A review found the mechanism and the cost unverified. Decide:

  • A shared concurrency group cancels an older waiting run when a newer one queues. A pull request's required Molecule check then ends "cancelled" and its automerge stalls. Isolate runs instead (container names per run, cleaned up by label), or serialise another way?
  • Capacity 2 on the runner's memory, and Renovate on every push (runs of up to 30 minutes), are unmeasured. What is measured first, and what limits Renovate's runner time?
  • "Block on outdated branch" is already on, so Molecule on push to main re-tests a tree the pull request already tested. Drop that trigger and keep the nightly run?
  • The molecule images preinstall the packages the roles manage, against the decided "do not preinstall". Keep or remove?
  • One molecule Dockerfile behind a release argument saves a file and adds a build argument, a regex manager, a gate exception and a check rewrite. Keep two files?
  • The runner capacity change happens outside this repository. How does the issue state that?

From the review

  • Amends, depending on the answer: the Molecule two-wide issue (#166), the image layout issue (#169), the molecule fixtures issue (#170), the CI image ADR issue (#167), the Renovate push-trigger issue (#172).
Part of #87 ## Question [CI image pipeline: keep, simplify or replace](https://git.rkdr.net/Mortis/Kamino/issues/96) serialises Molecule with one concurrency group so the runner can go to capacity 2, and [Renovate automerge posture](https://git.rkdr.net/Mortis/Kamino/issues/97) runs Renovate on every push to `main`. A review found the mechanism and the cost unverified. Decide: - A shared concurrency group cancels an older waiting run when a newer one queues. A pull request's required Molecule check then ends "cancelled" and its automerge stalls. Isolate runs instead (container names per run, cleaned up by label), or serialise another way? - Capacity 2 on the runner's memory, and Renovate on every push (runs of up to 30 minutes), are unmeasured. What is measured first, and what limits Renovate's runner time? - "Block on outdated branch" is already on, so Molecule on push to `main` re-tests a tree the pull request already tested. Drop that trigger and keep the nightly run? - The molecule images preinstall the packages the roles manage, against the decided "do not preinstall". Keep or remove? - One molecule Dockerfile behind a release argument saves a file and adds a build argument, a regex manager, a gate exception and a check rewrite. Keep two files? - The runner capacity change happens outside this repository. How does the issue state that? ## From the review - Amends, depending on the answer: the Molecule two-wide issue (#166), the image layout issue (#169), the molecule fixtures issue (#170), the CI image ADR issue (#167), the Renovate push-trigger issue (#172).
Claude added the
Wayfinder
Grilling
label 2026-11-16 06:10:53 +00:00
Author
Owner

Evidence from the review of the map (2026-11-15). Gitea source was read at main (the server runs 28.0.0); nothing was run on the runner.

A shared concurrency group cancels waiting runs

  • CI image pipeline: keep, simplify or replace: "Molecule jobs share one concurrency: group so they never overlap and queue without holding a slot".
  • Gitea supports concurrency: since 1.26 (go-gitea/gitea pull 32751). Its semantics follow GitHub: in models/actions/run.go, with cancel-in-progress: false a newer run cancels the older waiting run in the group. GitHub's docs say the same ("any existing pending job ... will be canceled"). A waiting job holds no runner slot.
  • Today's group is per pull request or commit (molecule.yml:58-60), and only the single slot keeps runs apart: "Scenarios use fixed container names on the runner's shared Docker daemon, so two runs must not overlap" (molecule.yml:52-57).
  • Scenario: A's run is running, B's waits, a Renovate rebase starts C. B's required "Molecule / molecule (pull_request)" ends cancelled; the scheduled automerge waits for success; Renovate does not rebase an up-to-date pull request. B is stuck until someone reruns it.
  • One group cannot both cancel a pull request's own older run and queue the others.
  • A flock on the host works for the host-executor job, but a job waiting on it holds a slot; at capacity 2 that starves Lint and Build.
  • Recommendation: remove the need to serialise. Name scenario containers per run (for example ${RUN_ID}-<role>-instance), label them and clean up by label, and keep the per-pull-request cancel groups.

Capacity 2 and Renovate's runner time

  • image.yml:34: "the runner has capacity 1; the job container has a memory cap." CLAUDE.md and molecule.yml:44: the Renovate job takes up to 30 minutes of the slot.
  • Neither the pipeline decision nor ci(deps): run Renovate on push to main, state the own-image wait, shorten rule descriptions states memory or a measured Renovate run time.
  • Scenario: a push to main starts Renovate beside an image build or Molecule (two systemd containers): out of memory, or both slots full and pull request Lint and Build queue.
  • Recommendation: measure memory headroom for capacity 2 and Renovate's run time first; then decide whether Renovate-on-push runs only after a merged renovate/ pull request or gets a lower-priority label.

Molecule on push to main

Preinstalled packages

  • images/molecule-ubuntu2404/Dockerfile:31: "the packages the roles manage (iptables, ufw, fail2ban, openssh-server) preinstalled, so a converge makes no network calls".
  • The pipeline decision: "Packages the role itself installs stay runtime downloads: that install path is what the test exercises." test(molecule): bake prepare.yml fixtures into the molecule images: "Do not preinstall them". The ADR issue says "Molecule images keep a converge off the network", against the decision.
  • Options: keep them (speed, no network) or remove them (tests the install path, slower, network-dependent). No recommendation.

One Dockerfile or two

  • The two molecule Dockerfiles differ in the release, gnupg, and the title, description and documentation labels.
  • One file needs a build argument in the image.yml matrix, a regex manager for two digests, a bot-gate exception, a pins check that reads build arguments, and per-release label arguments.
  • Recommendation: keep two files; optionally check that they differ only on the expected lines.

The capacity change happens elsewhere

Evidence from the review of the map (2026-11-15). Gitea source was read at `main` (the server runs 28.0.0); nothing was run on the runner. ### A shared concurrency group cancels waiting runs - [CI image pipeline: keep, simplify or replace](https://git.rkdr.net/Mortis/Kamino/issues/96): "Molecule jobs share one `concurrency:` group so they never overlap and queue without holding a slot". - Gitea supports `concurrency:` since 1.26 ([go-gitea/gitea pull 32751](https://github.com/go-gitea/gitea/pull/32751)). Its semantics follow GitHub: in `models/actions/run.go`, with `cancel-in-progress: false` a newer run cancels the older *waiting* run in the group. [GitHub's docs](https://docs.github.com/en/actions/using-jobs/using-concurrency) say the same ("any existing pending job ... will be canceled"). A waiting job holds no runner slot. - Today's group is per pull request or commit (`molecule.yml:58-60`), and only the single slot keeps runs apart: "Scenarios use fixed container names on the runner's shared Docker daemon, so two runs must not overlap" (`molecule.yml:52-57`). - Scenario: A's run is running, B's waits, a Renovate rebase starts C. B's required "Molecule / molecule (pull_request)" ends `cancelled`; the scheduled automerge waits for success; Renovate does not rebase an up-to-date pull request. B is stuck until someone reruns it. - One group cannot both cancel a pull request's own older run and queue the others. - A `flock` on the host works for the host-executor job, but a job waiting on it holds a slot; at capacity 2 that starves Lint and Build. - Recommendation: remove the need to serialise. Name scenario containers per run (for example `${RUN_ID}-<role>-instance`), label them and clean up by label, and keep the per-pull-request cancel groups. ### Capacity 2 and Renovate's runner time - `image.yml:34`: "the runner has capacity 1; the job container has a memory cap." `CLAUDE.md` and `molecule.yml:44`: the Renovate job takes up to 30 minutes of the slot. - Neither the pipeline decision nor [ci(deps): run Renovate on push to main, state the own-image wait, shorten rule descriptions](https://git.rkdr.net/Mortis/Kamino/issues/172) states memory or a measured Renovate run time. - Scenario: a push to `main` starts Renovate beside an image build or Molecule (two systemd containers): out of memory, or both slots full and pull request Lint and Build queue. - Recommendation: measure memory headroom for capacity 2 and Renovate's run time first; then decide whether Renovate-on-push runs only after a merged `renovate/` pull request or gets a lower-priority label. ### Molecule on push to `main` - "Block on outdated branch" is already on ([Record current repository settings and branch protection](https://git.rkdr.net/Mortis/Kamino/issues/90)), while the pipeline decision still calls it a recommendation and names a residual risk "caught by the nightly". - An up-to-date head merged by merge commit, fast-forward or squash gives `main` the tree the pull request already tested. A post-merge run took 8m22s. - Recommendation: drop the push trigger on `main`, keep nightly and manual dispatch, and correct the residual-risk sentence for [docs(adr): record self-built CI and molecule images, versioned by CI, pinned by version and digest](https://git.rkdr.net/Mortis/Kamino/issues/167). The same reasoning applies to Lint and Build on `main` unless a step needs it. ### Preinstalled packages - `images/molecule-ubuntu2404/Dockerfile:31`: "the packages the roles manage (iptables, ufw, fail2ban, openssh-server) preinstalled, so a converge makes no network calls". - The pipeline decision: "Packages the role itself installs stay runtime downloads: that install path is what the test exercises." [test(molecule): bake prepare.yml fixtures into the molecule images](https://git.rkdr.net/Mortis/Kamino/issues/170): "Do not preinstall them". The ADR issue says "Molecule images keep a converge off the network", against the decision. - Options: keep them (speed, no network) or remove them (tests the install path, slower, network-dependent). No recommendation. ### One Dockerfile or two - The two molecule Dockerfiles differ in the release, `gnupg`, and the title, description and documentation labels. - One file needs a build argument in the `image.yml` matrix, a regex manager for two digests, a bot-gate exception, a `pins` check that reads build arguments, and per-release label arguments. - Recommendation: keep two files; optionally check that they differ only on the expected lines. ### The capacity change happens elsewhere - [ci(molecule): run Molecule two-wide safely and select scenarios on push to main](https://git.rkdr.net/Mortis/Kamino/issues/166) asks an agent to raise the runner capacity and to meet "With capacity 2, Lint and Build run while Molecule runs". Neither can be done in this repository. - Recommendation: "the maintainer raises the runner capacity (outside this repository)", with that acceptance line moved to a human follow-up.
Author
Owner

Handed over from Supported and tested ansible-core versions, item 5. Molecule will run with the toolchain baked into the ci image instead of the runner's /opt/molecule-venv. This ticket also decides how that job reaches the runner's Docker daemon: a job container given the socket, or docker run of the image from the host job. Today molecule.yml's header says no job container gets the socket. Molecule toolchain in the ci image is blocked on that answer.

Handed over from [Supported and tested ansible-core versions](https://git.rkdr.net/Mortis/Kamino/issues/206), item 5. Molecule will run with the toolchain baked into the `ci` image instead of the runner's `/opt/molecule-venv`. This ticket also decides how that job reaches the runner's Docker daemon: a job container given the socket, or `docker run` of the image from the host job. Today `molecule.yml`'s header says no job container gets the socket. [Molecule toolchain in the ci image](https://git.rkdr.net/Mortis/Kamino/issues/225) is blocked on that answer.
Defame1297 was assigned by Claude 2026-11-17 07:34:25 +00:00
Author
Owner

Resolution

Grilled with the maintainer on 2026-11-17. Run times were measured from Actions history (3–17 Nov, reads only): Renovate's scheduled run has a median of 16s and a maximum of 2m04; Molecule takes about 10 min on a pull request, on a push to main and nightly; Lint 33s, Build 13s, the ci image build about 4 min; waiting for the runner is usually 0–90s, the worst seen 20m44 behind a post-merge Molecule run. No log prints memory figures. No Molecule run on main failed after its pull request had passed. Molecule, not Renovate, is what holds the runner.

  1. Keep runs apart by isolation, not serialisation. Scenario containers are named and labelled per run (for example ${KAMINO_RUN_ID:-local}-ufw-instance, labelled with the run id). Each run removes its own labelled containers in an always() step. The pre-run sweep removes only labelled containers older than the job timeout (30 min), never the containers of a run beside it. The per-pull-request cancel groups stay; there is no shared group, because a shared group cancels a waiting run and stalls its pull request's required check.
  2. Docker access for Molecule on the ci image (handed over from Supported and tested ansible-core versions): the host-executor job runs docker run on the ci image with the Docker socket and the checkout mounted at the same path. Molecule starts the test containers beside it on the runner's daemon. No job container gets the socket, and the runner config does not change. The trust is the same as today, because the host job is already root-equivalent on the runner. The scenarios' only host mounts are /sys/fs/cgroup paths, which the daemon resolves on the host.
  3. No Molecule on push to main. The whole push: block goes, paths: filter included. "Block on outdated branch" is on, so an up-to-date head merges the tree its pull request tested. The post-merge run also caused the worst wait. Nightly and manual dispatch stay. Lint and Build keep their push trigger, because the publish job's "checks first" (Release path) depends on them. The ADR's residual-risk sentence becomes: no post-merge rerun; the nightly catches drift outside the tree. "Diff-selected on main" from CI image pipeline is dropped.
  4. Molecule images: bake in as much as possible, except what a role installs itself, because that install path is what the test exercises. The packages the roles manage (iptables, ufw, fail2ban, openssh-server) come out of the images. "A converge makes no network calls" goes from the image docs, the description label and the ADR issue. Fixtures that no role installs stay baked (molecule fixtures).
  5. One Dockerfile per image, with no release build argument and no custom check that the files differ only on expected lines; review holds that. The Debian 13 image (#226) differs by more than a release tag anyway.
  6. The capacity change is the maintainer's, outside this repository. ci(molecule): run Molecule two-wide safely and select scenarios on push to main narrows to what an agent can do here. A separate Ready for Human issue, blocked by it, covers raising the capacity.
  7. Measure memory, and only memory. Run times and waits are measured above. The Molecule job gains a free -m / nproc step. The capacity issue is done when two Molecule runs side by side finish green, with no out-of-memory kill and the memory headroom recorded on the issue.
  8. Renovate: timeout-minutes drops from 30 to 10. The renovate group with cancel-in-progress: false already allows at most one running and one waiting run. There is no merged-renovate/-only trigger and no separate label. The "up to 30 minutes" claims in CLAUDE.md and the molecule.yml comment are corrected to the measured time.

No ADR: these points correct the CI image ADR (#167) and meet no three-part bar of their own.

Backlog changed:

  • #166 rewritten; blocked by #225, because both edit the Molecule job and #225 changes its shape.
  • #225 unblocked, with the Docker-access answer.
  • Corrections posted on #167, #169, #170 and #172.
  • New issue for the runner capacity, linked below.
## Resolution Grilled with the maintainer on 2026-11-17. Run times were measured from Actions history (3–17 Nov, reads only): Renovate's scheduled run has a median of 16s and a maximum of 2m04; Molecule takes about 10 min on a pull request, on a push to `main` and nightly; Lint 33s, Build 13s, the `ci` image build about 4 min; waiting for the runner is usually 0–90s, the worst seen 20m44 behind a post-merge Molecule run. No log prints memory figures. No Molecule run on `main` failed after its pull request had passed. Molecule, not Renovate, is what holds the runner. 1. **Keep runs apart by isolation, not serialisation.** Scenario containers are named and labelled per run (for example `${KAMINO_RUN_ID:-local}-ufw-instance`, labelled with the run id). Each run removes its own labelled containers in an `always()` step. The pre-run sweep removes only labelled containers older than the job timeout (30 min), never the containers of a run beside it. The per-pull-request cancel groups stay; there is no shared group, because a shared group cancels a waiting run and stalls its pull request's required check. 2. **Docker access for Molecule on the `ci` image** (handed over from [Supported and tested ansible-core versions](https://git.rkdr.net/Mortis/Kamino/issues/206)): the host-executor job runs `docker run` on the `ci` image with the Docker socket and the checkout mounted at the same path. Molecule starts the test containers beside it on the runner's daemon. No job container gets the socket, and the runner config does not change. The trust is the same as today, because the host job is already root-equivalent on the runner. The scenarios' only host mounts are `/sys/fs/cgroup` paths, which the daemon resolves on the host. 3. **No Molecule on push to `main`.** The whole `push:` block goes, `paths:` filter included. "Block on outdated branch" is on, so an up-to-date head merges the tree its pull request tested. The post-merge run also caused the worst wait. Nightly and manual dispatch stay. Lint and Build keep their push trigger, because the publish job's "checks first" ([Release path](https://git.rkdr.net/Mortis/Kamino/issues/211)) depends on them. The ADR's residual-risk sentence becomes: no post-merge rerun; the nightly catches drift outside the tree. "Diff-selected on `main`" from [CI image pipeline](https://git.rkdr.net/Mortis/Kamino/issues/96) is dropped. 4. **Molecule images: bake in as much as possible, except what a role installs itself**, because that install path is what the test exercises. The packages the roles manage (`iptables`, `ufw`, `fail2ban`, `openssh-server`) come out of the images. "A converge makes no network calls" goes from the image docs, the description label and the ADR issue. Fixtures that no role installs stay baked ([molecule fixtures](https://git.rkdr.net/Mortis/Kamino/issues/170)). 5. **One Dockerfile per image**, with no release build argument and no custom check that the files differ only on expected lines; review holds that. The Debian 13 image ([#226](https://git.rkdr.net/Mortis/Kamino/issues/226)) differs by more than a release tag anyway. 6. **The capacity change is the maintainer's, outside this repository.** [ci(molecule): run Molecule two-wide safely and select scenarios on push to main](https://git.rkdr.net/Mortis/Kamino/issues/166) narrows to what an agent can do here. A separate Ready for Human issue, blocked by it, covers raising the capacity. 7. **Measure memory, and only memory.** Run times and waits are measured above. The Molecule job gains a `free -m` / `nproc` step. The capacity issue is done when two Molecule runs side by side finish green, with no out-of-memory kill and the memory headroom recorded on the issue. 8. **Renovate:** `timeout-minutes` drops from 30 to 10. The `renovate` group with `cancel-in-progress: false` already allows at most one running and one waiting run. There is no merged-`renovate/`-only trigger and no separate label. The "up to 30 minutes" claims in `CLAUDE.md` and the `molecule.yml` comment are corrected to the measured time. No ADR: these points correct the CI image ADR ([#167](https://git.rkdr.net/Mortis/Kamino/issues/167)) and meet no three-part bar of their own. **Backlog changed:** - [#166](https://git.rkdr.net/Mortis/Kamino/issues/166) rewritten; blocked by [#225](https://git.rkdr.net/Mortis/Kamino/issues/225), because both edit the Molecule job and #225 changes its shape. - [#225](https://git.rkdr.net/Mortis/Kamino/issues/225) unblocked, with the Docker-access answer. - Corrections posted on [#167](https://git.rkdr.net/Mortis/Kamino/issues/167), [#169](https://git.rkdr.net/Mortis/Kamino/issues/169), [#170](https://git.rkdr.net/Mortis/Kamino/issues/170) and [#172](https://git.rkdr.net/Mortis/Kamino/issues/172). - New issue for the runner capacity, linked below.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#212