summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2020-08-24 11:30:03 +0200
committerDiana Picus <diana.picus@linaro.org>2020-08-31 08:38:52 +0000
commit73ab5ac992942292817b1441472d325ed4c553be (patch)
treefad13ae1c2ceb18591e32255bc38d46153ee6c46
parentc1856649fdd1f353c28d8c5158d3ba83f0dfdc1b (diff)
Increase memory allocation for build containers
Building flang needs more than 1GB per core and trying with 2GB per core surpasses the 30000 threshold. Use unlimited instead. Change-Id: Ibe1a06d5e529eaad9ea3b4a9d6c569a1171bed9c
-rw-r--r--jenkins-helpers.sh7
-rwxr-xr-xstart-container-docker.sh2
-rwxr-xr-xstart-container-qemu.sh2
3 files changed, 3 insertions, 8 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index eef41fde..71d60a22 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -686,15 +686,10 @@ print_memory_limit ()
set -euf -o pipefail
local task="$1"
local weight="$2"
- local nproc="$3"
local memory
case "$task" in
build)
- # 1GB per compilation core
- memory=$(( 1000 * $weight * $nproc ))
- if [ "$memory" -gt "30000" ]; then
- memory="30000"
- fi
+ memory="unlimited"
;;
test)
# 0.75GB per session
diff --git a/start-container-docker.sh b/start-container-docker.sh
index 4b5cbecd..b3f3a66f 100755
--- a/start-container-docker.sh
+++ b/start-container-docker.sh
@@ -241,7 +241,7 @@ nproc=$($SSH $session_host nproc --all)
pids=$(print_pids_limit "$task" "$weight")
cpus=$(print_cpu_shares "$task" "$weight")
-memory=$(print_memory_limit "$task" "$weight" "$nproc")
+memory=$(print_memory_limit "$task" "$weight")
memory_opt="--memory=${memory}M"
if [ x"$memory" = x"unlimited" ]; then
memory_opt=""
diff --git a/start-container-qemu.sh b/start-container-qemu.sh
index b20bb2f3..6e01d9c1 100755
--- a/start-container-qemu.sh
+++ b/start-container-qemu.sh
@@ -97,7 +97,7 @@ fi
# CPU is limited (on contention) by docker container.
ncpus=$(container_exec nproc --all)
-memory=$(print_memory_limit "$task" "$weight" "$ncpus")
+memory=$(print_memory_limit "$task" "$weight")
# Reduce memory limit for VM to leave something for QEMU itself.
memory=$(($memory*2/3))