-
-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci.jenkins.io] Set up an ECR pull through cache #4321
Comments
First step: let's create the ECR pull through cache registry. A good source of knowledge to get started is the EKS Blueprint ECR Pattern with its Terraform source code in https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/patterns/ecr-pull-through-cache It requires to provide a couple username/token as input parameter to Terraform's project (through the pipeline) and we'll start by creating the ECR before trying to access it in the private subnets (in agent VMs). |
…hrough cache in Terraform AWS (#6200) Ref. jenkins-infra/helpdesk#4321 Blocks jenkins-infra/terraform-aws-sponsorship#122
Update: we now have an ECR cache with pull through rules. Next step: we need to set up access from EC2 agents |
Damn, the ECR only works with.. custom image names. It's not transparent 🤦 : https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache-working-pulling.html#:~:text=Quay-,Docker%20Hub,-GitHub%20Container%20Registry
=> We could use it for the EKS cluster (for faster pulls) but it makes no sense for the ci.jenkins.io VM agents (ATH, Docker builds, etc.) as it would force users to have a different image name between CI and other environments (dev., CD, etc.). I guess we have to run a registry in mirror mode instead: https://docs.docker.com/docker-hub/image-library/mirror/ or any other alternative |
It definitely doesn't work with |
Test in progress (had the same thought process and want to know if it works because it would be really useful) |
So it does not work as ECR requires authentication, which does not work for registry mirrors:
|
Ah damn, I guess needs a proxy in front |
Yup, but given the additional setup, worth hosting a Docker Registry in the EKS cluster in Mirror mode and expose it with the same method as ACP to agents in private agents. Just ran a quick test with https://github.com/twuni/docker-registry.helm/tree/main and it works nice and easy. |
Update: the issue body has been updated to explain the choice of Docker registry. Task list:
|
#6201) Ref. jenkins-infra/helpdesk#4321 (comment) Requires jenkins-infra/charts-secrets@689f2c7 Tested once manually.
During the last summer, we had to setup a Docker "Pull Through" caching registry in Azure to avoid builds breaking due to HTTP/429 rate limit from DockerHub: #4192 (comment)
(edit) we changed the plan from "using ECR (see below)" to a "using self-hosted" Docker registry in [mirror mode]. Mainly because ECR does not allow transparent proxying and we don't want having to change all Docker images name in all ATH/plugins tests + Jenkins Docker images.
Plan with a self hosted Docker registry, following the Official Docker Mirror documentation:
nlb-ip
internal AWS LB (same as ACP).We can use this on the Jenkins and Jenkins BOM node pools for faster autoscaling
Let's get started with the Helm chart https://github.com/twuni/docker-registry.helm: audited it and it looks fine for a beginning
filesystem
driver is recommended in https://distribution.github.io/distribution/recipes/mirror/#what-about-my-disk for this use case (e.g. proxy mirror).Nice to have (but not mandatory) in the future:
(old plan with ECR)
Same can be done on AWS with ECR: https://docs.aws.amazon.com/AmazonECR/latest/userguide/pull-through-cache.html
Moving ci.jenkins.io to AWS needs the same kind setup:
The text was updated successfully, but these errors were encountered: