Switch to Buildah for container builds #51

Merged
eblume merged 30 commits from feature/p5-container-builds into main 2026-01-24 13:30:26 -08:00

30 commits

Author SHA1 Message Date
34211fa874 Remove placeholder workflows and ci-base manifest
All checks were successful
Test CI / test (pull_request) Successful in 4s
Keep only test.yaml workflow for now. Container build workflows
and ci-base Dockerfile will be added in a future PR.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 13:29:54 -08:00
ad968eea46 Remove tailscale_ci_gateway role and ACLs
All checks were successful
Test CI / test (pull_request) Successful in 4s
The Docker-based runner with Tailscale sidecar approach was abandoned
in favor of host execution mode. Clean up the unused infrastructure:

- Remove tailscale_ci_gateway role and its reference in indri.yml
- Remove tag:ci-gateway ACL grants and tagOwners from pulumi policy
- Plist already removed from indri

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 13:26:36 -08:00
cfe5c0c0dd Switch forgejo-runner to host execution mode
All checks were successful
Test CI / test (pull_request) Successful in 4s
Docker-based runner had networking issues reaching Forgejo from job
containers. Host execution mode runs the runner daemon directly on indri,
with jobs executing on the host. Actions that need Docker use host
networking to access localhost:3001.

- Runner binary compiled locally at ~/code/3rd/forgejo-runner
- Labels use :host suffix instead of :docker://image
- PATH set in launchd plist for mise-managed tools (node, etc.)
- Container network set to "host" for actions needing Docker

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 13:23:39 -08:00
c79dc94325 Fix forgejo-runner networking for tailnet access
Some checks failed
Test CI / test (pull_request) Failing after 32s
- Add --accept-routes to tailscale-ci-gateway for service routing
- Run forgejo-runner as root for docker socket access
- Mount actual docker socket path (not symlink)
- Use gateway network namespace for tailnet connectivity
- Registration uses gateway network for Forgejo access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 12:56:25 -08:00
911913bb2e Fix launchd templates to use full docker path
launchd agents don't have /usr/local/bin in PATH by default.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 11:37:04 -08:00
fdf5153130 Containerize forgejo-runner with Tailscale gateway for tailnet access
Some checks failed
Test CI / test (pull_request) Failing after 48s
Architecture:
- tailscale_ci_gateway role: Runs Tailscale container on tailnet-jobs network
- forgejo_runner role: Runs runner daemon in container on same network
- Job containers also use tailnet-jobs network

This allows the runner and jobs to reach forge.tail8d86e.ts.net via
the Tailscale gateway, avoiding hairpinning issues with localhost.

Changes:
- Add tailscale_ci_gateway role with launchd management
- Refactor forgejo_runner to use containerized daemon
- Runner registers with Tailscale URL instead of localhost
- Job containers run on tailnet-jobs network
- Update playbook role ordering (gateway before runner)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 11:28:35 -08:00
018b44186f Add tag:ci-gateway for Forgejo runner Tailscale sidecar
- Add ci-gateway tag owner (admin and blumeops can assign)
- Grant ci-gateway access to forge:443 for git operations
- Grant ci-gateway access to registry:443 for container push/pull
- Add ACL test for ci-gateway access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 11:03:02 -08:00
476b80e985 Use --add-host to map localhost to Docker host in job containers
Some checks failed
Test CI / test (pull_request) Failing after 40s
This allows containers to reach Forgejo at localhost:3001 for git operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 10:40:35 -08:00
15e3ec98ea Use host networking for job containers
Some checks failed
Test CI / test (pull_request) Failing after 36s
Containers need to reach localhost:3001 (Forgejo) for git operations.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 10:30:28 -08:00
50b925791d Update test workflow comment to trigger CI
Some checks failed
Test CI / test (pull_request) Failing after 1m15s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 10:28:12 -08:00
35136e361e Add comment to test workflow to trigger CI run
Some checks failed
Test CI / test (pull_request) Failing after 0s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 10:23:37 -08:00
bcdee225e5 Replace k8s runner with ci-base image for local builds
Some checks failed
Test CI / test (pull_request) Failing after 1s
- Remove forgejo-runner k8s manifests and ArgoCD app (runner now on indri)
- Remove build-runner workflow (no longer needed)
- Add ci-base image with Ubuntu 22.04 + common CI tools
- Add build-ci-base workflow to build the image
- Update test workflow to check docker instead of buildah
- Document bootstrap vs production mode for runner labels
- Configure host.docker.internal:5050 for zot access from job containers

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 09:23:24 -08:00
f4178fce7d Add ubuntu-latest labels to indri runner
Some checks failed
Test CI / test (pull_request) Failing after 1s
Now handles all workflows (test and build)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:59:13 -08:00
6b4e0961ed Add README explaining .github vs .forgejo directories
All checks were successful
Test CI / test (pull_request) Successful in 2s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:52:14 -08:00
2c284ed0cf Switch container builds to indri docker-builder runner
Some checks failed
Test CI / test (pull_request) Successful in 3s
Build forgejo-runner / build (push) Failing after 0s
- Use Docker instead of buildah in composite action
- Build workflows now run on docker-builder label
- Add actionlint config for custom runner labels
- Avoids nested containerization complexity in k8s

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:49:39 -08:00
8b75b696f0 Fix forgejo_runner handler (no nested blocks)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 08:44:23 -08:00
7a637d2ebf Fix 1Password field name for runner token
All checks were successful
Test CI / test (pull_request) Successful in 3s
Use runner_reg field (matching existing k8s secret template)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:31:06 -08:00
676c1782d1 Add forgejo_runner Ansible role for indri
All checks were successful
Test CI / test (pull_request) Successful in 2s
Run forgejo-runner directly on indri using Docker container mode
instead of trying to build containers inside k8s pods. This avoids
nested containerization complexity.

