Michael Semb Wever created CASSANDRA-21541:
----------------------------------------------
Summary: CI: cache Docker Hub image pulls in-cluster for the k8s
Jenkins agents
Key: CASSANDRA-21541
URL: https://issues.apache.org/jira/browse/CASSANDRA-21541
Project: Apache Cassandra
Issue Type: Improvement
Components: CI
Reporter: Michael Semb Wever
Assignee: Michael Semb Wever
In a Helm deployed CI, each CI agent runs its own docker-in-docker daemon on
an emptyDir, blank to begin with. Every agent therefore pulls the same build
and test images afresh; the largest, `cassandra-ubuntu-test`, is ~35Gi. At
hundreds of concurrent agents this is slow, wastes bandwidth, and trips
pull-rate limits.
Add an in-cluster Docker Hub pull-through cache (a registry:2 proxy) and
point the agents' `dind` at it via `--registry-mirror`. Each image is then
fetched from Docker Hub once and served to every agent over the cluster LAN;
`dind` falls back to Docker Hub directly if the cache is unreachable.
Docker's `--registry-mirror` can only mirror Docker Hub, not an arbitrary
registry such as apache.jfrog.io. So the prefetch in the Jenkinsfile is
repointed from the apache.jfrog.io names to those same Docker Hub names.
Patch changes:
- `.jenkins/k8s/docker-cache.yaml`: the pull-through cache (Deployment,
Service, PVC), pinned to the always-on controller node.
- `.jenkins/k8s/jenkins-deployment.yaml`: `dind` `--registry-mirror` in all
three agent templates.
- `.build/run-ci`: `--setup/--only-setup` applies the cache; teardown removes
it.
- `.jenkins/Jenkinsfile`: prefetch the Docker Hub image names.
The cache runs a single replica for now. It converts repeated WAN pulls into
one origin fetch plus LAN reads; if the pod's egress becomes the bottleneck
this can be scaled with replicas or an object-storage backend.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]