Skip to content

Commit 5ab9950

Browse files
CI: NPROC calculation fix for unlimited Docker containers (#1015)
* CI: NPROC calculation fix Handle cases where memory.max contains the string "max" instead of a number. This might be the case with Docker containers over BM sometimes. Signed-off-by: Alexey Rivkin <[email protected]> * Fix to POSIX-compatible Signed-off-by: Alexey Rivkin <[email protected]> --------- Signed-off-by: Alexey Rivkin <[email protected]>
1 parent 1849f7a commit 5ab9950

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

.ci/scripts/common.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ if [ -z "$NPROC" ]; then
103103
limit=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
104104
elif [ -f /sys/fs/cgroup/memory.max ]; then
105105
limit=$(cat /sys/fs/cgroup/memory.max)
106+
[ "$limit" = "max" ] && limit=$((4 * 1024 * 1024 * 1024))
106107
else
107108
limit=$((4 * 1024 * 1024 * 1024))
108109
fi

0 commit comments

Comments
 (0)