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

Investigate caching for github actions #324

Closed
dtebbs opened this issue Dec 3, 2020 · 6 comments
Closed

Investigate caching for github actions #324

dtebbs opened this issue Dec 3, 2020 · 6 comments
Assignees
Labels
build Task related to the compilation and execution of the project ci Task related to the Continuous Integration (configuration, service etc.) function:devops Tasks for the DevOps function optimization Optimization task

Comments

@dtebbs
Copy link
Contributor

dtebbs commented Dec 3, 2020

The barrier to running all tests (including those involving on-chain operations) is the time taken to build / install dependencies. #150

Docker may be one solution to this, but this presents issues when the content of the container must change. (To check the CI tests, one needs to invoke the CI to build the containers. Depending on versioning policies, this may affect the build of other branches, which breaks isolation.)

Investigate this as a solution for actions:
https://docs.github.com/en/free-pro-team@latest/actions/guides/caching-dependencies-to-speed-up-workflows

(Good first steps would be the solidity compiler on macos, grpc on linux, etc)

@AntoineRondelet AntoineRondelet added build Task related to the compilation and execution of the project ci Task related to the Continuous Integration (configuration, service etc.) optimization Optimization task labels Dec 3, 2020
@eastata eastata added the function:devops Tasks for the DevOps function label Dec 3, 2020
@Klazomenai Klazomenai added this to the DevOps Sprint 46 milestone Dec 17, 2020
@eastata
Copy link
Contributor

eastata commented Dec 17, 2020

GitHub will remove any cache entries that have not been accessed in over 7 days.
There is no limit on the number of caches you can store, but the total size of all caches in a repository is limited to 5 GB.

Research: https://dev.to/dtinth/caching-docker-builds-in-github-actions-which-approach-is-the-fastest-a-research-18ei

@dtebbs
Copy link
Contributor Author

dtebbs commented Dec 17, 2020

I see a few uses for this:

  • cache the submodule dependencies to improve the current build times (worth measuring again, but I think libsodium, libff, etc take up a significant proportion of the build time). Note that the current build times are approx 12m, so this part is not critical, but I think it makes a big difference to developmentn workflow if these can be shortened.
  • cache other dependencies, addressing issues that prevent us from just building all components and running integration tests:
    • grpc on linux
    • solidity compiler on mac
    • ... probably others

Integration tests in CI is a big goal.
Note, if we get the solidity compiler cached on mac, (for example), we could run integration tests at least on this platform. A massive improvement over the current situation.

@dtebbs
Copy link
Contributor Author

dtebbs commented Dec 17, 2020

For background: the solidity compiler is installed when setting up the client python project (by invoking the py-solc-x) package. It gets written to ~/.solcx/solc-vXXXX. On mac, there is no binary so a huge build gets invoked.

@dtebbs
Copy link
Contributor Author

dtebbs commented Dec 17, 2020

GitHub will remove any cache entries that have not been accessed in over 7 days.

This is good to know, @eastata .
I guess we may want something like a nightly build on develop to ensure we always have a reasonable set of dependencies cached.

@AntoineRondelet AntoineRondelet added function:devops Tasks for the DevOps function and removed function:devops Tasks for the DevOps function labels Feb 2, 2021
@AntoineRondelet
Copy link
Contributor

This ticket aims to be partially addressed in #326 which proposes modified workflows in which dependencies are cached to be used across jobs and fasten their execution time.

In the meantime, @eastata is looking into caching docker builds on GA, as well as migrating to ghcr.

@AntoineRondelet
Copy link
Contributor

Closing this issue now that #326 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Task related to the compilation and execution of the project ci Task related to the Continuous Integration (configuration, service etc.) function:devops Tasks for the DevOps function optimization Optimization task
Projects
None yet
Development

No branches or pull requests

4 participants