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

Investigate caching buildkit cache volume #5

Open
ingwarsw opened this issue May 31, 2022 · 7 comments
Open

Investigate caching buildkit cache volume #5

ingwarsw opened this issue May 31, 2022 · 7 comments

Comments

@ingwarsw
Copy link

After @kevinschoonover added caching in #2 maybe it would be possible to cache in GHA whole buildkit cache volume.

That should give huge speed boost cause it would work more/less as perfect case of advanced docker caching in earthly.
And speed of GH cache should be really good.

@alexcb alexcb changed the title How hard it would be to cache buildkit cache volume Investigate caching buildkit cache volume Feb 27, 2023
@shepherdjerred
Copy link

This would be nice to have. Long-term, I'd like to move over to one of Earthly's paid CI features (Satellites or Earthly CI), but I can't do that until I've convinced my team how great Earthly is :)

@theomessin
Copy link

theomessin commented Mar 17, 2023

I've made a little proof-of-concept for this using actions/cache here:
https://github.com/theomessin/example/blob/master/.github/workflows/push.yaml

I think it works great!

image

@shepherdjerred
Copy link

That looks great!!

Any idea how this interacts with GitHub's 10GB per-repo cache limit? If the volume is >10GB, will the entire cache be evicted, or just individual layers/files

@theomessin
Copy link

@shepherdjerred I'm pretty sure the entire cache would be evicted. However, I think that's okay, it's just a cache after all. I don't mind clearing the cache and re-running all steps every once in a while. Now if your earthly-cache is more than 10GB after running earthly once, I can't help you 😆

@alexcb
Copy link
Contributor

alexcb commented Mar 17, 2023

this looks cool!

I wonder if /var/lib/docker/volumes/earthly-cache could be backed without the use of a docker run? I've never looked into if it's possible.

@shepherdjerred
Copy link

shepherdjerred commented Mar 17, 2023

Now if your earthly-cache is more than 10GB after running earthly once, I can't help you 😆

The cache size is 10GB per repo, not workflow :/

Unfortunately, I think this would lead to a lot of evictions making the cache not very effective. The evictions might be tolerable if it's per layer, but if the entire volume is evicted then I think it'll just be wasted bandwidth, at least in my case.

Great work though! I'm sure this would be useful for many others.

@theomessin
Copy link

theomessin commented Mar 17, 2023

Unfortunately, I think this would lead to a lot of evictions making the cache not very effective. The evictions might be tolerable if it's per layer, but if the entire volume is evicted then I think it'll just be wasted bandwidth, at least in my case.

I've no idea how the earthly-cache is structured, but nothing's stopping us from saving multiple separate caches. I'll try to find some time to test this 😃

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

No branches or pull requests

4 participants