Skip to content

Commit c1f068e

Browse files
committed
chore(repo): disable parallelism for nx-dev:build-base and separate it from test tasks (#28887)
<!-- 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 --> Running `nx-dev:build-base` takes a lot of memory and particularly if it is run after `test` tasks, it will cause agents to run out of memory. ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> I don't have a fix for the task taking up a lot of memory... but I do have a fix which will alleviate the issue. I've split up `test` tasks and `nx-dev:build-base` to run on different agents. We should still look into how to make this task not take up so much memory. What I've learned is that prerendering pages for `nx-dev` has a memory leak so we should investigate what during prerendering a page is not cleaned up properly. ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes # (cherry picked from commit 538a4f2)
1 parent 622c2ea commit c1f068e

File tree

5 files changed

+69
-5
lines changed

5 files changed

+69
-5
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ jobs:
9393
- checkout
9494
- nx/set-shas:
9595
main-branch-name: 'master'
96-
- run: npx nx-cloud@next start-ci-run --distribute-on="auto linux-medium" --stop-agents-after="e2e"
96+
- run: npx nx-cloud@next start-ci-run --distribute-on="./.nx/workflows/dynamic-changesets.yaml" --stop-agents-after="e2e"
9797
- run:
9898
command: |
9999
sudo apt-get update

.nx/workflows/agents.yaml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,60 @@ launch-templates:
5656

5757
- name: Install zip and unzip
5858
script: sudo apt-get -yqq install zip unzip
59+
linux-large:
60+
resource-class: 'docker_linux_amd64/large'
61+
image: 'ubuntu22.04-node20.11-v10'
62+
env:
63+
GIT_AUTHOR_EMAIL: [email protected]
64+
GIT_AUTHOR_NAME: Test
65+
GIT_COMMITTER_EMAIL: [email protected]
66+
GIT_COMMITTER_NAME: Test
67+
SELECTED_PM: 'pnpm'
68+
NPM_CONFIG_PREFIX: '/home/workflows/.npm-global'
69+
NX_NATIVE_LOGGING: 'nx::native::db'
70+
init-steps:
71+
- name: Checkout
72+
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/checkout/main.yaml'
73+
- name: Cache restore
74+
uses: 'nrwl/nx-cloud-workflows/v4/workflow-steps/cache/main.yaml'
75+
inputs:
76+
key: 'pnpm-lock.yaml'
77+
paths: |
78+
node_modules
79+
~/.cache/Cypress
80+
~/.cache/ms-playwright
81+
~/.pnpm-store
82+
base_branch: 'master'
83+
- name: Install e2e deps
84+
script: |
85+
sudo apt-get update
86+
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
87+
- name: Install Pnpm
88+
script: |
89+
npm install -g [email protected]
90+
91+
- name: Pnpm Install
92+
script: |
93+
pnpm install --frozen-lockfile
94+
95+
- name: Install Browsers
96+
script: |
97+
pnpm exec cypress install
98+
pnpm exec playwright install
99+
100+
- name: Install Rust
101+
script: |
102+
curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y
103+
source "$HOME/.cargo/env"
104+
rustup toolchain install 1.70.0
105+
106+
- name: Configure git metadata (needed for lerna smoke tests)
107+
script: |
108+
git config --global user.email [email protected]
109+
git config --global user.name "Test Test"
110+
111+
- name: Load Cargo Env
112+
script: echo "PATH=$HOME/.cargo/bin:$PATH" >> $NX_CLOUD_ENV
113+
114+
- name: Install zip and unzip
115+
script: sudo apt-get -yqq install zip unzip

.nx/workflows/dynamic-changesets.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
distribute-on:
2-
small-changeset: 8 linux-medium
3-
medium-changeset: 10 linux-medium
4-
large-changeset: 12 linux-medium
2+
default: auto linux-medium, 1 linux-large
3+
assignment-rules:
4+
- project: nx-dev
5+
target: build-base
6+
runs-on:
7+
- linux-large
8+
- target: test
9+
runs-on:
10+
- linux-medium

nx-dev/nx-dev/project.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
}
4242
},
4343
"build-base": {
44+
"parallelism": false,
4445
"executor": "@nx/next:build",
4546
"dependsOn": ["copy-docs"],
4647
"outputs": ["{options.outputPath}"],

nx.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
"nxCloudUrl": "https://staging.nx.app",
247247
"parallel": 1,
248248
"cacheDirectory": "/tmp/nx-cache",
249-
"bust": 8,
249+
"bust": 1,
250250
"defaultBase": "master",
251251
"generators": {
252252
"@nx/react": {

0 commit comments

Comments
 (0)