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 ostree does in https://github.com/ostreedev/ostree/pull/2151.
This commit is contained in:
parent
89d79f3505
commit
fda0be62ce
@ -40,9 +40,10 @@ codestyle: {
|
||||
}
|
||||
},
|
||||
rust: {
|
||||
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi") {
|
||||
def n = 5
|
||||
cosaPod(buildroot: true, runAsUser: 0, memory: "2Gi", cpu: "${n}") {
|
||||
checkout scm
|
||||
shwrap("ci/msrv.sh")
|
||||
shwrap("MAKE_JOBS=${n} CARGO_BUILD_JOBS=${n} ci/msrv.sh")
|
||||
}
|
||||
}}
|
||||
|
||||
|
@ -7,7 +7,7 @@ pkg_upgrade() {
|
||||
}
|
||||
|
||||
make() {
|
||||
/usr/bin/make -j $(getconf _NPROCESSORS_ONLN) "$@"
|
||||
/usr/bin/make -j ${MAKE_JOBS:-$(getconf _NPROCESSORS_ONLN)} "$@"
|
||||
}
|
||||
|
||||
build() {
|
||||
|
Loading…
Reference in New Issue
Block a user