r/devops • • 24d ago

Weekly Self Promotion Thread

Hey r/devops, welcome to our weekly self-promotion thread!

Feel free to use this thread to promote any projects, ideas, or any repos you're wanting to share. Please keep in mind that we ask you to stay friendly, civil, and adhere to the subreddit rules!

13 Upvotes

92 comments sorted by

View all comments

1

u/Low-Consequence2092 17d ago

Warm Docker-in-Docker slots for ephemeral GitHub Actions runners: how I cut a monorepo CI from ~6.5 to ~3 min without Kubernetes

Ephemeral runners are the safe default for GitHub Actions, but they start cold: every job pulls its services: images, rebuilds Docker layers, and restores package caches from blob storage. Persistent runners are fast but leak state between jobs.

The approach I ended up with, now an open-source tool called Pitlane (Go, MIT):

  1. A slot is a long-lived docker:dind container with its own data volume. Slots never share a network, and jobs never see the host's Docker socket.
  2. For each job, a fresh actions-runner container joins the slot's network namespace (like a pod) with DOCKER_HOST pointing at the slot daemon. It runs one job and is deleted.
  3. After the job, the job's containers, networks, volumes and workspace are removed. Images and the buildx cache stay.
  4. Package caches and toolchains are volumes per GitHub owner. A slot that switches owner is wiped first. When every free slot needs a wipe, Pitlane picks the one whose loss costs least (unknown owner, then an owner with another warm slot, then LRU).
  5. actions/cache is served from the host: a small shim in front of the runner's Node points the cache toolkit at Pitlane, with a per-job token scoped to the owner. Artifacts, OIDC and logs still go to GitHub.
  6. Jobs come through the runner scale set API (actions/scaleset, same API as ARC), over a long-poll.

Measured on one private monorepo (pnpm, Nuxt, Prisma, Postgres/Redis services, 3 image builds), Pitlane in a 12-vCPU unprivileged Proxmox LXC:

ubuntu-latestPitlane
Whole CI~6 min 30~3 min
Docker images + smoke test393 s127 s
Unit tests161 s159 s

The unit test row is the honest part: CPU-bound work runs at the speed of your hardware. Everything that is download or rebuild gets faster.

Trade-offs I haven't solved:

  • Slots are privileged. Strict mode for public repos gives each job throwaway caches and a wiped daemon, but a malicious job can still own the host. Sysbox, rootless DinD or microVMs would help; not supported yet.
  • One Docker host per instance. If you need to schedule across a fleet, ARC or GARM are built for that.
  • Linux only.

Write-up of the design and comparison with ARC, runscaler, GARM and terraform-aws-github-runner: https://turoyt.github.io/pitlane/why Code: https://github.com/TuroYT/pitlane

I'm curious how others handle Docker layer caching on ephemeral runners: registry cache, type=gha, sticky disks, something else?