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

fix: Further improve CI runtime performance #412

Open
c12i opened this issue Nov 6, 2024 · 2 comments
Open

fix: Further improve CI runtime performance #412

c12i opened this issue Nov 6, 2024 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@c12i
Copy link
Collaborator

c12i commented Nov 6, 2024

The CI pipeline is experiencing significant slowdown when using Holonix, specifically:

  • Initial environment setup takes considerable time
  • Repeated operations across different jobs may be redundant
  • Cache utilization might not be optimal
@ThetaSinner
Copy link
Member

Suggestions for how to speed up the build:

  • You should check whether crane is correctly caching the dependencies build. If you build the package, then change the code but not the Cargo.toml or the lock file, does it rebuild everything or just your code? If it rebuilds everything then take a look at the crane docs and make split the build into two steps.
  • Once you start building Nix packages as part of the build, you need to set up your own cachix cache. Take a look at Wind Tunnel as an example. Or just the cachix build action docs.
  • Only build the scaffolding once. You're depending on the CI shell which requires the scaffolding package. Build that once and push it to cachix then subsequent build jobs should be set to "needs" the step that's building the scaffolding package. That way they'll download it rather than rebuilding it. If you look at the build log timestamps, it's spending 1 minute downloading binaries and then ~15 minutes building the scaffolding.
  • Add a Rust cache. For the build steps happening outside of Nix (just in the Nix shell, rather than a derivation), like the clippy and test, you can probably get a significant speed boost by adding something like the swatinem cache. We have that in several projects, so there are examples of how to use that.

Scaffolding depending on Holochain makes it quite slow to compile. It's a lot slower to build than Holochain, so I don't know if there is some dependency or configuration that we can tweak to speed up the compile times for scaffolding. It'd be worth looking into. But at least like this you can minimize the compiler work done to test,

@c12i
Copy link
Collaborator Author

c12i commented Nov 6, 2024

Scaffolding depending on Holochain makes it quite slow to compile.

Yes this has been an issue I have tried to address by replacing the test_utils feature with hdk. Also replaced some holochain imports with holochain_types and removed the holochain_utils dependency entirely since it wasn't getting used as much. Still not enough it seems.

I think the dependency to holochain can be further stripped down. This the only part of the code that relies on an import from holochain, I think this is an essential import though since it's easier to rely on holochain to get the respective hdk and hdi versions without depending on them directly or hard coding the versions. Not sure whether these imports could be moved to holochain_types maybe?

Regarding the other suggestions you have provided. I will look into them and see how they can help

@c12i c12i self-assigned this Nov 7, 2024
@c12i c12i added the enhancement New feature or request label Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In progress
Development

No branches or pull requests

2 participants