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

ci(caching): make caching more effective #3215

Merged
merged 6 commits into from
Dec 13, 2022
Merged

ci(caching): make caching more effective #3215

merged 6 commits into from
Dec 13, 2022

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Dec 9, 2022

Description

Currently, we create a new cache for each workflow run for each crate. That ends up blowing the maximum allowed cache size of 10GB and GitHub deletes the least-recently used cache again. Effectively, this means we don't have any caching.

This patch introduces a cache factory workflow that only runs on master and always saves a new cache. The CI workflow run for pull-requests on the other hand only restore these caches but don't save them.

Notes

Here is an example of a cache factory run: https://github.com/thomaseizinger/rust-libp2p/actions/runs/3672495214

With the new configuration, the libp2p-core job finishes in about 5 minutes: https://github.com/thomaseizinger/rust-libp2p/actions/runs/3672680646/jobs/6209084632.
With the old configuration, the same job takes about 13 minutes: https://github.com/libp2p/rust-libp2p/actions/runs/3651158690/jobs/6168039236

A good chunk of those 5 minutes is still used up by cargo semver-checks which will hopefully improve further but overall, these are already massive savings in computing time :)

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@thomaseizinger thomaseizinger changed the title ci(caching): introduce cache factory workflow ci(caching): make caching more effective Dec 9, 2022
@thomaseizinger thomaseizinger marked this pull request as ready for review December 12, 2022 04:53
Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

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

Thanks. Looking forward to the improved CI runtime.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@mergify mergify bot merged commit 5fe0dc4 into master Dec 13, 2022
jxs pushed a commit to jxs/rust-libp2p that referenced this pull request Dec 14, 2022
Currently, we create a new cache for each workflow run for each crate. That ends up blowing the maximum allowed cache size of 10GB and GitHub deletes the least-recently used cache again. Effectively, this means we don't have any caching.

This patch introduces a cache factory workflow that only runs on master and always _saves_ a new cache. The CI workflow run for pull-requests on the other hand only restore these caches but don't save them.
@thomaseizinger thomaseizinger deleted the cache-factory branch February 24, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants