-
Notifications
You must be signed in to change notification settings - Fork 67
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
modular build
builds in concurrent batches
#2341
Conversation
🦋 Changeset detectedLatest commit: 8ef5627 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
modular build
builds in concurrent batches
const concurrency = parseInt(concurrencyLevel, 10); | ||
|
||
// If not a number or a negative number, bail out with an error. | ||
if (isNaN(concurrency) || concurrency < 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if someone provides a big number? Let's say they typo a couple zeros on the end and put 600
. Is this fine or do we need an upper boundary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if someone provides a big number? Let's say they typo a couple zeros on the end and put
600
. Is this fine or do we need an upper boundary?
It's fine, because:
- in practice, the number of things a project can build concurrently at a given stage will be much less than 600 (even if the project has 600 packages, they will be probably interdependent and generate a number of smaller concurrent subsets)
- the worst that can happen is that Modular is slow or goes out of memory, in which case the user can just rectify their command
Enables batched algorithms for
modular build
with a custom max concurrency level. Build jobs that can be parallelised are executed in consecutive--concurrencyLevel
-long job parallel batches, that are run one after the other until exhaustion.--concurrencyLevel
level is a new user option that defaults to the number of logical CPUS in the machine.This also fixes a bug in
modular select
where the parallel dependency array can sometimes have holes.