Why Nx Cloud?

If CI feels challenging to you, it might not be your fault. It's a fundamental issue with how the current, traditional CI execution model works. Nx Cloud adopts a new task-based CI model which allows you to overcome both the slowness and unreliability of the current VM-based CI model. (Dive deeper into the task based CI execution model in this blog post)

Nx Cloud addresses critical aspects of CI/CD, including:

  • speed - 30% - 70% faster CI (based on reports from our clients)
  • cost - 40% - 75% reduction in CI costs (observed on the Nx OSS monorepo)
  • reliability - by automatically identifying flaky tasks (e2e tests in particular) and re-running them

How?

Nx Cloud follows a task-based CI model which is not just fast but also robust. Instead of statically assigning work to machines (as in a traditional CI model), you can imagine a pile of tasks which get picked up automatically by agents on the Nx Cloud infrastructure. There's no static assignment, agents coordinate the work by themselves. If an agent fails during the setup phase, other agents will pick up its work. If more work needs to be done, more agents will be started to still guarantee a fast execution, if less work is needed, fewer agents will be started to save resources.

All this is possible because Nx Cloud directly integrates with Nx and has knowledge about the project structure and tasks as well as dependencies among them.

Read more about individual features of Nx Cloud in the features section.

How does Nx Cloud integrate into my existing CI setup

Nx Cloud directly integrates with your existing CI setup.

Nx Cloud Overview

In a nutshell, here's how this works:

Step 1: Connect your workspace to Nx Cloud

This can be done by signing up on nx.app and then connecting to your git repository. Read more about all the details on this doc page.

Step 2: Your CI script triggers Nx Cloud

1- name: Start CI run 2 run: 'npx nx-cloud start-ci-run --distribute-on="8 linux-medium-js"' 3

Check out our recipes for the various CI providers.

Step 3: Run your Nx command as usual

1- run: npx nx-cloud record -- nx format:check 2- run: npx nx affected -t lint test build e2e-ci 3

All these commands are automatically picked up by Nx Cloud, split up into smaller tasks and distributed across the specified number of machines.

Step 4: All results are played back automatically

Nx Cloud automatically plays back all results to your CI system, as if distribution never happened. You can continue doing post-processing on the results, like uploading test reports, deploying artifacts etc.

Learn more