-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Improve Build Times #621
Comments
Context dump from a one-day investigation. At a high level there are a few major improvements we can make to improve the build:
Each of these major optimizations currently faces challenges. More ComputeGithub Actions does not allow increasing resource allocation for workflow runners. Reference. Custom runners are available, but have a security risk on public repositories like ours since forks could run arbitrary code. We could run each CI build in a Docker container on the self-hosted runner, but there are still security questions about the safety of those tasks, since CI runs would share caches. There's also the dev cost of self-hosting a runner. This is potentially doable, but is not low hanging fruit. An alternative is to use a managed CI platform like Circle CI that provides customizable resource allocations, plus some of the other optimizations mentioned here (e.g: CircleCI's performance plan supports caching docker layers out of the box). This would probably require using some sort of paid offering like a non-free plan. At stock pricing for the performance plan, CircleCI cost would not be trivial, potentially ~3-5k per year. Back of the envelope math here. Docker Layer cachinglayer caching is not supported by github out of the box. There exist premade actions like this one, but the latest version fails on our repo with the issue specified here. We could write & maintain custom logic to achieve this. We can also use a CI provider that supports this out of the box. Or we could host our own Docker cache. Gradle task output cachingMost of our build time is spent on building integrations, which consists of three parts: compiling the integration's source code & running unit tests (least time spent), building its docker image, and running integration tests against the image. Ideally we'd only build an integration if it or its dependencies have changed in the current commit. However, the gradle docker plugin we use cannot detect changes to a docker image's dependencies (e.g: a parent image specified with a We could patch around these shortcomings by manually specifying in each integration's |
Splllllllitting up the BuildLooking at the big picture here, if our goal is to add N integrations and N is a non trivial number, having a monobuild is not going to work regardless of how much tuning we do and how much firepower we throw at it. Even when N gets to 15, that's just going to hurt, and our goal is to get to much more than 15 really quickly. Perhaps we should focus on figuring out how we are going to split up our build pipeline. My initial naive suggestion would be the following:
Tradeoffs
|
@jrhizor and I discussed what we'd like to see out of out build system in the long term. Ideal State (Long Term)
I'm going to try to do the split integration tests piece now since I think it's super easy. We will look at fixing the incrementality stuff next week. |
Github action usage / parallelization limits: https://docs.github.com/en/free-pro-team@latest/actions/reference/usage-limits-billing-and-administration TestContainer's implementation of parallel jobs in github actions with gradle https://rnorth.org/faster-parallel-github-builds/ |
Our builds already run on custom runners today as of #3019. Work to split out builds were done here:
Run time of a typical build is 20 mins. |
@cgardens @sherifnada since most of the initial suggestions in the issue have been implemented, I'm thinking we can close this issue and open up more targeted follow up issues when needed. Thoughts? |
agreed! feel free to close once you feel any remaining relevant information has been captured in the right spots. |
Tell us about the problem you're trying to solve
Describe the solution you’d like
┆Issue is synchronized with this Asana task by Unito
The text was updated successfully, but these errors were encountered: