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

docs(misc): lower concurrency to 3 in the docs #27013

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/blog/2024-03-21-reliable-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Nx Cloud introduces an entirely different model. Instead of the graph of VMs, th
By adding the following line…

```shell
npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js"
npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js"
```

... you are telling Nx Cloud to create five Nx Agents to execute all the tasks from all the commands that will follow.
Expand Down
2 changes: 1 addition & 1 deletion docs/nx-cloud/reference/nx-cloud-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Tells Nx Cloud how many agents to use (and what launch templates to use) to dist
using the `linux-medium-js` launch template.

You can use different types of launch templates as follows:
`npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js, 3 linux-large-js"`.
`npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js, 3 linux-large-js"`.

You can also define the configuration in a file and reference it as follows:
`npx nx-cloud start-ci-run --distribute-on=".nx/workflows/dynamic-changesets.yaml"`.
Expand Down
6 changes: 3 additions & 3 deletions docs/nx-cloud/tutorial/circle.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
# - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"

- run: pnpm install --frozen-lockfile
- nx/set-shas:
Expand Down Expand Up @@ -233,12 +233,12 @@ To enable Nx Agents, make sure the following line is uncommented in the `.circle
```yml {% fileName=".circleci/config.yml" highlightLines=[3] %}
# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
```

We recommend you add this line right after you check out the repo, before installing node modules.

- `nx-cloud start-ci-run --distribute-on="5 linux-medium-js` lets Nx know that all the tasks after this line should using Nx Agents and that Nx Cloud should use 5 instances of the `linux-medium-js` launch template. See the separate reference on how to [configure a custom launch template](/ci/reference/launch-templates).
- `nx-cloud start-ci-run --distribute-on="3 linux-medium-js` lets Nx know that all the tasks after this line should using Nx Agents and that Nx Cloud should use 5 instances of the `linux-medium-js` launch template. See the separate reference on how to [configure a custom launch template](/ci/reference/launch-templates).
- `--stop-agents-after="e2e-ci"` lets Nx Cloud know which line is the last command in this pipeline. Once there are no more e2e tasks for an agent to run, Nx Cloud will automatically shut them down. This way you're not wasting money on idle agents while a particularly long e2e task is running on a single agent.

Try it out by creating a new PR with the above changes.
Expand Down
4 changes: 2 additions & 2 deletions docs/nx-cloud/tutorial/github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ To enable Nx Agents, make sure the following line is uncommented in the `.github
```yml {% fileName=".github/workflows/ci.yml" highlightLines=[3] %}
# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
- run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
```

We recommend you add this line right after you check out the repo, before installing node modules.

- `nx-cloud start-ci-run --distribute-on="5 linux-medium-js` lets Nx know that all the tasks after this line should using Nx Agents and that Nx Cloud should use 5 instances of the `linux-medium-js` launch template. See the separate reference on how to [configure a custom launch template](/ci/reference/launch-templates).
- `nx-cloud start-ci-run --distribute-on="3 linux-medium-js` lets Nx know that all the tasks after this line should using Nx Agents and that Nx Cloud should use 5 instances of the `linux-medium-js` launch template. See the separate reference on how to [configure a custom launch template](/ci/reference/launch-templates).
- `--stop-agents-after="e2e-ci"` lets Nx Cloud know which line is the last command in this pipeline. Once there are no more e2e tasks for an agent to run, Nx Cloud will automatically shut them down. This way you're not wasting money on idle agents while a particularly long e2e task is running on a single agent.

Try it out by creating a new PR with the above changes.
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/monorepo-ci-azure.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# Connect your workspace on nx.app and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - script: yarn nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
# - script: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"

- script: yarn install --frozen-lockfile
- script: git branch --track main origin/main
Expand Down
4 changes: 2 additions & 2 deletions docs/shared/monorepo-ci-bitbucket-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pipelines:
script:
# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
- npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
- npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- npm ci

- npx nx-cloud record -- nx format:check
Expand All @@ -30,7 +30,7 @@ pipelines:
- export NX_BRANCH=$BITBUCKET_BRANCH
# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
# - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- npm ci

- npx nx-cloud record -- nx format:check
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/monorepo-ci-circle-ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- checkout
# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
# - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- run: npm ci

- nx/set-shas
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/monorepo-ci-github-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
cache: 'npm'
# This line enables distribution
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
# - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"
- run: npm ci

- uses: nrwl/nx-set-shas@v4
Expand Down
2 changes: 1 addition & 1 deletion docs/shared/monorepo-ci-gitlab.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ main:
script:
# Connect your workspace on <%= nxCloudHost %> and uncomment this to enable task distribution.
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
# - npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="e2e-ci"
# - npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci"

- npm ci --cache .npm --prefer-offline
- NX_HEAD=$CI_COMMIT_SHA
Expand Down
4 changes: 2 additions & 2 deletions docs/shared/monorepo-ci-jenkins.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pipeline {
steps {
// This line enables distribution
// The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
// sh "npx nx-cloud start-ci-run --distribute-on='5 linux-medium-js' --stop-agents-after='e2e-ci'"
// sh "npx nx-cloud start-ci-run --distribute-on='3 linux-medium-js' --stop-agents-after='e2e-ci'"
sh "npm ci"
sh "npx nx-cloud record -- nx format:check"
sh "npx nx affected --base=HEAD~1 -t lint test build e2e-ci"
Expand All @@ -33,7 +33,7 @@ pipeline {
steps {
// This line enables distribution
// The "--stop-agents-after" is optional, but allows idle agents to shut down once the "e2e-ci" targets have been requested
// sh "npx nx-cloud start-ci-run --distribute-on='5 linux-medium-js' --stop-agents-after='e2e-ci'"
// sh "npx nx-cloud start-ci-run --distribute-on='3 linux-medium-js' --stop-agents-after='e2e-ci'"
sh "npm ci"
sh "npx nx-cloud record -- nx format:check"
sh "npx nx affected --base origin/${env.CHANGE_TARGET} -t lint test build e2e-ci"
Expand Down