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] Optimize resource usage #693

Closed
johnkerl opened this issue Jan 11, 2023 · 5 comments
Closed

[ci] Optimize resource usage #693

johnkerl opened this issue Jan 11, 2023 · 5 comments
Assignees
Labels

Comments

@johnkerl
Copy link
Member

johnkerl commented Jan 11, 2023

As we've got more folks pushing code, and more OS/version combinations being tested, we're often hitting CI concurrency limits during the workday.

GitHub docs initially look optimistic in terms of how we can bump spending limits but it turns out it's a moot point for our use-case. Our number of minutes per month isn't the thing binding peak usage -- it's the number of concurrent jobs (at peak). The max number of MacOS concurrent runners is 5 in our current tier (Free) as well as for Pro and Team. Only for Enterprise level does it jump all the way to 50 and that's a bit of overkill.

Some things we can do though:

  • Do some kind of path-detection on modified files -- don't run Python CI on R commits or vice versa
  • Don't run the full matrix of OS and Python/R version on each PR push -- perhaps a subset on PR pushes, and the full set on merge to main
  • Can we build wheels less often? [ci/python] Don't build wheels on each PR push #697, but we should also add back in a way to run this nightly
@mlin
Copy link
Member

mlin commented Jan 12, 2023

Scribbling a random idea to speed up the python wheel builds: I think when building each python version x OS combo, it builds libtiledbsoma using the default CMake settings which ends up spending time building the unit test executable (and the Catch2 library supporting it). This is a waste because (in this context) we don't run those unit tests. We can turn that off. The only reason this change will probably take 30 minutes and not 2 is figuring out the right route to thread the flag from py-packaging.yml -> cibuildwheel -> apis/python/setup.py -> scripts/bld -> CMake.

@thetorpedodog
Copy link
Contributor

I feel like we should also be able to cache the builds of the tiledbsoma native library using GitHub caching (https://github.com/actions/cache) and avoid having to do them every time.

@thetorpedodog
Copy link
Contributor

I think #760 and #756 are the two most important pieces of this—pre-commit caching (#756) should drop 40ish seconds off that and binary caching (#760) will save entire minutes on changes where the binary doesn’t change. Between those, that should cut down runtime by 60% (and even more on Mac, where compilation takes far longer than on Linux).

@atolopko-czi
Copy link
Member

atolopko-czi commented Jan 19, 2023

I think #760 and #756 are the two most important pieces of this—pre-commit caching (#756) should drop 40ish seconds off that and binary caching (#760) will save entire minutes on changes where the binary doesn’t change. Between those, that should cut down runtime by 60% (and even more on Mac, where compilation takes far longer than on Linux).

Makes sense, approved both. (Saw the earlier comment on this, but didn't understand the size of the gain!).

Still worth incorporating the minimal-vs-full work on #750? We'll still use fewer GHA worker slots, which will allow more workflows overall to run in parallel, reducing contention amongst multiple (Python) develoers.

@johnkerl
Copy link
Member Author

#750 #756 #760 are all merged 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants