-
Notifications
You must be signed in to change notification settings - Fork 48
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
Action fails due to docker: toomanyrequests #62
Comments
I remember that Docker allows you to increase your rate limit when using authenticated requests. You may need to log in to Docker from your GitHub Actions. I don’t know how to do that in GitHub Actions, though 😬 please search for details on that topic yourself. Hope you find something related to Docker rate limiting when using GitHub Actions |
Hello. Seems like Login into Docker from github actions won't help in this case becasue Container pull happens at the first step of the build before docker login. https://docs.docker.com/docker-hub/download-rate-limit/#github-actions |
What? - Add 2 new optional inputs to the Github action: - `dockerhub-username`: the "docker ID" (aka username) for the Dockerhub account the action should log in as - `dockerhub-password`: the account password or a personal access token used to authorize the account login. - Update the `./start-mongodb.sh` script to log into Dockerhub when these two inputs are provided. Why? - To allow users to authenticate with Dockerhub, and increase their rate limits. Otherwise, unauthorized requests can be rate limited, see: - https://www.docker.com/increase-rate-limits/ - supercharge#62
Hello 👋 We have encountered the issue today (something seems to have happened where Github runners were being rate limited: actions/runner-images#1445 (comment)). Thought I'd post our investigation and what we did in case it's useful to others. We found that our Github Action runner (hosted by Github) had it's IP address rate limited by Dockerhub. Presumably because more than 100 pulls were made from that IP address within a 6 hour period: https://docs.docker.com/docker-hub/download-rate-limit/. I think to address this long-term, and allow clients of this Github Action to setup In terms of addressing the issue in the short-term, we've opted to start the MongoDB docker container directly in our workflow: - name: Start MongoDB
id: start-mongodb
run: |
# Start MongoDB in a Docker container
CONTAINER_ID=$(docker run --rm -p=27017:27017 --detach mongo:7 --replSet=rs0 --port=27017)
echo "DOCKER_CONTAINER_ID=$CONTAINER_ID" >> "$GITHUB_OUTPUT"
# Wait for MongoDB to be ready
sleep 5
# etc...
- name: Shutdown MongoDB
if: ${{always() && steps.start-mongodb.outputs.DOCKER_CONTAINER_ID}}
run: docker stop ${{steps.start-mongodb.outputs.DOCKER_CONTAINER_ID}} Replica sets and other config can then be setup using similar logic to what is in The MongoDB instance is then available at: |
Can we just get an option for specifying another docker repo. I'd like to just pull from Amazon's public ECR instead of docker hub. something like:
So that I can use the bitnami image: |
@oliver-hohn Hey Oliver, thank you for your efforts in analyzing the Docker rate-limiting situation. I remember reading about Docker logins for GitHub Actions. But it sounds like this action would not use the Docker login because we’re building the container from scratch and skip the login. I’ll read up on this topic and get back here next week, possibly mid next week. |
@Sam-Bate-ITV Hey Sam, I never thought about using another Docker registry. Would you like to contribute this option as a pull request? |
Hey @marcuspoehls, just flagging this in case it's useful:
Correct, we can't log in because of how Docker based Github Actions work. The images seem to be built by Github Actions before any of the user defined steps are run. And, because the Github Action image here uses a Dockerhub image as the For what it is worth, it's an issue that would impact most Docker based Github Actions, and seems to only appear when there are less Github Action runners available (presumably when there is some sort of downtime or intermittent issue with Github Action runners). I think if we switch to a Javascript action rather than a Docker container action, we would bypass this issue: https://docs.github.com/en/actions/sharing-automations/creating-actions/about-custom-actions#javascript-actions. The Javascript could then run the |
I can probably take a look at doing this on Friday |
@marcuspoehls please see #64 which provides a mechanism to work around this issue. |
We're using this step in our gh actions and it failed due to the following error.
It looks like we're unauthenticated with docker when pulling the mongodb lib, and I can't see anything in this actions code/readme authenticating against docker. Plus we're only running a few actions a day (small company), so my assumption is that we hit a rate limit with a few other anonymous users.
Any thoughts on how to correct this?
Our config is the following:
The text was updated successfully, but these errors were encountered: