The forge runner runs two jobs at a time (FO-66) #94

Merged
pit merged 2 commits from hermes/FO-66-the-forge-runner-runs-two-jobs-at-a-time into main 2026-11-11 11:49:08 +00:00
Member

Implements FO-66

Summary

The runner's slot count, and the memory the second slot needs:

 runner/service/roles/runner/defaults/main.yml
-  runner_capacity: 1
+  runner_capacity: 2
 runner/guest/variables.tf
-  memory            = 2048
+  memory            = 4096

A Semaphore deploy job polls its task for up to 35 minutes. At one slot it held 146's only slot, so every plan check queued behind it; at two, the plan check runs beside it. The Guest is the same vmid on the same 2 cores and 512 MB of swap — memory changes in place, so no replacement is planned.

The config the daemon reads is rendered from the role's defaults, so the value moves where it lives, and the comments beside it say why two rather than one. docs/actions/runner-and-workflows.md follows the artifact: capacity 2, 4096 MB, and what that means for the check queue. ADR 0009's "2 GB" stays as it is — it records the Guest as first built.

Evidence

  • Before: the role's default was runner_capacity: 1, and the Stack declared memory = 2048.
    After: the template renders capacity: 2, and the Stack evaluates to 4096 MB — both read offline, with no store and no secret:
$ ansible-playbook -c local -i localhost, render-runner-config.yml   # runner.yaml.j2 from the role's defaults
  capacity: 2
  timeout: 1h

$ tofu console    # runner/guest, backend dropped in a scratch copy
> var.guest.memory
4096
  • mise exec -- make check → exit 0: env-check's pin and 19 map names agree, tofu fmt -check clean, docs-check's five assertions hold (51 links, 20 fragments, 9 ADR rows, the section indexes, 21 wiki documents).
  • mise exec -- make validate → exit 0: Success! The configuration is valid. for all three Stacks.
  • mise exec -- make syntax-check → exit 0: both playbooks parse.

Not verified here, because it needs PROD: the Guest's memory reading 4096 MB, two jobs overlapping on 146, and no job killed for memory while both run. The apply is the Operator's while this repository is still deployed by hand — make runner-guest, then make runner-service — as the ticket says.

Merge Danger

Door: two-way — both values are configuration, memory changes in place, and a revert is a revert pull request.

Blast Radius: narrow — Guest 146 and the job queue on it.

Merging does not deploy: infra-forge is still deployed by hand, so nothing changes on 146 until the Operator runs the two Targets.