Features:
- Build from source using mise + Go
- Docker container mode for job isolation
- Can build containers via Docker socket
- Labels: docker-builder (distinct from k8s runner)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:28:44 -08:00
8d2e180d5d Add subuid/subgid for rootless buildah
Some checks failed
Test CI / test (pull_request) Successful in 3s
Build forgejo-runner / build (push) Failing after 20s
Buildah needs UID/GID remapping to extract images with files
owned by different users (root, shadow, etc). Configure
subordinate UID/GID ranges for the runner user.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:13:03 -08:00
a979ddaf0c Use versioned runner image v1.0.1
Some checks failed
Test CI / test (pull_request) Successful in 3s
Build forgejo-runner / build (push) Failing after 1m14s
- Remove imagePullPolicy: Always (rely on immutable tags)
- Use explicit version tag instead of :latest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:07:06 -08:00
4e0767b4d9 Build forgejo-runner from source with proper user setup
Some checks failed
Test CI / test (pull_request) Successful in 3s
Build forgejo-runner / build (push) Failing after 2s
- Multi-stage build from mirrored forgejo-runner source
- Create proper runner user with passwd entry (fixes buildah)
- Use named user instead of numeric UID

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 22:00:19 -08:00
0c1a3bf0cf Remove test comment from Dockerfile
Some checks failed
Test CI / test (pull_request) Successful in 2s
Build forgejo-runner / build (push) Failing after 2s
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:41:01 -08:00
3702e7eec2 Add tag-based container release workflow
All checks were successful
Test CI / test (pull_request) Successful in 3s
- Workflows trigger on git tags (e.g. runner-v1.0.0, devpi-v1.0.0)
- Composite action takes explicit version, tags image with version + SHA
- Add mise-tasks/container-list to enumerate containers and recent tags
- Add mise-tasks/container-release to create release tags
- Update CLAUDE.md with container release commands
- TODO: investigate zot tag immutability

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 21:34:33 -08:00
b2967817d6 Add comment to test buildah workflow
All checks were successful
Test CI / test (pull_request) Successful in 3s
2026-01-23 21:15:49 -08:00
a3a61146a3 Fix SIGPIPE in test workflow by adding || true to piped commands
All checks were successful
Test CI / test (pull_request) Successful in 3s
2026-01-23 21:14:02 -08:00
6d8e6ea4c0 Update test workflow to verify buildah/podman instead of docker
Some checks failed
Test CI / test (pull_request) Failing after 12s
2026-01-23 21:05:40 -08:00
c2be742094 Add imagePullPolicy: Always to ensure fresh image pulls 2026-01-23 21:03:53 -08:00
9f5dae5707 Switch to Buildah for container builds (no Docker socket needed)
- Replace docker-cli with buildah/podman in runner image
- Configure buildah for overlay storage with fuse-overlayfs
- Add registry config for insecure local registry
- Remove Docker socket mount and root security context from deployment
- Update composite action to use buildah bud/push instead of docker

Buildah is daemonless - no Docker socket required, cleaner security model.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 20:14:03 -08:00
4c249ff116 Add docker group (GID 999) to runner security context 2026-01-23 19:44:43 -08:00
4a3219648d Add container build workflows with composite action
- Create composite action: .forgejo/actions/build-push-image
- Add build-runner.yaml workflow (triggers on Dockerfile changes)
- Add build-devpi.yaml workflow (triggers on Dockerfile/start.sh changes)
- Mount Docker socket in runner deployment for container builds
- Run runner as root to access Docker socket

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-23 19:42:47 -08:00