From 58dba727c910665c7d4891b8b991226e4d3b28f2 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 18 May 2021 13:56:48 +0100 Subject: [PATCH] CI: Use FDO_CI_CONCURRENT $FDO_CI_CONCURRENT is provided by in the CI environment by the fd.o GitLab runners to tell us how many parallel processes would be 'good' to use. Use this to override the default Ninja invocation which uses as many CPUs as available, and instead tell it to use as many parallel processes as the runner thinks we should during the build process. Tests are invoked using `meson test` inside a virtme/QEmu VM; whilst Meson's test backend will use as many processors as availble, virtme will by default create a single-CPU VM. So if we create a VM with as many CPUs as we should have parallel processes, we can let it use all of them. This also requires quadrupling the requested RAM so ASan doesn't force us straight into OOM. Suggested by @daenzer. Signed-off-by: Daniel Stone --- .gitlab-ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a821530..9feb7a98 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -44,7 +44,7 @@ container_prep: - git clone --depth=1 https://gitlab.freedesktop.org/wayland/wayland-protocols - export WAYLAND_PROTOCOLS_DIR="$(pwd)/prefix-wayland-protocols" - export PKG_CONFIG_PATH="$WAYLAND_PROTOCOLS_DIR/share/pkgconfig:$PKG_CONFIG_PATH" - - export MAKEFLAGS="-j4" + - export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}" - cd wayland-protocols - git show -s HEAD - mkdir build @@ -64,9 +64,9 @@ container_prep: - export PATH=~/.local/bin:$PATH - cd "$BUILDDIR" - meson --prefix="$PREFIX" -Db_sanitize=address ${MESON_OPTIONS} .. - - ninja -k0 + - ninja -k0 -j${FDO_CI_CONCURRENT:-4} - ninja install - - virtme-run --rw --pwd --kimg /weston-virtme/bzImage --kopt quiet --script-dir ../.gitlab-ci/virtme-scripts --qemu-opts -m 1024 + - virtme-run --rw --pwd --kimg /weston-virtme/bzImage --kopt quiet --script-dir ../.gitlab-ci/virtme-scripts --qemu-opts -m 4096 -smp ${FDO_CI_CONCURRENT:-4} - TEST_RES=$(cat $TESTS_RES_PATH) - rm $TESTS_RES_PATH - cp -R /weston-virtme ./ @@ -91,7 +91,7 @@ container_prep: - export PATH=~/.local/bin:$PATH - cd "$BUILDDIR" - meson --prefix="$PREFIX" ${MESON_OPTIONS} .. - - ninja -k0 + - ninja -k0 -j${FDO_CI_CONCURRENT:-4} - ninja install - ninja clean artifacts: