-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
GHA export cache fails with mode=max #2276
Comments
@chrispat Any idea what this means? |
I'm seeing this as well
|
Where are you seeing this issue exactly? Are you using the cache action or the API? |
Via API. The second error is from write/reserve/commit request. Not sure about the first one. Note that for more precise matching BuildKit stores individual cache blob for each filesystem layer. So more requests are expected than with the cache action. |
I think what you are hitting is request limits and some missing handling for the 429 error. There was a similar issue here satackey/action-docker-layer-caching#12. I think you would need to do some work to control how many concurrent requests you have going. |
As a first step would be good to know what the limits are. Then we could follow up if they maybe could be increased of we could add concurrency limits or retries from buildkit side. Reliable concurrency limits are tricky though as builds can happen from parallel jobs without seeing each other. |
Looks like there are reports of 429 from regular |
There's a throttling limit of approximately 150 cache creations every 5 minutes. Note though if a bunch of requests are sent within a very short time window, throttling could happen sooner. In the issue @chrispat linked, satackey/action-docker-layer-caching#12, the action was trying to create caches for 200+ Docker layers within about 0.1 seconds so it was getting throttled. That was due to unbound parallelism, but I'm not seeing that here. It looks like each layer is uploaded sequentially, correct? So this is perhaps a lot of small(er) caches being created within a short time period? It would be great if anyone could share the |
Yes, currently the upload is sequential but theoretically multiple builds can run at the same time. Bigger blobs are uploaded in chunks with concurrency 4 https://github.com/tonistiigi/go-actions-cache/blob/master/cache.go#L25 . I guess these requests don't count for this limit? Otherwise we need to stop uploading in chunks to use fewer requests.
|
@dhadka @tonistiigi https://github.com/nginxinc/kubernetes-ingress but we've disabled caching for now since we were having a lot of other issues too like #2325 and docker/buildx#681 |
@lucacome Thanks! I'll take an in-depth look tomorrow, but it certainly seems like the multiple build jobs targeting different OS'es + each job creating multiple caches is hitting the throttling limits. @tonistiigi Is there a separate issue here with how the client is handling the response from the cache server? Specifically with the |
@dhadka given each job has its own token, shouldn't they have independent limits? |
Yes, not sure what though. Looks like error fails to parse as json but it does look like valid json after printing. Wonder if it may be something with encoding, maybe with edit: Oh, that's not |
🤦♂️ Oof...I'll file an issue with our platform team to take a look at why that BOM is showing up. I think it's because exceptions undergo some additional processing that's converting it to a string with |
fixed the bom part in tonistiigi/go-actions-cache#6 in our side |
@tonistiigi Thank you! I've also filed an issue on our side to not emit the BOM (since that technically violates the RFC spec for JSON), but would have also recommended handling this on the client side as the turnaround for lower priority issues could take some time. I've also started the conversation internally to relax the throttling limits. |
There seems to be an issue currently where concurrent builds cause the Docker GHA cache exporter to trip over GitHub throttling limits. Background reading: - buildx failed with: error: failed to solve: blob not found #422 docker/build-push-action#422 - Copy from previous stage fails #681 docker/buildx#681 - GHA export cache fails with mode=max #2276 moby/buildkit#2276 Try to work around this by limiting the overall concurrency to 1 for this workflow.
There seems to be an issue currently where concurrent builds cause the Docker GHA cache exporter to trip over GitHub throttling limits. Background reading: - buildx failed with: error: failed to solve: blob not found #422 docker/build-push-action#422 - Copy from previous stage fails #681 docker/buildx#681 - GHA export cache fails with mode=max #2276 moby/buildkit#2276 Try to work around this by limiting the overall concurrency to 1 for this workflow.
There seems to be an issue currently where concurrent builds cause the Docker GHA cache exporter to trip over GitHub throttling limits. Background reading: - buildx failed with: error: failed to solve: blob not found #422 docker/build-push-action#422 - Copy from previous stage fails #681 docker/buildx#681 - GHA export cache fails with mode=max #2276 moby/buildkit#2276 Try to work around this by limiting the overall concurrency to 1 for this workflow.
There seems to be an issue currently where concurrent builds cause the Docker GHA cache exporter to trip over GitHub throttling limits. Background reading: - buildx failed with: error: failed to solve: blob not found #422 docker/build-push-action#422 - Copy from previous stage fails #681 docker/buildx#681 - GHA export cache fails with mode=max #2276 moby/buildkit#2276 Try to work around this by limiting the overall concurrency to 1 for this workflow.
There seems to be an issue currently where concurrent builds cause the Docker GHA cache exporter to trip over GitHub throttling limits. Background reading: - buildx failed with: error: failed to solve: blob not found #422 docker/build-push-action#422 - Copy from previous stage fails #681 docker/buildx#681 - GHA export cache fails with mode=max #2276 moby/buildkit#2276 Try to work around this by limiting the overall concurrency to 1 for this workflow.
Buildkit builds expose custom cache exporters which can be used to locally speed up builds on Github Actions. The gha cacher will use the Github Actions cache api instead of the remote registry for caching. To enable this, set the following two environment variables. ``` DOCKER_BUILDKIT=1 BUILDKIT_CACHE_EXPORTER=gha ``` Note that the cache mode is set to min by default (no value == min) due to a potential timeout issue within the exporter. See moby/buildkit#2276 for details. To switch the cache mode, set the following environment variable: ``` BUILDKIT_CACHE_MODE=max ```
Buildkit builds expose custom cache exporters which can be used to locally speed up builds on Github Actions. The gha cacher will use the Github Actions cache api instead of the remote registry for caching. To enable this, set the following two environment variables. ``` DOCKER_BUILDKIT=1 BUILDKIT_CACHE_EXPORTER=gha ``` Note that the cache mode is set to min by default (no value == min) due to a potential timeout issue within the exporter. See moby/buildkit#2276 for details. To switch the cache mode, set the following environment variable: ``` BUILDKIT_CACHE_MODE=max ```
Buildkit builds expose custom cache exporters which can be used to locally speed up builds on Github Actions. The gha cacher will use the Github Actions cache api instead of the remote registry for caching. To enable this, set the following two environment variables. ``` DOCKER_BUILDKIT=1 BUILDKIT_CACHE_EXPORTER=gha ``` Note that the cache mode is set to min by default (no value == min) due to a potential timeout issue within the exporter. See moby/buildkit#2276 for details. To switch the cache mode, set the following environment variable: ``` BUILDKIT_CACHE_MODE=max ```
With
mode=max
, export cache fails due to some blocking on the GitHub side (I assume?).This is with buildkit 0.9.0
/cc @crazy-max
The text was updated successfully, but these errors were encountered: