Skip to content

Commit e1e1c5f

Browse files
committed
ICU-22349 Use -l with make -j to limit jobs based on load average.
It has been proposed that make running too many parallel jobs recently has led to resource exhaustion in our CI, so that some kind of limit would be helpful to set. The load average 2.5 limit choosen here is simply the limit used as an example in the make documentation, as we don't really have any way of picking an initial value that's certain to be better. https://www.gnu.org/software/make/manual/html_node/Parallel.html See unicode-org#2421 See unicode-org#2422
1 parent 5618203 commit e1e1c5f

File tree

12 files changed

+70
-70
lines changed

12 files changed

+70
-70
lines changed

.ci-builds/.azure-exhaustive-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
lfs: true
6363
fetchDepth: 10
6464
- script: |
65-
cd icu4c/source && ./runConfigureICU Linux && make -j2
65+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5
6666
displayName: 'Build'
6767
- script: |
6868
cd icu4c/source && make check-exhaustive

.ci-builds/.azure-pipelines.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
lfs: true
3434
fetchDepth: 10
3535
- script: |
36-
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
36+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
3737
displayName: 'Build and Test'
3838
env:
3939
CC: clang
@@ -57,7 +57,7 @@ jobs:
5757
- script: |
5858
cd icu4c/source && \
5959
ICU_DATA_FILTER_FILE=../../.ci-builds/data-filter.json ./runConfigureICU Linux && \
60-
make -j2 tests && \
60+
make -j -l2.5 tests && \
6161
\[ ! -d data/out/build/icudt66l/translit \] && \
6262
(cd test/intltest && LD_LIBRARY_PATH=../../lib:../../tools/ctestfw ./intltest translit/TransliteratorTest/TestBasicTransliteratorEvenWithoutData)
6363
displayName: 'Build with Data Filter'
@@ -75,7 +75,7 @@ jobs:
7575
lfs: true
7676
fetchDepth: 10
7777
- script: |
78-
export CXXFLAGS="-std=c++17 -Winvalid-constexpr" && cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j2 check
78+
export CXXFLAGS="-std=c++17 -Winvalid-constexpr" && cd icu4c/source && ./runConfigureICU --enable-debug --disable-release Linux && make -j -l2.5 check
7979
displayName: 'Build and Test C++17'
8080
env:
8181
CC: clang
@@ -91,7 +91,7 @@ jobs:
9191
lfs: true
9292
fetchDepth: 10
9393
- script: |
94-
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
94+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
9595
displayName: 'Build and Test'
9696
env:
9797
CC: gcc
@@ -112,7 +112,7 @@ jobs:
112112
sudo apt install gcc-11 g++-11
113113
displayName: 'Install GCC-11'
114114
- script: |
115-
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
115+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
116116
displayName: 'Build and Test'
117117
env:
118118
CC: gcc-11
@@ -129,7 +129,7 @@ jobs:
129129
lfs: true
130130
fetchDepth: 10
131131
- script: |
132-
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
132+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
133133
displayName: 'Build and Test'
134134
env:
135135
CC: clang
@@ -153,7 +153,7 @@ jobs:
153153
sudo apt install -qy clang-14 lld-14 libc++-14-dev libc++abi-14-dev
154154
displayName: 'Install Clang-14'
155155
- script: |
156-
cd icu4c/source && ./runConfigureICU Linux && make -j2 tests
156+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 tests
157157
displayName: 'Build only (WarningsAsErrors)'
158158
env:
159159
CC: clang-14
@@ -177,7 +177,7 @@ jobs:
177177
sudo apt install -qy clang-14 lld-14 libc++-14-dev libc++abi-14-dev
178178
displayName: 'Install Clang-14'
179179
- script: |
180-
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
180+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
181181
displayName: 'Build and Test'
182182
env:
183183
CC: clang-14
@@ -202,7 +202,7 @@ jobs:
202202
sudo apt install -qy clang-14 lld-14 libc++-14-dev libc++abi-14-dev
203203
displayName: 'Install Clang-14'
204204
- script: |
205-
cd icu4c/source && ./runConfigureICU Linux && make -j2 check
205+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5 check
206206
displayName: 'Build and Test'
207207
env:
208208
CC: clang-14
@@ -556,7 +556,7 @@ jobs:
556556
displayName: 'Install mingw-w64-x86_64-toolchain'
557557
- script: |
558558
set MSYSTEM=MINGW64
559-
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j2 check"
559+
c:\tools\msys64\usr\bin\bash.exe -lc "cd $BUILD_SOURCESDIRECTORY && cd icu4c/source && ./runConfigureICU MinGW --prefix='/tmp/build-icu' && make -j -l2.5 check"
560560
displayName: 'Build and Test'
561561
- script: |
562562
set MSYSTEM=MINGW64
@@ -578,7 +578,7 @@ jobs:
578578
lfs: true
579579
fetchDepth: 10
580580
- script: |
581-
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor" && cd icu4c/source && ./runConfigureICU MacOSX && make -j2 check
581+
export CPPFLAGS="-Werror -Wall -Wextra -Wextra-semi -Wundef -Wnon-virtual-dtor" && cd icu4c/source && ./runConfigureICU MacOSX && make -j -l2.5 check
582582
displayName: 'Build and Test (WarningsAsErrors)'
583583
env:
584584
CC: clang
@@ -640,13 +640,13 @@ jobs:
640640
%CYG_ROOT%\\bin\\sh -lc 'echo Hello' && %CYG_ROOT%\\bin\\sh -lc 'uname -a'
641641
displayName: 'Check Cygwin environment'
642642
- script: |
643-
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests -j "
643+
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && ./runConfigureICU Cygwin && make tests -j -l2.5"
644644
displayName: 'Build ICU (source and test)'
645645
env:
646646
CC: gcc
647647
CXX: g++
648648
- script: |
649-
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && make -j check"
649+
%CYG_ROOT%\\bin\\bash -lc "cd $(cygpath \"$(Build.SourcesDirectory)\") && cd icu4c/source && make -j -l2.5 check"
650650
displayName: 'Run Tests'
651651
env:
652652
CC: gcc
@@ -662,7 +662,7 @@ jobs:
662662
lfs: true
663663
fetchDepth: 10
664664
- script: |
665-
cd icu4c/source && ./runConfigureICU Linux && make -j2
665+
cd icu4c/source && ./runConfigureICU Linux && make -j -l2.5
666666
displayName: 'Build'
667667
env:
668668
CC: clang

