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

Improve the caching of LFS objects to reduce the bandwith usage. #56

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

verwoerd
Copy link
Contributor

@verwoerd verwoerd commented Apr 4, 2024

Might resolve #55.

Copy link
Contributor

@mpsijm mpsijm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to me like this would work, based on https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key 🙂 Just reiterating the example in the docs to make sure I understand it correctly: when the cache key does not match (i.e. when files get added/removed, because the key is generated based on the hash of the sorted list of LFS assets), the restore-keys: property will restore the latest version of any cache matching the prefix, which should™ be the last version before the current commit on the current branch (or the default branch, if it is the first commit of a branch).

And with the second commit of this branch, it appears like this works, when I look at the GitHub action log 😄 (The fact that git lfs pull has no output does not say much, because it also didn't have output when running on the first commit of this branch, but the fact that it downloads the cache should be enough 🙂 Also, the Git LFS Pull action now ran in 17s with the cache instead of 37s without the cache, which is still not as fast I would expect, but fast enough, I hope? 😛)

image

@maartenweyns Systems Maarten, do you want to double-check? 🙂

@verwoerd
Copy link
Contributor Author

verwoerd commented Apr 5, 2024

It seems to me, looking at the timing of the 3 builds that his will solve the cache misses if lfs assets are added.

@maartenweyns
Copy link
Member

Looks indeed like this should at least fix the bandwidth for the workflow. Nicely done!

@mpsijm mpsijm merged commit ff13af9 into main Apr 5, 2024
1 check passed
@mpsijm mpsijm deleted the better-lfs-caching branch April 5, 2024 08:48
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

Successfully merging this pull request may close these issues.

Potentially move away from git LFS
3 participants