docs(core): add docs for parallelism (#26950)
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> ## Current Behavior <!-- This is the behavior we have today --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
This commit is contained in:
parent
8cf69c4b9a
commit
627504d8d3
@ -200,6 +200,26 @@ If you are using distributed task execution and disable caching for a given targ
|
||||
|
||||
{% /callout %}
|
||||
|
||||
### Parallelism
|
||||
|
||||
In Nx 19.5.0+, tasks can be configured to support parallelism or not. By default, tasks are run in parallel with other tasks on a given machine. However, in some cases, tasks can require a shared resource such as a port or memory. For these cases, setting `"parallelism": false`, will ensure that those tasks will not run in parallel with other tasks on a single machine. For example, if the `e2e` tasks all require port 4200, running them in parallel will conflict so the targets can specify to not support parallelism:
|
||||
|
||||
```json {% fileName="project.json" %}
|
||||
{
|
||||
"targets": {
|
||||
"e2e": {
|
||||
"parallelism": false
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% callout type="warning" title="Note: Parallelism is only per machine" %}
|
||||
|
||||
If you are using distributed task execution, tasks will still be run simultaneously on different machines. Because different agents do not share resources with one another, it is perfectly fine for multiple agents to run tasks which do not support parallelism at the same time. Therefore, using Nx Agents is key to running tasks which do not support parallelism quickly and efficiently.
|
||||
|
||||
{% /callout %}
|
||||
|
||||
### Inputs and Named Inputs
|
||||
|
||||
Each cacheable task needs to define `inputs` which determine whether the task outputs can be retrieved from the cache or the task needs to be re-run. The `namedInputs` defined in `nx.json` or project level configuration are sets of reusable input definitions.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user