.github/workflows/icu_ci.yml

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ jobs:
139139
cd icu4c/source;
140140
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
141141
make clean;
142-
make -j ICU4J_ROOT=../../../icu4j icu4j-data-install;
142+
make -j -l2.5 ICU4J_ROOT=../../../icu4j icu4j-data-install;
143143
cd ../..
144144
- name: ICU4J
145145
run: |
@@ -171,7 +171,7 @@ jobs:
171171
cd icu4c/source;
172172
ICU_DATA_BUILDTOOL_OPTS=--include_uni_core_data ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
173173
make clean;
174-
make -j ICU4J_ROOT=../../../icu4j icu4j-data-install;
174+
make -j -l2.5 ICU4J_ROOT=../../../icu4j icu4j-data-install;
175175
cd ../..
176176
- name: ICU4J
177177
run: |
@@ -205,7 +205,7 @@ jobs:
205205
mkdir build;
206206
cd build;
207207
../icu4c/source/runConfigureICU --enable-debug --disable-release Linux/gcc --prefix=$PREFIX --enable-tracing;
208-
make -j check;
208+
make -j -l2.5 check;
209209
( cd ../icu4c/source/test/depstest && ./depstest.py ../../../../build/ );
210210
make install;
211211
PATH=$PREFIX/bin:$PATH make -C test/hdrtst check
@@ -232,7 +232,7 @@ jobs:
232232
run: |
233233
cd icu4c/source;
234234
./runConfigureICU Linux;
235-
make -j check;
235+
make -j -l2.5 check;
236236
- name: Test Dependency
237237
run: |
238238
cd icu4c/source/test/depstest;
@@ -266,8 +266,8 @@ jobs:
266266
mkdir build;
267267
cd build;
268268
../icu4c/source/runConfigureICU Linux --disable-layout --disable-layoutex --prefix=$PREFIX;
269-
make -j check;
270-
make -j install;
269+
make -j -l2.5 check;
270+
make -j -l2.5 install;
271271
cd $PREFIX/bin;
272272
LD_LIBRARY_PATH=../lib ./icuinfo
273273
@@ -281,7 +281,7 @@ jobs:
281281
run: |
282282
cd icu4c/source;
283283
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming --enable-tracing;
284-
make -j check;
284+
make -j -l2.5 check;
285285
env:
286286
CPPFLAGS: -fsanitize=address
287287
LDFLAGS: -fsanitize=address
@@ -295,7 +295,7 @@ jobs:
295295
run: |
296296
cd icu4c/source;
297297
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming;
298-
make -j check;
298+
make -j -l2.5 check;
299299
env:
300300
CPPFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
301301
CFLAGS: -fsanitize=undefined -fsanitize=alignment -fno-sanitize-recover=undefined,alignment
@@ -310,7 +310,7 @@ jobs:
310310
run: |
311311
cd icu4c/source;
312312
./runConfigureICU Linux --disable-renaming;
313-
make -j check;
313+
make -j -l2.5 check;
314314
env:
315315
CC: clang
316316
CXX: clang++
@@ -329,9 +329,9 @@ jobs:
329329
run: |
330330
cd icu4c/source;
331331
./runConfigureICU --enable-debug --disable-release Linux --disable-renaming
332-
make -j ;
333-
make -j -C test;
334-
make -j -C test/intltest check
332+
make -j -l2.5;
333+
make -j -l2.5 -C test;
334+
make -j -l2.5 -C test/intltest check
335335
env:
336336
INTLTEST_OPTS: utility/MultithreadTest
337337
CPPFLAGS: -fsanitize=thread
@@ -347,7 +347,7 @@ jobs:
347347
run: |
348348
cd icu4c/source;
349349
PYTHON=python3 ./runConfigureICU MacOSX;
350-
make -j check
350+
make -j -l2.5 check
351351
352352
# Run ICU4C tests with stubdata.
353353
run-with-stubdata:
@@ -359,14 +359,14 @@ jobs:
359359
run: |
360360
cd icu4c/source;
361361
./runConfigureICU Linux;
362-
make -j check;
362+
make -j -l2.5 check;
363363
rm lib/libicudata.so*;
364364
cp -P stubdata/libicudata.so* lib;
365365
366366
cd test/cintltst;
367367
echo 'Running ICU4C cintltst with stubdata.';
368368
# Note: 'Elapsed Time: ' is printed by makefile upon final success.
369-
CINTLTST_OPTS=-w make -j check 2>&1 | tee stubdata_ctest.log;
369+
CINTLTST_OPTS=-w make -j -l2.5 check 2>&1 | tee stubdata_ctest.log;
370370
if ! grep 'Elapsed Time: ' stubdata_ctest.log
371371
then
372372
echo
@@ -380,7 +380,7 @@ jobs:
380380
381381
cd ../intltest;
382382
echo 'Running ICU4C intltest with stubdata.';
383-
INTLTEST_OPTS=-w make -j check 2>&1 | tee stubdata_intltest.log;
383+
INTLTEST_OPTS=-w make -j -l2.5 check 2>&1 | tee stubdata_intltest.log;
384384
if ! grep 'Elapsed Time: ' stubdata_intltest.log
385385
then
386386
echo
@@ -400,7 +400,7 @@ jobs:
400400
- run: |
401401
cd icu4c/source;
402402
./runConfigureICU Linux CPPFLAGS="-DU_CHARSET_IS_UTF8=1";
403-
make -j check
403+
make -j -l2.5 check
404404
405405
# Test U_OVERRIDE_CXX_ALLOCATION-is-0-test
406406
u-override-cxx-allocation-is-0-test:
@@ -411,7 +411,7 @@ jobs:
411411
cd icu4c/source;
412412
./runConfigureICU Linux CPPFLAGS="-DU_OVERRIDE_CXX_ALLOCATION=0";
413413
make clean;
414-
make -j check
414+
make -j -l2.5 check
415415
416416
# Test LSTM
417417
lstm-test:
@@ -422,7 +422,7 @@ jobs:
422422
cd icu4c/source;
423423
ICU_DATA_FILTER_FILE=../../.github/lstm_for_th_my.json ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
424424
make clean;
425-
make -j check
425+
make -j -l2.5 check
426426
427427
# Test adaboost
428428
adaboost-test:
@@ -433,7 +433,7 @@ jobs:
433433
cd icu4c/source;
434434
ICU_DATA_FILTER_FILE=../../.github/adaboost.json CPPFLAGS=-DUCONFIG_USE_ML_PHRASE_BREAKING=1 ./runConfigureICU --enable-debug --disable-release Linux -disable-layoutex;
435435
make clean;
436-
make -j check
436+
make -j -l2.5 check
437437
438438
# Build and run testmap
439439
testmap:
@@ -443,10 +443,10 @@ jobs:
443443
- run: |
444444
cd icu4c/source;
445445
./runConfigureICU Linux;
446-
make -j check;
446+
make -j -l2.5 check;
447447
CONFIG_FILES=test/testmap/Makefile ./config.status;
448448
cd test/testmap;
449-
make -j check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
449+
make -j -l2.5 check | grep '*** PASS PASS PASS, test PASSED!!!!!!!!'
450450
451451
# Copyright scan
452452
copyright-scan:
@@ -520,7 +520,7 @@ jobs:
520520
run: |
521521
cd icu4c/source/;
522522
./runConfigureICU Linux;
523-
make -j tests;
523+
make -j -l2.5 tests;
524524
525525
# Run header tests with UCONFIG_NO_XXX variations.
526526
uconfig-header-tests:
@@ -564,7 +564,7 @@ jobs:
564564
cd icu4c/source/;
565565
mkdir /tmp/icu_cnfg;
566566
./runConfigureICU Linux --prefix=/tmp/icu_cnfg;
567-
make -j install;
567+
make -j -l2.5 install;
568568
- name: Test
569569
env:
570570
UCONFIG_NO: ${{ matrix.uconfig_cppflags }}
@@ -674,7 +674,7 @@ jobs:
674674
CINTLTST_OPTS: -w
675675
run: |
676676
cd icu4c/source
677-
make -j check
677+
make -j -l2.5 check
678678
679679
# https://unicode-org.github.io/icu/processes/release/tasks/healthy-code.html#test-uconfig_no_conversion
680680
icu4c-uconfig-no-version:
@@ -690,8 +690,8 @@ jobs:
690690
- name: Run make for stubdata, common, i18n
691691
run: |
692692
cd icu4c/source
693-
pushd stubdata && make -j && popd
693+
pushd stubdata && make -j -l2.5 && popd
694694
# Ensure lib directory for output object file exists
695695
mkdir -p lib
696-
pushd common && make -j && popd
697-
pushd i18n && make -j && popd
696+
pushd common && make -j -l2.5 && popd
697+
pushd i18n && make -j -l2.5 && popd

.github/workflows/icu_envtest.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
run: |
4646
cd icu4c/source/;
4747
./runConfigureICU Linux;
48-
make -j tests;
48+
make -j -l2.5 tests;
4949
- name: Test different locales as LC_ALL
5050
run: |
5151
echo "This job run the environment test of the following Locales";
@@ -62,7 +62,7 @@ jobs:
6262
for test_dir in iotest cintltst intltest
6363
do
6464
cd $test_dir;
65-
LC_ALL=$loc make -j check;
65+
LC_ALL=$loc make -j -l2.5 check;
6666
cd ..;
6767
done
6868
@@ -104,7 +104,7 @@ jobs:
104104
run: |
105105
cd icu4c/source/;
106106
./runConfigureICU Linux;
107-
make -j tests;
107+
make -j -l2.5 tests;
108108
- name: Test different locales as TZ
109109
run: |
110110
echo "This job run the environment test of the following TimeZones";
@@ -122,7 +122,7 @@ jobs:
122122
for test_dir in iotest cintltst intltest
123123
do
124124
cd $test_dir;
125-
TZ=$tz make -j check;
125+
TZ=$tz make -j -l2.5 check;
126126
cd ..;
127127
done
128128

0 commit comments

Comments
 (0)