infra/forgejo: add resource limits and a leaner CI job image #38

Merged
admin_emi merged 4 commits from infra/forgejo-reliability-ci-perf into main 2026-07-24 18:56:47 +00:00
Owner

Summary

  • Add cpu/memory resources.limits to Forgejo's db/forgejo Swarm services (docker-stack.yml had none, unlike the app stack) — generous defaults, several times observed steady-state usage, overridable via FORGEJO_DB_CPUS/FORGEJO_DB_MEMORY/FORGEJO_CPUS/FORGEJO_MEMORY.
  • Add infra/deploy/forgejo/ci-runner/Dockerfile: a slim Debian base with docker-ce-cli+docker-buildx-plugin preinstalled, meant to replace the node:20-bookworm job image most docker-labeled workflows run in. Node is dead weight now (frontend is Go); the current per-job apt-get install docker.io also pulls in the classic Docker builder, which has a COPY --chown group-resolution bug BuildKit doesn't have.

Status

  • Resource limits: this stack has no auto-deploy trigger, so merging alone doesn't apply them — will run docker stack deploy on the manager after merge.
  • CI image: built and verified locally, not yet pushed — needs a write:package-scoped PAT that can't be self-provisioned. Not wired into the live runner or register-lan-runner.sh yet; see the new README section for the cutover sequence.

Test plan

  • docker-stack.yml parses as valid YAML
  • ci-runner image builds and docker --version && docker buildx version && git --version && python3 -c "import yaml" all succeed locally
  • After merge: apply resource limits live via docker stack deploy, confirm both services stay 1/1 and reachable
## Summary - Add cpu/memory `resources.limits` to Forgejo's `db`/`forgejo` Swarm services (docker-stack.yml had none, unlike the app stack) — generous defaults, several times observed steady-state usage, overridable via `FORGEJO_DB_CPUS`/`FORGEJO_DB_MEMORY`/`FORGEJO_CPUS`/`FORGEJO_MEMORY`. - Add `infra/deploy/forgejo/ci-runner/Dockerfile`: a slim Debian base with `docker-ce-cli`+`docker-buildx-plugin` preinstalled, meant to replace the `node:20-bookworm` job image most `docker`-labeled workflows run in. Node is dead weight now (frontend is Go); the current per-job `apt-get install docker.io` also pulls in the classic Docker builder, which has a `COPY --chown` group-resolution bug BuildKit doesn't have. ## Status - Resource limits: this stack has no auto-deploy trigger, so merging alone doesn't apply them — will run `docker stack deploy` on the manager after merge. - CI image: built and verified locally, **not yet pushed** — needs a `write:package`-scoped PAT that can't be self-provisioned. Not wired into the live runner or `register-lan-runner.sh` yet; see the new README section for the cutover sequence. ## Test plan - [x] `docker-stack.yml` parses as valid YAML - [x] `ci-runner` image builds and `docker --version && docker buildx version && git --version && python3 -c "import yaml"` all succeed locally - [ ] After merge: apply resource limits live via `docker stack deploy`, confirm both services stay `1/1` and reachable
admin_emi added 1 commit 2026-07-24 07:21:58 +00:00
infra/forgejo: add resource limits and a leaner CI job image
All checks were successful
secrets-guard / encrypted (pull_request) Successful in 5s
PR build (required check) / changes (pull_request) Successful in 9s
shell-lint / shellcheck (pull_request) Successful in 8s
PR build (required check) / build-backend (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
c966ac4801
docker-stack.yml previously had no cpu/memory limits on db or forgejo,
unlike every service in the app stack. Add generous limits (several
times observed steady-state usage) as a backstop, overridable via env
vars matching the app stack's convention.

Also add ci-runner/Dockerfile: a slim Debian base with the Docker CLI
+ buildx preinstalled, replacing node:20-bookworm (leftover from when
the frontend was Python/Jinja; nothing in CI uses npm/node anymore).
Closes a COPY --chown group-resolution bug in the classic Docker
builder that apt-get install docker.io currently pulls in on every
build-push job, and drops that install step's cost once cut over.
Built and verified locally; not yet pushed to the registry (needs a
write:package-scoped token) or wired into the live runner.
admin_emi added 1 commit 2026-07-24 07:32:25 +00:00
infra/forgejo: push ci-runner and cut the LAN runner over to it
Some checks failed
PR build (required check) / changes (pull_request) Failing after 6s
secrets-guard / encrypted (pull_request) Failing after 4s
shell-lint / shellcheck (pull_request) Failing after 2s
PR build (required check) / build-backend (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
9629994e55
Image is live at git.thermograph.org/emi/thermograph/ci-runner:v1.
register-lan-runner.sh's LABELS default now points at it, and the
live runner's registration was cut over directly (labels edited in
~/forgejo-runner/.runner, no re-registration needed).
admin_emi added 1 commit 2026-07-24 18:47:54 +00:00
infra/forgejo: fix ci-runner — node is required by actions/checkout
All checks were successful
PR build (required check) / changes (pull_request) Successful in 6s
secrets-guard / encrypted (pull_request) Successful in 7s
shell-lint / shellcheck (pull_request) Successful in 7s
PR build (required check) / build-backend (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
3678f643ef
v1 dropped node:20-bookworm for a Node-free Debian base, on the wrong
assumption that nothing in CI needs Node since the frontend is Go now.
Forgejo's runner executes actions/checkout@v4 as `node dist/index.js`
inside the job container regardless of what the workflow itself runs,
so every job's checkout step failed. Caught from the live run within
a minute; runner was reverted to node:20-bookworm immediately.

v2 keeps the node:20-bookworm base and only adds docker-ce-cli +
docker-buildx-plugin on top, preserving the actual fix (BuildKit
instead of the classic builder, no per-job docker.io install) without
removing a hard dependency.
admin_emi added 1 commit 2026-07-24 18:53:58 +00:00
ci: retrigger to verify ci-runner:v2 on the live runner
All checks were successful
PR build (required check) / changes (pull_request) Successful in 7s
secrets-guard / encrypted (pull_request) Successful in 8s
shell-lint / shellcheck (pull_request) Successful in 6s
PR build (required check) / build-backend (pull_request) Has been skipped
PR build (required check) / build-frontend (pull_request) Has been skipped
PR build (required check) / validate-observability (pull_request) Has been skipped
PR build (required check) / gate (pull_request) Successful in 2s
dcea1edef2
admin_emi merged commit dcf15ea572 into main 2026-07-24 18:56:47 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
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: Jinemi/thermograph#38
No description provided.