-
Notifications
You must be signed in to change notification settings - Fork 28
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
Restoring the cache takes longer than running docker pull #45
Comments
I'm glad you are measuring the effect of the action in your circumstance. I don't recommend caching 3 GB worth of images since even if it were faster in an individual instance, it would likely result in a great deal of cache eviction given that GitHub Actions has a cache limit of 10 GB. If you are able to, I would pull from the GitHub Container Registry instead of using this action as pulls from there are very fast (much the same as the raw download time from the cache without the subsequent My guess would be that there is a lot of overlap between those images, so Docker layer caching allows |
Closing this as a duplicate of #44 since the discussion there will likely interest anyone who reads this thread. |
Thanks to the hard work of @mwarres, version 0.2.3 filters out Docker images that are present when it is run, only caching those that are added after that step. Most significantly, this means that pre-cached images will no longer be cached. Pre-cached images are only accessible to the rootful Docker daemon, so rootless-docker users were never caching pre-cached images in the first place. The documentation will be updated accordingly, but generally users will simply experience a dramatic performance improvement both in terms of increased speed and reduced cache size upon upgrading. |
I just tried this and the numbers are not directly comparable with the initial numbers since the image has increased a few hundred megabytes in size, but the saved size is now ~1250 MB instead of ~3003 MB. The reduction in size has drastic effects on performance, |
@mwarres updated the documentation. Please let us know if you have any feedback. |
Unfortunately, even with the latest release I'm seeing cache restoration be about 25-30% slower than just downloading the 2GB worth of Docker images (10 images - Supabase's local environment). No issues with extra images being cached, it's just the 10 expected; the downloading + decompression is just significantly slower than just downloading the images. |
I actually view this as a good thing in the sense that it means you are achieving excellent pull performance, and the main remaining ways to improve on it would be to optimize the image sizes themselves, reduce dependencies, or self-host. Where are you pulling the images from? |
ECR, although I'm not specifically pulling them myself. I'm using the Supabase CLI and grabs the images from there automatically. I think you're right though, if I want to improve performance given these constraints, then I think I'll have have to self-host my runners (with the docker images pre-installed on the runner) 😞 |
Yeah, sorry docker-cache couldn't help you here. It sounds like Amazon Elastic Container Registry (ECR) may be an even faster option than GitHub Container Registry (GHCR) then. That's a good thing to note, particularly for those who control where their Docker images are hosted. I know some projects run up against Docker Hub's rate limits, so that is another use case for docker-cache in case that helps future readers of this thread. |
Edit: I know that the additional images were saved in the post action in the job that populated the cache, I do not know how they ended up in
docker image list
in that job.The log from a cache hit on contiki-ng/contiki-ng#1946 below.
Cache Size:
is printed after 25 seconds,tar
takes 59 seconds, anddocker load
takes 2 min and 14 seconds. The typical docker pull command without any cache takes less than 1 minute and 30 seconds.The CI has an explicit step to pull the right version of
contiker/contiki-ng
, and it's possible that brings along the Ubuntu 18.04 image which it is based on. I am not sure where the other images come from.The text was updated successfully, but these errors were encountered: