build-image: push via in-cluster registry on runners that resolve it internally #14
Loading…
Reference in a new issue
No description provided.
Delete branch "registry-push-in-cluster"
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?
build-image: push via the in-cluster registry on runners that resolve it internally
Why
Paperclip's image builds (and any build with layers big enough not to finish
within ~60s) have been failing since Oct 24 with:
infrastructure #147 made the registry reachable in-cluster from the runners
(hostAlias
reg.levior.io -> zot ClusterIP, a 443-fronting Service, dind--insecure-registry). That fixed dockerd, but builds still failed: with aTCP
DOCKER_HOST, buildx uses the docker-container driver, and the push isperformed by the nested buildkitd container — which has its own
/etc/hosts(docker-managed) and resolves
reg.levior.ioto the public coreflared edge.Every push still hairpinned pod → public edge → tunnel → connector → Zot, and
coreflared kills any request whose response headers take longer than ~60s.
Large monolithic blob PUTs can never meet that.
What changes
A new "Detect in-cluster registry" step runs before
docker/setup-buildx-action:it via hostAliases to the in-cluster Zot service), the builder is created with
driver-opts: network=host(buildkitd then shares the pod netns and sees thehostAlias mapping) and a
config-inlinethat marks the registry as plain-HTTP(
http = true,insecure = true) so buildkitd talks to the plain-HTTP Zotfront on port 443. Pushes then go pod → ClusterIP → Zot, no tunnel.
builder is created exactly as before.
require_postgresdriver-opts/buildkitd-flags behavior is unchanged.Evidence
Measured on the runners (branch runs):
/etc/hostshas no hostAlias entry and resolvesreg.levior.io → flared.core.ci → 167.235.104.250— the tunnel path.15s; through the tunnel the same PUT dies at 60s on every attempt.
[registry."..."].mirrors) are pull-only — they do not redirectpushes (verified: push URL stayed
https://reg.levior.ioand 502'd), so thehost-network approach is the one that works.
template-smoke.yml(new, workflow_dispatch) buildsDockerfile.smoke, a500MB incompressible layer that cannot fit through the tunnel: green, with
pushing layers 4.9s. Run it after future template changes to prove thein-cluster path still works.
assigns each its own port); a hardcoded
--addrinbuildkitd-flagsbreaksthat negotiation and must not be used.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.