Skip to content
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

DockerHub rate limiting #2961

Closed
timja opened this issue May 30, 2022 · 10 comments
Closed

DockerHub rate limiting #2961

timja opened this issue May 30, 2022 · 10 comments

Comments

@timja
Copy link
Member

timja commented May 30, 2022

Service(s)

ci.jenkins.io

Summary

Still getting rate limited on https://github.com/jenkinsci/docker

https://ci.jenkins.io/blue/organizations/jenkins/Packaging%2Fdocker/detail/PR-1383/3/pipeline/413

[2022-05-30T19:43:41.951Z] error: failed to solve: rpc error: code = Unknown desc = failed to solve with frontend dockerfile.v0: failed to create LLB definition: failed to copy: httpReadSeeker: failed open: unexpected status code https://registry-1.docker.io/v2/library/debian/manifests/sha256:3f1d6c17773a45c97bd8f158d665c9709d7b29ed7917ac934086ad96f92e4510: 429 Too Many Requests - Server message: toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading: https://www.docker.com/increase-rate-limit

[2022-05-30T19:43:41.951Z] make: *** [Makefile:53: build-debian_jdk11] Error 1

dependabot PR swarm never works first time.

follow on to #2837

Reproduction steps

No response

@github-actions github-actions bot added ci.jenkins.io triage Incoming issues that need review labels May 30, 2022
@dduportal dduportal added this to the infra-team-sync-2022-06-07 milestone May 31, 2022
@dduportal dduportal self-assigned this May 31, 2022
@dduportal dduportal removed the triage Incoming issues that need review label Jun 7, 2022
@dduportal
Copy link
Contributor

For context, the issue #2842 describe what the Docker Open Source membership gives us and what it does NOT give us.

The issue raised by @timja here is unrelated to the Open Source program: it is related to the fact that our organizations are only "free team" accounts, with still the rate limit at 200 req / 6h and 3 user seats (ref. https://www.docker.com/pricing/)

Capture d’écran 2022-06-07 à 12 37 40

Since all of the jobs on ci.jenkins.io for the jenkinsci/docker* projects are building Docker images from the official images such as alpine or ubuntu, they are rate limited at 200 req / 6h.

@dduportal
Copy link
Contributor

We are in discussion with Docker, they told us they we OK to grant us a "Team plan" with at least 5000 req / day, maybe more (not sure yet).
That should make, in the worst case, a threshold increase from 200 to 1250 per 6hours range. That might be enough.

If we can't be upgraded to such a plan, or if the new threshold is not enough, we have the following solutions available:

  • Stop authenticating requests during builds and tests AND use public IPs for our agents

  • Use a collection of free "dummy" account for pulling and spread the load

    • Easy to apply (programmatic change in the withDockerPullCredentials() pipeline library, using a modulo could do it)
    • Challenge: maintaining this list of accounts (and associated credentials) cannot be automated (missing feature from DockerHub API) so will be painful
  • Use a docker "caching" registry that would be authenticated to the DockerHub, and our VMs would be configured to use it.

    • Generic solution that would allow us to be "good citizen" of the DockerHub
    • Challenge: cost to build and maintain (host the service, clean it up, restrict its access, maybe duplicate per cloud or per region, configuration of the agents, etc.)
  • Use another registry for base images

    • No more DockerHub API rate limit
    • Challenge: this new registry MUST be available for our users if they want to build the images themselves, this registry must be closely mirroring the "official" DockerHub images, and we usually have to pay for such service (storage, cloud fees, or another form of API rate limit)

@dduportal
Copy link
Contributor

In short-short term (until we have news from Docke Inc.) , we have to be patient and "sequentialize" the builds on ci.jenkins.io

@timja
Copy link
Member Author

timja commented Jun 7, 2022

Challenge: this new registry MUST be available for our users if they want to build the images themselves, this registry must be closely mirroring the "official" DockerHub images, and we usually have to pay for such service (storage, cloud fees, or another form of API rate limit)

They wouldn't need to access it: https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon


Best and cheapest solution I think is an upgraded account, either sponsored by docker hub or CDF / linux foundation

@dduportal
Copy link
Contributor

They wouldn't need to access it: https://docs.docker.com/registry/recipes/mirror/#configure-the-docker-daemon

This documentation is for the "docker caching" solution. In this case, I agree end-user don't need (and forward: they should NOT be allowed) to access the caching registry.

I might have mis-written the scenario "use another registry": this case means changing the value of the FROM instruction of all of our Dockerfiles to the URL of another registry (for instance: FROM alpine:3.15 should be changed to ghcr.io/jenkinsci/alpine:3.15).

@timja
Copy link
Member Author

timja commented Jun 23, 2022

This is getting rediculous, PRs barely pass at all on the repo, taking many many builds.

jenkinsci/docker#1399
jenkinsci/docker#1398
jenkinsci/docker#1356

In short-short term (until we have news from Docke Inc.) , we have to be patient and "sequentialize" the builds on ci.jenkins.io

I have tried that twice in a row now, still getting failures.

@dduportal
Copy link
Contributor

fair, let's prioritize that today.

Short term goal to unblock these PRs:

  • enabling public IP on all the VM agents for ci.jenkins.io (AWS and Azure)
  • Modify the shared library to stop logging in to DockerHub

@dduportal
Copy link
Contributor

@dduportal
Copy link
Contributor

Update: we received notifications (and were able to confirm) that the DockerHub organizations jenkinsciinfra and jenkins4eval are now under a Team plan.

Let's try to authenticate again the agent for pulls and see the behavior (e.g. do we reach the new limit when dependenbot starts a lot of PRs)

@dduportal
Copy link
Contributor

Sounds like we're doing better! Gotta close this issue unless you start seeing HTTP/429 about rate limit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants