-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Docker Hub pull rate limits #3099
Comments
One idea: for fork builds on GitHub Actions, we could look at using GitHub Packages as a cache for required images. Images pushed to GitHub Packages should be readable on forks, so the main (automatable) work would be:
Both could be accomplished using the pluggable image substitution mechanism that we have in mind. I'll add an action above for us to investigate. |
AFAIK, GitHub registry requires API token even for image pulls from public repositories, so I'm not sure images would be readable on forks. |
@vlsi you might be right, so I'd like to do some investigation before putting a lot of effort in. My understanding of the docs was that forks can access a |
just fyi, this started happening for us today in aws codebuild in our pipeline, tests fail because limit exceeded on docker hub, so some sort of rates are being enforced already (not waiting until november) |
@fongie that's alarming and disappointing - my understanding was that this was not being applied yet. Based on a test branch (#3098) I get the impression that GitHub Actions and CircleCI might not be getting rate limited yet. The advice would remain the same - to use an authenticated account for pulling or to use a mirror/copy in another registry. I'm saddened that we've not had time to release our image substitution yet, though. |
Updated above with link to https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/ which clarifies:
From my perspective, two major topics remain unresolved:
@fongie I've reached out to a contact at Docker to see if we can get clarification on when the rate limiting is supposed to be taking effect. |
Great! Sorry for not being more specific last post, I was busy trying to get our release out hehe This is the error message we got: in AWS CodeBuild, trying to pull 'postgres:10.7' It worked on the third attempt simply by retrying. I understand that there is the option to set up an authenticated account, I just dont have the time for that right now, but I would guess this is happening to more people and you might get more questions about this issue, so it might be nice to prepare thorough instructions for how to do it. If I log in to another docker registry in my codebuild environment, will testcontainers automatically use that to pull from when I do |
@fongie sorry for the slow response. If you log in to Docker Hub then Testcontainers will be able to use that hub account for pulling. If you log in to another docker registry (e.g. ECR) then that does not help directly, but it could be made to work. ECR does not function as a pull-through cache (AFAIK), so you'd have to copy the required image into ECR and use Logging in to Docker Hub requires fewer changes. |
For GitHub Actions users, this issue looks worth following: actions/runner-images#1445 |
Really good news for GitHub Actions users: actions/runner-images#1445 (comment) |
Would it not make sense to configure a registry mirror the same way native docker does? We have Nexus setup to mirror the official DockerHub registry, and we have configured our Jenkins slaves to point towards this mirror..
Although it's nice that there will be a piece of callback code that we can hook into to modify the image name before it's fetched, would it not be easier to allow a registry mirror to be configured in This seems like what 99% of people would want, and it would stop everyone implementing the same code to do it. |
@aaronjwhiteside registry mirror is the easiest way to "fix" the rate limits issue, yes. There is no need to implement any code for it and it can be set in Docker's settings already today. Also, there is #3413 that implements a default, prefixing substitutor, for those who don't have access to Docker's settings. |
I'm seeing the same behavior as @aaronjwhiteside on our internal network with registry mirrors setup. @rnorth, @bsideup we are prefixing our containers, such as |
@bsideup, That circularly brought me back here 😆 . We are on |
@brianwyka oh, yes, definitely. |
@brianwyka @bsideup I'm not sure if this is documented behaviour, I haven't checked, though a little unexpected it kinda makes sense. |
we solved the issue by forcing src/test/resources/docker-java.properties
|
That's really interesting. I wonder if we could/should obtain the daemon's registry URL from the At the very least we should document this. |
@poznas, were using that |
@brianwyka, for one of our repos this solution also did not work. |
@poznas IMHO moving away from testcontainers to gradle docker plugin & maven docker plugin is 2 steps back. It decreases significantly development experience. |
Are there any plans to publish test containers to the ECR public gallery: https://aws.amazon.com/about-aws/whats-new/2020/12/announcing-amazon-ecr-public-and-amazon-ecr-public-gallery/ This could be a good solution for many who have their CI on AWS environments as it provides free data transfer if you're on AWS. |
@Fraserhardy |
@bsideup now that testcontainer images are whitelisted in Docker Hub, can this issue be considered as closed? do you still recommend to update to 1.15.1 and use the "image name prefix" solution to point to an internal registry? Thanks |
@bsideup We are getting rate limit issues in aws codeBuild. If testcontainers/* are exempt from rate-limit, I don’t understand why we are getting this error. Below are the logs. we are using testcontainers 1.15.1
should we copy the testcontainer images to our internal registry and use the 'image name prefix' solution? |
@bsideup That's good news, but many internally used images are not from that repo, like alpine or localstack. I think a single property in Because now I have to do this one-by-one in ambassador.container.image=my-registry.com/richnorth/ambassador
socat.container.image=my-registry.com/alpine/socat
vncrecorder.container.image=my-registry.com/testcontainers/vnc-recorder
...etc... which is cumbersome and fragile for changes. Something similar to the
|
Thank you @bsideup! |
@adambriny good idea! P.S. contributions are more than welcome 😊 |
How about KISS registryMirrors soution? |
I just tried to use ECR as the |
Hi @perrin4869 |
(Just to clarify, this means that images like |
@rnorth As far as I can see, the ryuk image is not part of the open source program. The Comparing: |
N.B. This issue description will be updated as new information becomes available.
As of 2020-08-13, Docker have updated their terms of service and pricing page, indicating that:
The page on rate limits clarifies that this applies
to layers being pulled, notimages.Since most images comprise multiple layers, the effective image pull rate limit will be very low.The rate limit page is inconsistent about the number, but also states that these rate limits are being introduced gradually.
Based on a recent build it does not appear that these rate limits are being enforced yet. However, it seems as though they will be in effect by 2020-11-01, so we need to understand the implications for various groups.
Implications
For environments where images are persisted between builds, the rate limit may not be hit. For ephemeral CI environments where images are discarded between builds, it seems more likely that the rate limit will be hit.
In general, all user groups may need to either:
user groups with low image pulling requirements (e.g. few images or a low rate of builds) will presumably not be impacted.
For open source projects using Testcontainers within their builds (including Testcontainers itself)
For companies using Testcontainers within their builds
Actions for users
Actions for Testcontainers team
Set up authenticated pulls for Testcontainers' own builds (N.B. this refers to adding
docker login
to our CI scripts. Authenticated pull support is already implemented in testcontainers-java)Implement transparent 'image substitution' (whereby Testcontainers will consult a user-provided piece of code to obtain an alias for an image, which may reside on a private registry). PR: Image substitution #3102
Investigate the possibility of providing an implementation of image substitution that treats GitHub Packages as a cache.
Retrofit to language forks: authenticated image pulls and image substitution
Improve documentation around authenticated image pulls and options for mirroring registries / copying images to non-Hub registries
Open questions
When will rate limits noticeably kick in? Unclear: nominally 1st November, but some Docker/Testcontainers users have reported rate limiting already
Are CI platforms going to attempt to mitigate this?
Is there a separate Free plan for Open Source projects that allows unlimited pulls? Yes, see https://www.docker.com/blog/scaling-docker-to-serve-millions-more-developers-network-egress/
How should repo forks manage the need to provide Hub credentials?
The text was updated successfully, but these errors were encountered: