ci: Constrain parallel build jobs
The default `_NPROCESSORS_ONLN` heuristic we have isn't cgroups aware. So it thinks it has e.g. 40 CPUs when running in a k8s pod. This can then blow through our allocated resource limits. Declare some modest amount of RAM and CPU resources and override `make` parallelism. This matches what rpm-ostree now does in https://github.com/coreos/rpm-ostree/pull/2155.
This commit is contained in:
parent
4752dd02cf
commit
92284f9b81
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
stage("Build") {
|
stage("Build") {
|
||||||
parallel normal: {
|
parallel normal: {
|
||||||
cosaPod(buildroot: true, runAsUser: 0) {
|
def n = 5
|
||||||
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
||||||
checkout scm
|
checkout scm
|
||||||
stage("Core build") {
|
stage("Core build") {
|
||||||
shwrap("""
|
shwrap("""
|
||||||
|
|
@ -10,7 +11,7 @@ parallel normal: {
|
||||||
git fetch origin --tags
|
git fetch origin --tags
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
env SKIP_INSTALLDEPS=1 ./ci/build.sh
|
env MAKE_JOBS=${n} SKIP_INSTALLDEPS=1 ./ci/build.sh
|
||||||
""")
|
""")
|
||||||
}
|
}
|
||||||
stage("Unit tests") {
|
stage("Unit tests") {
|
||||||
|
|
@ -84,18 +85,19 @@ parallel fcos: {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
buildopts: {
|
buildopts: {
|
||||||
cosaPod(buildroot: true, runAsUser: 0) {
|
def n = 5
|
||||||
|
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
||||||
checkout scm
|
checkout scm
|
||||||
shwrap("""
|
shwrap("""
|
||||||
git submodule update --init
|
git submodule update --init
|
||||||
|
|
||||||
git worktree add build-rust && cd build-rust
|
git worktree add build-rust && cd build-rust
|
||||||
env CONFIGOPTS="--enable-rust" SKIP_INSTALLDEPS=1 ./ci/build.sh
|
env MAKE_JOBS=${n} CONFIGOPTS="--enable-rust" SKIP_INSTALLDEPS=1 ./ci/build.sh
|
||||||
make check TESTS=tests/test-rollsum
|
make check TESTS=tests/test-rollsum
|
||||||
cd .. && rm -rf build-rust
|
cd .. && rm -rf build-rust
|
||||||
|
|
||||||
git worktree add build-libsoup && cd build-libsoup
|
git worktree add build-libsoup && cd build-libsoup
|
||||||
env CONFIGOPTS="--without-curl --without-openssl --with-soup" SKIP_INSTALLDEPS=1 ./ci/build.sh
|
env MAKE_JOBS=${n} CONFIGOPTS="--without-curl --without-openssl --with-soup" SKIP_INSTALLDEPS=1 ./ci/build.sh
|
||||||
make check
|
make check
|
||||||
cd .. && rm -rf build-libsoup
|
cd .. && rm -rf build-libsoup
|
||||||
""")
|
""")
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ pkg_upgrade() {
|
||||||
}
|
}
|
||||||
|
|
||||||
make() {
|
make() {
|
||||||
/usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@"
|
/usr/bin/make -j ${MAKE_JOBS:-$(getconf _NPROCESSORS_ONLN)} "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue