-
Notifications
You must be signed in to change notification settings - Fork 42
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
ci: explicit caching and even smaller runners #2518
Conversation
Co-authored-by: universalmind303 <[email protected]>
.github/workflows/ci.yaml
Outdated
name: build cache | ||
with: | ||
path: target/debug/glaredb | ||
key: ${{ github.run_id }} | ||
path: | | ||
target/ | ||
key: ${{ runner.os }}-cargo--target-${{github.sha}} |
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.
what is the purpose of this new cache? Hard time telling from the changes.
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.
There's sort of a stacked cache (looking at the build cache is really where this might become clear):
- cache toolchains based on the
rust-toolchain
file (restores before, saves after the build task. (changes rarely, used between different branches so we're not downloading big files - cache the user's
.cargo
directory based on the `Cargo.lock. (restores before and saves after the build task.) should prevent us from re-downloading dependencies. - cache the workspace except for the glaredb binary (restores before and after the build task only, keyed off of the Cargo.lock, hopefully with the effect of saving as much incremental build time as possible in a fairly stable way and preventing rebuilds/trigger.
- cache the
glaredb
binary explicitly (saves after the build task, restored before any task that runs SLTs or needs glaredb (pytests) keyed off the current run id. - save a second cache of
target
after the build task, restored before any task that needs to do on a build. key'd off the current commit.
Then we restore exactly what we need before the task that it runs.
This means we end up caching many more build-specific things and so the cache accelerates what we're doing in the task. and we don't end up thrashing the cache and rebuilding with different flags as much (e.g. unittests shouldn't thrash the build cache)
The "workspace cache" is maybe of questionable effect, but it seems pretty harmless.
In the penultimate build as of writing, we saw very good time: 15m wall clock, and 25m paid compute (this doesn't count the "free runners" which is about 40m per build, but that's fine). However, 1 of those wall-clock minutes was spent saving a per-run cache of the |
ok, final report:
caveats
future improvements/observations:
|
Co-authored-by: universalmind303 <[email protected]>
No description provided.