Migrate Forgejo runner to Kubernetes with DinD #60

Merged
eblume merged 15 commits from feature/containerized-runner into main 2026-01-25 19:56:17 -08:00

15 commits

Author SHA1 Message Date
ce10997f79 Fix: Move DOCKER_HOST to runner.envs (not container.env)
All checks were successful
Build Container / build (push) Successful in 41s
The act_runner config uses runner.envs for job environment variables,
not container.env which doesn't exist.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:52:30 -08:00
c4b14c0b89 Move DOCKER_HOST to runner config instead of workflow
Some checks failed
Build Container / build (push) Failing after 59s
The runner's container.env config sets environment variables in all
job containers, so we don't need to specify DOCKER_HOST per-workflow.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:40:33 -08:00
2c6e450e1a Bump runner job image to v2.1.7
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:35:28 -08:00
4927c79f5b Retire host-mode forgejo runner (Phase 3 complete)
- Remove forgejo_runner ansible role (no longer needed)
- Remove runner pre_tasks from indri.yml playbook
- Clean up actionlint.yaml to only allow k8s label
- Host runner was stopped and cleaned up on indri

All CI jobs now run on the k8s runner with DinD sidecar.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:31:00 -08:00
c7a58b8fdb Add DOCKER_HOST env var to workflow for k8s DinD support
All checks were successful
Build Container / build (push) Successful in 1m8s
The k8s runner uses a DinD sidecar accessible via TCP on port 2375.
While the runner daemon config has docker_host set, job containers
don't inherit this - they need the DOCKER_HOST env var set explicitly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:22:37 -08:00
1f595b6041 Use k8s label for k8s runner testing
Some checks failed
Build Container / build (push) Failing after 20s
Differentiate k8s runner from host runner with unique label.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:11:38 -08:00
47bbdf5d00 Set docker_host for DinD in k8s runner config
All checks were successful
Build Container / build (push) Successful in 37s
Job containers need to connect to DinD via TCP, not socket.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 19:06:49 -08:00
24e7df02df Add k8s forgejo-runner deployment (Phase 2 ratcheting)
Some checks failed
Build Container / build (push) Failing after 26s
- Deployment with forgejo-runner daemon + DinD sidecar
- ConfigMap for runner configuration
- Secret template for runner token (op inject)
- ArgoCD Application definition

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:57:20 -08:00
411b07e23c Mount Docker socket in job containers for DinD
All checks were successful
Build Container / build (push) Successful in 59s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:48:57 -08:00
e61e70078a Use forge.ops.eblu.me for runner URL (works from containers)
Some checks failed
Build Container / build (push) Failing after 4s
localhost:3001 doesn't work from Docker containers on macOS
because Docker Desktop's host networking runs in a VM.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:18:50 -08:00
fcbc3b958e Add docker mode to runner for containerized job execution
Some checks failed
Build Container / build (push) Failing after 39s
- Runner now supports both host and docker labels
- docker label uses forgejo-runner:v2.1.0 image with Node.js + Docker CLI
- Switch build workflow to docker mode for ratcheting test

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:12:32 -08:00
f19795615c Simplify forgejo-runner to job execution image
All checks were successful
Build Container / build (push) Successful in 1m15s
- Remove daemon entrypoint (host runner handles daemon)
- Add Node.js 20.x for GitHub Actions compatibility
- Keep Docker CLI for container builds
- Switch workflow back to ubuntu-latest (host runner)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 18:06:33 -08:00
82d0162282 Switch container builds to docker runner (Phase 1 ratcheting)
Some checks failed
Build Container / build (push) Failing after 26s
Test that the containerized runner can build containers.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:49:16 -08:00
ef6e40d8f2 Fix: add xz-utils for runner binary extraction
All checks were successful
Build Container / build (push) Successful in 1m5s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:22:56 -08:00
008533491f Add containerized forgejo-runner for Phase 1 ratcheting
Some checks failed
Build Container / build (push) Failing after 41s
Part of the runner ratcheting plan to migrate from host-mode to k8s runners.

- Debian-based image with forgejo-runner and Docker CLI
- Mounts Docker socket for container builds
- Auto-registers on first start
- Host networking for access to *.ops.eblu.me services

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 17:21:29 -08:00