Implements [FO-66](https://vikunja.thepit.space/tasks/322) ## Summary The runner's slot count, and the memory the second slot needs: ```diff runner/service/roles/runner/defaults/main.yml - runner_capacity: 1 + runner_capacity: 2 runner/guest/variables.tf - memory = 2048 + memory = 4096 ``` A Semaphore deploy job polls its task for up to 35 minutes. At one slot it held 146's only slot, so every plan check queued behind it; at two, the plan check runs beside it. The Guest is the same vmid on the same 2 cores and 512 MB of swap — `memory` changes in place, so no replacement is planned. The config the daemon reads is rendered from the role's defaults, so the value moves where it lives, and the comments beside it say why two rather than one. `docs/actions/runner-and-workflows.md` follows the artifact: capacity 2, 4096 MB, and what that means for the check queue. ADR 0009's "2 GB" stays as it is — it records the Guest as first built. ## Evidence - **Before:** the role's default was `runner_capacity: 1`, and the Stack declared `memory = 2048`. **After:** the template renders `capacity: 2`, and the Stack evaluates to 4096 MB — both read offline, with no store and no secret: ```text $ ansible-playbook -c local -i localhost, render-runner-config.yml # runner.yaml.j2 from the role's defaults capacity: 2 timeout: 1h $ tofu console # runner/guest, backend dropped in a scratch copy > var.guest.memory 4096 ``` - `mise exec -- make check` → exit 0: env-check's pin and 19 map names agree, `tofu fmt -check` clean, docs-check's five assertions hold (51 links, 20 fragments, 9 ADR rows, the section indexes, 21 wiki documents). - `mise exec -- make validate` → exit 0: `Success! The configuration is valid.` for all three Stacks. - `mise exec -- make syntax-check` → exit 0: both playbooks parse. Not verified here, because it needs PROD: the Guest's memory reading 4096 MB, two jobs overlapping on 146, and no job killed for memory while both run. The apply is the Operator's while this repository is still deployed by hand — `make runner-guest`, then `make runner-service` — as the ticket says. ## Merge Danger **Door:** two-way — both values are configuration, `memory` changes in place, and a revert is a revert pull request. **Blast Radius:** narrow — Guest 146 and the job queue on it. Merging does not deploy: infra-forge is still deployed by hand, so nothing changes on 146 until the Operator runs the two Targets.
ticket-dispatch: the forge runner runs two jobs at a time (FO-66)
All checks were successful
plan / edge-plan-check (pull_request) Successful in 19s
plan / guest-plan-check (pull_request) Successful in 22s
pr-checks / env-check (pull_request) Successful in 18s
pr-checks / fmt-check (pull_request) Successful in 22s
pr-checks / validate (pull_request) Successful in 21s
pr-checks / syntax-check (pull_request) Successful in 18s
pr-checks / docs-check (pull_request) Successful in 18s
d9a3d0227e
A Semaphore deploy job polls its task for up to 35 minutes, and at `capacity: 1`
it held 146's only slot against every plan check queued behind it — a merge's
plan waited on a deploy that had not finished.

The runner daemon now takes two jobs at once, and the Guest they run on gets
4096 MB so the two fit: the same vmid, the same 2 cores and 512 MB of swap,
changed in place with no replacement.

The config the daemon reads is rendered from the role's defaults, so the
capacity is raised where the value lives, and the comments beside it — in the
role and in the template — say why it is two rather than one.
Member

Review started (round 1/5) on d9a3d0227e — reading the diff now.

**Review started** (round 1/5) on d9a3d0227eac986bff072287a9e1f31b8aa117e0 — reading the diff now.
bot-minos approved these changes 2026-11-10 22:58:11 +00:00
bot-minos left a comment

repo=olympus/infra-forge pr=94 head=d9a3d0227eac986bff072287a9e1f31b8aa117e0 round=1/5 verdict=merge

Recommendation: merge

Spec: FO-66 (Vikunja task 322), fetched from the tracker linked in the description. Four files, one commit (d9a3d02), branch base 19e3563 = current origin/main.

Standards — 1 finding (0 blockers, 1 advisory)

# Where Severity Finding
S1 runner/service/roles/runner/defaults/main.yml:27-30 and runner/service/roles/runner/templates/runner.yaml.j2:14-15 ADVISORY AGENTS.md §Code comments: "Keep comments to a minimum… When something genuinely needs more explanation than the code can carry, propose a docs page under docs/ instead of writing it as a comment." The 35-minute rationale is now written three times: a 4-line comment in the defaults, a 2-line comment in the template, and twice on the docs page (docs/actions/runner-and-workflows.md:14-20, :180-182). The diff is net +2 comment lines while also doing the docs-page work the rule asks for. Smallest fix: leave one line at each code site — or a pointer to the page — and let the page keep the why. Advisory, not a blocker: the rule is a preference, the role's files are already comment-heavy by their own convention, and no tooling enforces it.

Also read and passed with no finding: the changed docs page's claims against the code (2 / 4096 MB), ADR 0009 left at 2 GB (docs/adr/0009-…:10-11) — consistent with docs/adr/index.md's supersede-don't-edit rule, and ADR 0009's own Update when does not name sizing, so a resized Guest does not oblige a new record; the page states the current figure and whose number the ADR's is. No secret, no state, no new address in the diff.

Spec — 0 findings

Ticket says State
Raise capacity 1 → 2 in the runner role's configuration (FO-66 §What to build) Done — defaults/main.yml:31; the template renders capacity: 2 (reproduced).
Raise 146's memory 2048 → 4096 MB in runner/guest (same §) Done — variables.tf:31; var.guest.memory evaluates 4096 (reproduced).
Applied today's way, make runner-guest then make runner-service, by the Operator (same §) Not code; named in the PR body and ordered guest-first, which is the order the daemon's config needs.
AC1 — Guest memory reads 4096, runner.yaml reads capacity: 2 Branch half confirmed; PROD half honestly marked unverified pending the apply.
AC2 — two jobs at once on 146 Unverified, as the author states; needs the apply and a live deploy beside a pull request.
AC3 — no job killed for memory while both run Unverified, same reason.

No scope creep: the fourth file is mandated by the actions page's own Update when ("the runner's configuration … changes"), and docs/actions/index.md:8 needed no edit because its row does not carry the figure.

Verified by hand

Command Result
mise exec -- make check exit 0 — env-check: pin matches, 19 names agree; docs-check: 51 links, 20 fragments, 9 ADR rows, section indexes, 21 wiki documents
mise exec -- make validate exit 0 — Success! The configuration is valid. for all three Stacks
mise exec -- make syntax-check exit 0 — both playbooks parse
runner.yaml.j2 rendered through the role's defaults + group_vars/runner/vars.yml capacity: 2, timeout: 1h (token redacted)
tofu console on a backend-less copy of runner/guest var.guest.memory → 4096, swap → 512, vmid → 146
grep for every reader of runner_capacity / every remaining 2048 Only defaults/main.yml sets it and only the template reads it; the two 2048s left are the forge and PRE Guests' own defaults

Note for anyone re-running this: syntax-check fails in a fresh checkout until make deps installs the collections into forgejo/service/collections (the ansible.cfg there pins collections_path). That is the toolchain rule in AGENTS.md, not the change — green after make deps.

Could not verify

  • AC2 and AC3 on PROD — the apply is the Operator's, and docs/agents/workflow.md §3 forbids it here. There is also no PRE runner to rehearse on: runner/service/inventories/ holds prod only.
  • "memory changes in place, so no replacement is planned" (PR body) — the runner Stack has no plan job (docs/runbooks/0001-deploy-and-rollback.md, The plan check), so nothing in CI plans this Stack and I could not produce a plan without the state key. What bounds the risk: runner/guest/container.tf:57 keeps prevent_destroy, so a replacement would refuse rather than destroy, and make runner-guest prints the plan before the word. Read as provider knowledge, not evidence.
  • The live daemon picking up capacity: 2 — roles/runner/tasks/main.yml notifies restart forgejo-runner on the template task (line ~106) and flushes handlers before the reachability wait, so make runner-service does restart it; the restart itself needs PROD.

Summary

  • Standards: 1 finding — worst: S1 (advisory, comment duplication against AGENTS.md §Code comments).
  • Spec: 0 findings — every deliverable present; two acceptance criteria unverified by design and reported as such.
  • Blockers: 0. The verdict follows from the blockers alone; S1 is advice and travels as advice.
  • All four changed files read and passed: docs/actions/runner-and-workflows.md, runner/guest/variables.tf, runner/service/roles/runner/defaults/main.yml, runner/service/roles/runner/templates/runner.yaml.j2.
`repo=olympus/infra-forge pr=94 head=d9a3d0227eac986bff072287a9e1f31b8aa117e0 round=1/5 verdict=merge` **Recommendation: merge** Spec: FO-66 (Vikunja task 322), fetched from the tracker linked in the description. Four files, one commit (`d9a3d02`), branch base `19e3563` = current `origin/main`. ## Standards — 1 finding (0 blockers, 1 advisory) | # | Where | Severity | Finding | | --- | --- | --- | --- | | S1 | `runner/service/roles/runner/defaults/main.yml:27-30` and `runner/service/roles/runner/templates/runner.yaml.j2:14-15` | ADVISORY | `AGENTS.md` §Code comments: *"Keep comments to a minimum… When something genuinely needs more explanation than the code can carry, propose a docs page under `docs/` instead of writing it as a comment."* The 35-minute rationale is now written three times: a 4-line comment in the defaults, a 2-line comment in the template, and twice on the docs page (`docs/actions/runner-and-workflows.md:14-20`, `:180-182`). The diff is net +2 comment lines while also doing the docs-page work the rule asks for. Smallest fix: leave one line at each code site — or a pointer to the page — and let the page keep the why. Advisory, not a blocker: the rule is a preference, the role's files are already comment-heavy by their own convention, and no tooling enforces it. | Also read and passed with no finding: the changed docs page's claims against the code (`2` / `4096 MB`), ADR 0009 left at `2 GB` (`docs/adr/0009-…:10-11`) — consistent with `docs/adr/index.md`'s supersede-don't-edit rule, and ADR 0009's own *Update when* does not name sizing, so a resized Guest does not oblige a new record; the page states the current figure and whose number the ADR's is. No secret, no state, no new address in the diff. ## Spec — 0 findings | Ticket says | State | | --- | --- | | Raise `capacity` 1 → 2 in the runner role's configuration (FO-66 §What to build) | Done — `defaults/main.yml:31`; the template renders `capacity: 2` (reproduced). | | Raise 146's memory 2048 → 4096 MB in `runner/guest` (same §) | Done — `variables.tf:31`; `var.guest.memory` evaluates 4096 (reproduced). | | Applied today's way, `make runner-guest` then `make runner-service`, by the Operator (same §) | Not code; named in the PR body and ordered guest-first, which is the order the daemon's config needs. | | AC1 — Guest memory reads 4096, `runner.yaml` reads `capacity: 2` | Branch half **confirmed**; PROD half honestly marked unverified pending the apply. | | AC2 — two jobs at once on 146 | **Unverified**, as the author states; needs the apply and a live deploy beside a pull request. | | AC3 — no job killed for memory while both run | **Unverified**, same reason. | No scope creep: the fourth file is mandated by the actions page's own *Update when* ("the runner's configuration … changes"), and `docs/actions/index.md:8` needed no edit because its row does not carry the figure. ## Verified by hand | Command | Result | | --- | --- | | `mise exec -- make check` | exit 0 — env-check: pin matches, 19 names agree; docs-check: 51 links, 20 fragments, 9 ADR rows, section indexes, 21 wiki documents | | `mise exec -- make validate` | exit 0 — `Success! The configuration is valid.` for all three Stacks | | `mise exec -- make syntax-check` | exit 0 — both playbooks parse | | `runner.yaml.j2` rendered through the role's defaults + `group_vars/runner/vars.yml` | `capacity: 2`, `timeout: 1h` (token redacted) | | `tofu console` on a backend-less copy of `runner/guest` | `var.guest.memory` → `4096`, `swap` → `512`, `vmid` → `146` | | `grep` for every reader of `runner_capacity` / every remaining `2048` | Only `defaults/main.yml` sets it and only the template reads it; the two `2048`s left are the forge and PRE Guests' own defaults | Note for anyone re-running this: `syntax-check` fails in a fresh checkout until `make deps` installs the collections into `forgejo/service/collections` (the `ansible.cfg` there pins `collections_path`). That is the toolchain rule in `AGENTS.md`, not the change — green after `make deps`. ## Could not verify - **AC2 and AC3 on PROD** — the apply is the Operator's, and `docs/agents/workflow.md` §3 forbids it here. There is also no PRE runner to rehearse on: `runner/service/inventories/` holds `prod` only. - **"`memory` changes in place, so no replacement is planned"** (PR body) — the runner Stack has no plan job (`docs/runbooks/0001-deploy-and-rollback.md`, *The plan check*), so nothing in CI plans this Stack and I could not produce a plan without the state key. What bounds the risk: `runner/guest/container.tf:57` keeps `prevent_destroy`, so a replacement would refuse rather than destroy, and `make runner-guest` prints the plan before the word. Read as provider knowledge, not evidence. - **The live daemon picking up `capacity: 2`** — `roles/runner/tasks/main.yml` notifies `restart forgejo-runner` on the template task (line ~106) and flushes handlers before the reachability wait, so `make runner-service` does restart it; the restart itself needs PROD. ## Summary - **Standards: 1 finding** — worst: S1 (advisory, comment duplication against `AGENTS.md` §Code comments). - **Spec: 0 findings** — every deliverable present; two acceptance criteria unverified by design and reported as such. - **Blockers: 0.** The verdict follows from the blockers alone; S1 is advice and travels as advice. - All four changed files read and passed: `docs/actions/runner-and-workflows.md`, `runner/guest/variables.tf`, `runner/service/roles/runner/defaults/main.yml`, `runner/service/roles/runner/templates/runner.yaml.j2`.
Merge branch 'main' into hermes/FO-66-the-forge-runner-runs-two-jobs-at-a-time
All checks were successful
plan / guest-plan-check (pull_request) Successful in 19s
plan / edge-plan-check (pull_request) Successful in 16s
pr-checks / syntax-check (pull_request) Successful in 18s
pr-checks / env-check (pull_request) Successful in 14s
pr-checks / fmt-check (pull_request) Successful in 14s
pr-checks / validate (pull_request) Successful in 19s
pr-checks / docs-check (pull_request) Successful in 15s
2a633b3ce8
pit merged commit 8b5892efe5 into main 2026-11-11 11:49:08 +00:00
pit deleted branch hermes/FO-66-the-forge-runner-runs-two-jobs-at-a-time 2026-11-11 11:49:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
olympus/infra-forge!94
No description provided.