-
Notifications
You must be signed in to change notification settings - Fork 10
Update cache every run. Add /compiled
and /logs
. Make key sensitive to matrix.
#71
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
Update cache every run. Add /compiled
and /logs
. Make key sensitive to matrix.
#71
Conversation
2faa182
to
c248245
Compare
c248245
to
254b4e9
Compare
Update README.md
254b4e9
to
4f8a82a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice. Makes sense to me. The cache deletion logic looks a bit like a "hack", but it makes sense to me. For Javascript libraries, not updating the cache should be fine for small dependency changes. However, for Julia small dependency changes can outdate almost all compiled artifacts, so that's probably why forcing a new cache each time makes sense here?
One question regarding the cache delete logic. Isn't the most recent cache also deleted? EDIT: Found it. The caches are deleted post job and then the new one is stored. Very nice.
No, the cache deletion step happens just before the cache/save step. The way post jobs are queued is a little confusing. |
Co-authored-by: Rik Huijzer <github@huijzer.xyz>
Co-authored-by: Rik Huijzer <github@huijzer.xyz>
Ideally we'd only save if there were changes in the depot, but in practice that will be true every run because of the usage logs being updated. And usage logs allow us to do auto Pkg.gc It kind of puts the decision on how to manage the depot in Julia's hands, which I think makes sense. |
Reminder to myself. We might want to add an input to turn off cache deletion. (Done) |
If you're able to review @SaschaMann let me know, otherwise I'll merge and release this as v1.4.0 tomorrow. (or let me know if you want more time) |
23031dc
to
959b929
Compare
959b929
to
e728574
Compare
I've done some tidying. @rikhuijzer would you mind taking one last look before I merge? This is in the context of it being a non-breaking release |
Ok, some tweaks:
|
339d9cd
to
f1e50dc
Compare
1f61106
to
4252ef7
Compare
fdf6e92
to
7b44740
Compare
7b44740
to
5a848dd
Compare
ugh.. turns out you can just So that avoids the need for I'll go ahead and merge, and release tomorrow as 1.4.0 unless I hear otherwise. |
Alternative to #45
Closes #11
Fixes #46
This keeps the depot in one cache file for the given key, which is sensitive to
julia version, OS and arch (for the usual matrix var names, and there's a note if not).all matrix vars and the runner.OS.It also re-saves the cache every run, removing the previous cache that was used.
By including
/logs
it also enables automaticPkg.gc()
to keep the depot size down, given that the depot will be restored>used>saved>restored>used>saved.. sequentially through the runs.Regarding the split strategy in #45 , while there are some elements of the depot that are cross-OS compatible (
/packages
,/registries
), for precompilation to remain hot, and for automaticPkg.gc()
to work properly, I think the depot should be cached in lock-step as a whole.To implement this, because neither Github or
actions/cache
expose a way to update a cache file at a key, we have to run our own deletion just before theactions/cache
save post step. So for a given key, there will only ever be one cache retained. This reduces the chance of the automatic eviction github does evicting a useful cache over an less useful one.Demo
You can see it in action here JuliaIO/PNGFiles.jl#72
Tests have been disabled, so it's just installation and loading.
First commit was with no cache files in the repo.
Second empty commit benefitted from the caching.
On linux 1.11 goes from 2 minutes to 40s
Cache sizes are all around 30 MB.
And there will only ever be the same number as the permutations of the matrix, so 15 in that repo, which is a common number.
I will note that it seems there's been a sizeable regression in precompile duration in master recently. Needs investigating.
How to release
It'd be nice to get this widely adopted, so I'm intrigued about releasing this as a minor change.
There's no breakage to the API, except for changes to defaults.