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
2 changed files with 11 additions and 11 deletions
Showing only changes of commit 9629994e55 - Show all commits

View file

@ -122,22 +122,22 @@ rewrite). `ci-runner` is a slim Debian base with `docker-ce-cli` +
`python3-yaml` for the other jobs that need them (`shell-lint`, `python3-yaml` for the other jobs that need them (`shell-lint`,
`observability-validate`). `observability-validate`).
Built and verified locally; **not yet pushed** — pushing to Pushed as `git.thermograph.org/emi/thermograph/ci-runner:v1`. Rebuild/push
`git.thermograph.org/emi/thermograph/ci-runner` needs a PAT with (requires a PAT with `write:package` scope — the embedded git-remote token
`write:package` scope (the embedded git-remote token lacks it, same lacks it, same requirement documented in `backend-build-push.yml`):
requirement documented in `backend-build-push.yml`). Once pushed:
```bash ```bash
docker build -t git.thermograph.org/emi/thermograph/ci-runner:v1 deploy/forgejo/ci-runner docker build -t git.thermograph.org/emi/thermograph/ci-runner:v1 deploy/forgejo/ci-runner
docker push git.thermograph.org/emi/thermograph/ci-runner:v1 docker push git.thermograph.org/emi/thermograph/ci-runner:v1
``` ```
then cut the live runner over by editing the `labels` array in `register-lan-runner.sh`'s `LABELS` default now points at this image, so
`~/forgejo-runner/.runner` on the desktop (same runner id/token, no fresh registrations pick it up automatically. The live runner is cut over by
re-registration) and updating `register-lan-runner.sh`'s `LABELS` default so editing the `labels` array in `~/forgejo-runner/.runner` on the desktop (same
future re-provisioning matches. Only after that cutover is verified working runner id/token, no re-registration needed) and restarting the service. Only
should the now-redundant `apt-get install docker.io` / `python3-yaml` steps be after a real job has run successfully under the new image should the
removed from the workflows that had them — removing them first would break now-redundant `apt-get install docker.io` / `python3-yaml` steps be removed
from the workflows that had them — removing them first would break
every job still running on `node:20-bookworm`. every job still running on `node:20-bookworm`.
## Why Postgres here and not the Thermograph app's TimescaleDB ## Why Postgres here and not the Thermograph app's TimescaleDB

View file

@ -26,7 +26,7 @@ set -euo pipefail
FORGEJO_URL="${1:?usage: $0 <forgejo_url> <registration_token>}" FORGEJO_URL="${1:?usage: $0 <forgejo_url> <registration_token>}"
TOKEN="${2:?}" TOKEN="${2:?}"
RUNNER_DIR="${RUNNER_DIR:-$HOME/forgejo-runner}" RUNNER_DIR="${RUNNER_DIR:-$HOME/forgejo-runner}"
LABELS="${LABELS:-docker:docker://node:20-bookworm,thermograph-lan}" LABELS="${LABELS:-docker:docker://git.thermograph.org/emi/thermograph/ci-runner:v1,thermograph-lan}"
echo "==> Stopping and disabling the old GitHub Actions runner service, if present" echo "==> Stopping and disabling the old GitHub Actions runner service, if present"
systemctl --user stop github-actions-runner 2>/dev/null || true systemctl --user stop github-actions-runner 2>/dev/null || true