Keep Docker job networks inside the range that can reach the cache #6
Loading…
Reference in a new issue
No description provided.
Delete branch "armin-bot/openneo-code:claude/docker-address-pool"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
CI has been flipping between fast runs (about 2 minutes, cache hits) and slow ones (8–12 minutes, where
actions/cachetimes out and every native gem compiles from scratch). Moving the runner to its own box didn't fix it, because the box was never the problem.Cause
predefinedStartIndexinlibnetwork/ipam/allocator.go, and the list is inipamutils/utils.go:172.17–172.31as /16s, then192.168.0.0/16as /20s.172.16.0.0/12reach the cache proxy. It leaves out192.168.0.0/16on purpose, because that overlaps Linode's private network. So jobs on192.168.xnetworks have their cache requests silently dropped, and give up after about 20 seconds.Evidence
docker network inspecton runner.openneo.net showed its network as192.168.32.0/20, with no leftover networks from earlier jobs.Fix
setup-actions.ymlwrites/etc/docker/daemon.json, which limits Docker's pool to172.20.0.0/14in /24s. That's 1,024 job networks, all inside the range ufw allows, so the rotation no longer matters. The ufw rule stays as it is, since it already covers this range. The new task restarts Docker (and the runner with it) only when the file changes.Rollout
At a quiet moment (restarting Docker kills a running job):
During the next job,
sudo docker network lsandinspecton runner.openneo.net should show a172.20.x.0/24network, and Restore cached gems should take a second or two, not about 21 seconds.Testing
ansible-playbook --syntax-checkpasses.172.20.0.0/14is within172.16.0.0/12. Not yet run against the box.🤖 Generated with Claude Code
https://claude.ai/code/session_014PWWd1c4UFRKce9t7XXiaP