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

Only limit concurrency while building RPMs #3343

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

cbgbt
Copy link
Contributor

@cbgbt cbgbt commented Aug 12, 2023

Description of changes:
cargo make build-variant and build-package typically run several RPM builds concurrently, and those allow for their own levels of parallelism. 8 concurrent jobs (though unscientifically decided) still seems like a reasonable limitation there.

On the other hand, the rest of the build commands mostly focus on building a directory of rust sources. It shouldn't be a problem to let cargo use as many cores as it needs for those.

Testing done:
This seems to make cargo make tuftool and cargo make publish-setup faster when you don't have any of their dependencies' builds cached.

On my (admittedly beefy) machine:

Without change:

  • cargo make tuftool 152 seconds
  • cargo make publish-setup-tools 60 seconds

With change:

  • cargo make tuftool 131 seconds
  • cargo make publish-setup-tools 38.72 seconds

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@bcressey
Copy link
Contributor

On the other hand, the rest of the build commands are either focused on a single RPM, or on a directory of rust sources. It shouldn't be a problem to let cargo use as many cores as it needs.

I still think it makes sense to limit concurrency for build-package - building certain RPMs (glibc, util-linux) can drive a lot of subsequent rebuilds.

@cbgbt cbgbt changed the title Only limit concurrency in cargo make build-variant Only limit concurrency in while building RPMs Aug 14, 2023
cargo make build-variant and build-package typically run several RPM
builds concurrently, and those allow for their own levels of
parallelism. Leaving this unrestricted would very easily lead to
context switching overhead.

On the other hand, the rest of the build commands are mostly focused
on building a directory of rust sources. It shouldn't be a problem to
let cargo use as many cores as it needs for those.
@cbgbt
Copy link
Contributor Author

cbgbt commented Aug 14, 2023

  • Kept the limitation on cargo make build-package
  • Fixed the commit message

@cbgbt cbgbt merged commit d7934ba into bottlerocket-os:develop Aug 14, 2023
42 checks passed
@cbgbt cbgbt deleted the unleash-the-builds branch August 14, 2023 20:21
@cbgbt cbgbt changed the title Only limit concurrency in while building RPMs Only limit concurrency while building RPMs Aug 14, 2023
@bcressey bcressey mentioned this pull request Aug 17, 2023
5 tasks
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.

None yet

5 participants