16 Commits

Author SHA1 Message Date
unkin-agent f72823730c Allow g10kng image builds on iuclabs-build runners (#622)
IUCLabs/g10kng now builds a container image, and the iuclabs-build job-started hook refuses repos outside its allowlist.

- add IUCLabs/g10kng to the build runner allowlist

Reviewed-on: #622
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-30 00:32:41 +11:00
unkin-agent b9c962dc28 Match iuclabs-dind docker MTU to the pod network (#620)
Job containers on iuclabs-dind get TLS connection resets (e.g. actions/checkout to github.com) because dockerd defaults its bridges to MTU 1500 while the canal vxlan pod network is 1450.

- set dockerd `--mtu=1450`
- default new bridge networks (the runner's job network) to MTU 1450

Reviewed-on: #620
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-29 09:24:52 +11:00
unkin-agent 27459cb246 Route iuclabs runner uv python downloads through artifactapi (#619)
IUCLabs runners only reach artifactapi, so `uv python install` fails fetching python-build-standalone from GitHub. The artifactapi `github` remote now allows those release assets.

- set `UV_PYTHON_INSTALL_MIRROR` to the artifactapi `github` remote python-build-standalone releases path

Reviewed-on: #619
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-28 15:58:06 +11:00
unkin-agent a56db70937 Route iuclabs runner package installs through artifactapi (#617)
IUCLabs runner jobs pull pip, uv, go and npm packages straight from public registries because their egress blocks traefik-internal and their tools do not trust the internal CA.

- add an artifactapi component setting pip, uv, go, npm, yarn and corepack registry env on every runner
- build a combined public + internal CA bundle in an init container for SSL_CERT_FILE and REQUESTS_CA_BUNDLE
- allow every runner egress to traefik-internal on 443, replacing the dind and build copies

Reviewed-on: #617
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-28 14:58:01 +11:00
unkin-agent 3d3f7fef14 Allow container-puppet-pr-validator on build runners (#615)
The puppet-prod validator image moves to its own IUCLabs container repo, whose image builds run on iuclabs-build.

- add IUCLabs/container-puppet-pr-validator to the build runner repo allowlist
- cover it in the runner hook tests

Requires IUCLabs/terraform-git #35 applied for the repo to exist.

Reviewed-on: #615
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-28 14:56:51 +11:00
unkin-agent d42e7ebe61 Let iuclabs-dind pull images from artifactapi (#614)
Jobs on iuclabs-dind need images from artifactapi docker-internal as git.unkin.net goes away, but the runner's egress blocks traefik-internal and its dind daemon does not trust the internal CA.

- allow iuclabs-dind egress to traefik-internal on 443
- mount the vault CA into the dind daemon's certs.d for artifactapi

Reviewed-on: #614
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-28 13:48:47 +11:00
unkin-agent 65578fe3d3 Drop archived agent image repos from build runners (#613)
container-agent-base, -dev and -infra are archived and no longer build.

- Removes the three repos from the `build)` allowlist in `job-started.sh`.
- Updates `ci/test-runner-hooks.sh` so the allowlist is the remaining four repos.

Reviewed-on: #613
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-28 13:07:59 +11:00
unkin-agent eac424d7f5 Drop archived CI image repos from build runners (#611)
Why: container-gobuilder, container-opentofu and container-tea are being archived, not migrated, so build runners should no longer accept them.

- Remove the three repos from the build) allowlist in job-started.sh (7 repos remain)
- Remove them from the allowed list in ci/test-runner-hooks.sh

Reviewed-on: #611
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-27 22:41:53 +11:00
unkin-agent 2b4f4a2fb9 Add iuclabs-build runner scale set (#610)
IUCLabs rpmbuilder and container repos need a runner that can build images and publish to artifactapi, without opening that egress to every dind job.

- Adds the `iuclabs-build` scale set (copy of `iuclabs-dind`, `RUNNER_MODE=build`, same min/max runners)
- Allows egress to traefik-internal on 443/80 on top of the dind rules
- Mounts `vault-ca-cert` as the dind registry CA for artifactapi.k8s.syd1.au.unkin.net
- `job-started.sh` restricts build mode to IUCLabs/rpmbuilder and the listed container-* repos, then applies the usual event checks
- Extends `ci/test-runner-hooks.sh` with build-mode cases

Reviewed-on: #610
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-27 22:27:39 +11:00
unkin-agent 398ea49a16 Add iuclabs-dind ARC runner scale set (#606)
IUCLabs e2e tests need a Docker daemon, which the unprivileged runners can't provide. A separate scale set runs a privileged dind sidecar so existing runners stay unprivileged.

- add `iuclabs-dind` AutoscalingRunnerSet using the 0.15.1 chart's dind pod shape (externals init, native `docker.io/library/docker:29.9.3-dind` sidecar, `DOCKER_HOST` socket)
- cap emptyDirs (`/var/lib/docker` 30Gi, `_work` 20Gi) and set cpu/memory/ephemeral-storage on every container, dind sized above both volumes
- add its egress NetworkPolicy mirroring the other scale sets

Depends on artifactapi allowing `library/docker` (IUCLabs/terraform-artifactapi#8).

Reviewed-on: #606
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-27 07:39:18 +11:00
unkin-agent b65f86b53c Refuse all fork pull requests on IUCLabs runners (#593)
A pull_request job from a fork runs the fork's own workflow, Makefile and pre-commit config on the self-hosted runners before review. Fork PRs authored by members or collaborators were still allowed through.

- job-started hook refuses every pull_request whose head repo differs from the base repo, regardless of author association
- hook tests expect member fork PRs to be refused on default and infra runners

Reviewed-on: #593
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-21 14:51:06 +11:00
unkin-agent e1241811c9 Raise iuclabs-infra to 6 runners (#592)
The five terraform repos move plan/apply onto iuclabs-infra; two runners would queue their PR plans behind each other.

- raise iuclabs-infra maxRunners 2 → 6

Reviewed-on: #592
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-21 13:05:15 +11:00
unkin-agent a163c26860 add iuclabs-infra runner scale set for terraform repos (#591)
The IUCLabs terraform repos plan/apply from GitHub Actions, but the existing scale sets only reach public :443 and Vault, so they cannot reach the Consul state backend or the internal provider endpoints.

- add `iuclabs-infra` scale set (runs-on `iuclabs-infra`, max 2 runners)
- add `infra` hook mode allowing only IUCLabs/terraform-{git,vault,artifactapi,authentik,binarylane}
- allow egress to Consul, Vault, traefik-internal/external, rke2-ingress-nginx, authentik-server and public :443
- extend runner hook tests for the infra mode

Reviewed-on: #591
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-21 00:25:54 +11:00
unkin-agent ef2e6f2c80 add iuclabs-release tag-only runner scale set (#589)
IUCLabs release workflows must upload to artifactapi, which the default runner set cannot reach. A separate tag-only scale set keeps that access away from branch and PR jobs.

- add `iuclabs-release` scale set (0-2 runners) with `RUNNER_MODE=release`; `iuclabs-k8s` sets `RUNNER_MODE=default`
- job-started hook refuses any job when `RUNNER_MODE` is unset, empty or unknown
- release mode allows only `push` of `refs/tags/v[0-9]*`
- release egress allows traefik-internal pods on 443, which reaches every internal gateway host, not only artifactapi; L4 cannot narrow it and the alternative is plain HTTP to the api pods carrying a bearer token
- hook tests cover both modes and missing/invalid mode

Reviewed-on: #589
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-18 23:00:05 +11:00
unkin-agent 166605d3f1 iuclabs-runners: trust Vault CA in runner pods (#581)
Workflows on the iuclabs-k8s scale set log into https://vault.service.consul:8200, which serves a cert from the internal unkin.net CA that the runner image does not trust, so vault-action and curl fail TLS verification.

- Mount the reflected `vault-ca-cert` Secret read-only at `/etc/vault-ca` in the runner container.
- Set `NODE_EXTRA_CA_CERTS=/etc/vault-ca/ca.crt` so Node actions (vault-action) trust it alongside public CAs.
- curl callers pass `--cacert /etc/vault-ca/ca.crt`; `SSL_CERT_FILE` stays untouched to keep public TLS working.

Reviewed-on: #581
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-14 22:02:55 +11:00
unkin-agent fd3446ae8a Add ARC self-hosted runners for IUCLabs (#579)
IUCLabs public repos need self-hosted CI capacity, but anyone can open PRs there, so runners must only execute trusted code and must not reach internal services.

- deploy the ARC controller chart in arc-system, pulled through artifactapi
- keep shared runner resources (namespace, manager Role/RoleBinding, VSO secret, hooks) in the iuclabs-runners base
- package each scale set as a kustomize component (AutoscalingRunnerSet + its HTTPS/Vault egress policy), starting with iuclabs-k8s
- allow only push/dispatch/schedule/merge_group/release and trusted pull_request jobs via a job-started hook, tested in pre-commit
- default-deny the namespace and allow DNS

Depends on the github-app secret existing in Vault.

Reviewed-on: #579
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
2026-11-10 23:27:40 +11:00