Distributed Task Execution
Before reading this guide, check out the mental model guide. It will help you understand how computation caching fits into the rest of Nx.
Nx supports running commands across multiple machines. You can either set it up by hand ( see here) or use Nx Cloud.
When using the distributed task execution, Nx is able to run any task graph on many agents instead of locally.
nx affected --build won't run the build locally (which can take hours for large workspaces). Instead,
it will send the Task Graph to Nx Cloud. Nx Cloud Agents will then pick up the tasks they can run and execute them.
Note that this happens transparently. If an agent builds
app1, it will fetch the outputs for
lib if it doesn't have them
As agents complete tasks, the main job where you invoked
nx affected --build will start receiving created files and
nx affected --build completes, the machine will have the build files and all the terminal outputs as if it ran
- This is an example repo showing how easy it is to set up distributed task execution, showing the performance gains, and comparing to sharding/binnig.