Skip to content

Commit 00f300f

Browse files
committed
sequential building on CI, to hopefully avoid flaky failures
1 parent a53f7a2 commit 00f300f

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
pip install -e .[ci,dev,testing,celery,diskcache] --progress-bar off
5555
pip list | grep dash
5656
npm i
57-
npm run build
57+
npm run build.sequential
5858
python setup.py sdist
5959
mkdir dash-package && cp dist/*.tar.gz dash-package/dash-package.tar.gz
6060
ls -la dash-package
@@ -120,7 +120,7 @@ jobs:
120120
set -eo pipefail
121121
pip install -e . --progress-bar off && pip list | grep dash
122122
npm install npm run initialize
123-
npm run build
123+
npm run build.sequential
124124
npm run lint
125125
- run:
126126
name: 🐍 Python Unit Tests & ☕ JS Unit Tests

dash/development/update_components.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class _CombinedFormatter(
2020
)
2121

2222

23-
def booststrap_components(components_source):
23+
def bootstrap_components(components_source, concurrency):
2424

2525
is_windows = sys.platform == "win32"
2626

@@ -30,10 +30,9 @@ def booststrap_components(components_source):
3030
else "dash-core-components|dash-html-components|dash-table"
3131
)
3232

33-
cmd = shlex.split(
34-
"npx lerna exec --scope *@({})* -- npm i".format(source_glob),
35-
posix=not is_windows,
36-
)
33+
cmdstr = f"npx lerna exec --concurrency {concurrency} --scope *@({source_glob})* -- npm i"
34+
cmd = shlex.split(cmdstr, posix=not is_windows)
35+
print(cmdstr)
3736

3837
with subprocess.Popen(
3938
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=is_windows
@@ -57,7 +56,7 @@ def booststrap_components(components_source):
5756
)
5857

5958

60-
def build_components(components_source):
59+
def build_components(components_source, concurrency):
6160

6261
is_windows = sys.platform == "win32"
6362

@@ -67,10 +66,9 @@ def build_components(components_source):
6766
else "dash-core-components|dash-html-components|dash-table"
6867
)
6968

70-
cmd = shlex.split(
71-
"npx lerna exec --scope *@({})* -- npm run build".format(source_glob),
72-
posix=not is_windows,
73-
)
69+
cmdstr = f"npx lerna exec --concurrency {concurrency} --scope *@({source_glob})* -- npm run build"
70+
cmd = shlex.split(cmdstr, posix=not is_windows)
71+
print(cmdstr)
7472

7573
with subprocess.Popen(
7674
cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=is_windows
@@ -140,11 +138,17 @@ def cli():
140138
" The default argument is 'all'.",
141139
default="all",
142140
)
141+
parser.add_argument(
142+
"--concurrency",
143+
type=int,
144+
default=3,
145+
help="Maximum concurrent steps, up to 3 (ie all components in parallel)",
146+
)
143147

144148
args = parser.parse_args()
145149

146-
booststrap_components(args.components_source)
147-
build_components(args.components_source)
150+
bootstrap_components(args.components_source, args.concurrency)
151+
build_components(args.components_source, args.concurrency)
148152

149153

150154
if __name__ == "__main__":

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"private::test.integration-dash": "TESTFILES=$(circleci tests glob \"tests/integration/**/test_*.py\" | circleci tests split --split-by=timings) && pytest --headless --nopercyfinalize --junitxml=test-reports/junit_intg.xml ${TESTFILES}",
2727
"private::test.integration-dash-import": "cd tests/integration/dash && python dash_import_test.py",
2828
"build": "run-s private::build.*",
29+
"build.sequential": "npm run private::build.renderer && npm run private::build.components -- --concurrency 1",
2930
"format": "run-s private::format.*",
3031
"initialize": "run-s private::initialize.*",
3132
"prepare": "husky install",

0 commit comments

Comments
 (0)