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

Add caching to CI operations #1696

Merged
merged 31 commits into from
Oct 11, 2021
Merged

Add caching to CI operations #1696

merged 31 commits into from
Oct 11, 2021

Conversation

jonastheis
Copy link
Contributor

@jonastheis jonastheis commented Sep 17, 2021

Description of change

This PR improves runtimes of our CI workflows for unit tests and integration tests by leveraging Github Actions Cache.

  • unit tests: cache Go modules and build cache
  • integration tests
    • cache Go modules and build cache for tester container
    • reuse Go buster image that is also used for building GoShimmer
    • remove "pulling additional images" step where not necessary

Note: Loading the same cache on multiple jobs in the same workflow causes some issues because the first runner will create the cache and following runners will get a cache hit. However, as long as the first runner did not yet finish its execution the cache will be empty. That's why I opted for an approach to always fall back to another cache with restore-keys. This might lead to very frequent cache eviction from Github because of the 5GB max cache size. I guess we have to see how it goes in general.

Note 2: experiments showed that caching the Docker image layers with Buildkit is not really worth it as long as exporting the internal Buildkit cache can't be exported. Importing/exporting the cache + rebuilding the binary is simply more expensive than just rebuilding the full image from scratch (see here for more information).

Runtime integration tests with caching of integration tests (tester Go dependencies and build cache) (left) vs without caching (right)
imageimage

Runtime unit tests with caching of Go modules and build cache (left) vs without caching (right)
imageimage

Fixes #1689

Type of change

  • Enhancement (a non-breaking change which adds functionality)

@jonastheis jonastheis marked this pull request as ready for review September 22, 2021 11:43
@johanneskeim
Copy link

Looks good!

@georgysavva
Copy link
Contributor

BTW, are we done with the elimination of large time.Sleep() in integration tests? I guess it should give a much greater performance increase.

@jonastheis jonastheis merged commit 1d816f6 into develop Oct 11, 2021
@jonastheis jonastheis deleted the feat/ci-caching branch October 11, 2021 09:03
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.

Optimize CI builds / Speed up integration tests
4 participants