From e810b340ef61b2a43d6061017cef9ecf92d1d5d6 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Wed, 29 May 2024 14:04:43 +0200 Subject: [PATCH] CI: mount tmpfs for container storage Try to speed up the CI tests by using tmpfs as container storage. This is important for system tests, other tests setup their own --root already on tmpfs so it should not effect them. Signed-off-by: Paul Holzinger --- contrib/cirrus/lib.sh | 3 +++ contrib/cirrus/setup_environment.sh | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index d47b310532..ea6d8a0de5 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -150,6 +150,9 @@ setup_rootless() { showrun groupadd -g $rootless_gid $ROOTLESS_USER showrun useradd -g $rootless_gid -u $rootless_uid --no-user-group --create-home $ROOTLESS_USER + # use tmpfs to speed up IO + mount -t tmpfs -o size=75%,mode=0700,uid=$rootless_uid,gid=$rootless_gid none /home/$ROOTLESS_USER + echo "$ROOTLESS_USER ALL=(root) NOPASSWD: ALL" > /etc/sudoers.d/ci-rootless mkdir -p "$HOME/.ssh" "/home/$ROOTLESS_USER/.ssh" diff --git a/contrib/cirrus/setup_environment.sh b/contrib/cirrus/setup_environment.sh index ae773c1270..f703ab32eb 100755 --- a/contrib/cirrus/setup_environment.sh +++ b/contrib/cirrus/setup_environment.sh @@ -167,10 +167,10 @@ runroot = "/run/containers/storage" graphroot = "/var/lib/containers/storage" EOF -# Since we've potentially changed important config settings, reset. -# This prevents `database graph driver "" does not match "overlay"` -# on Debian. -rm -rf /var/lib/containers/storage + +# mount a tmpfs for the container storage to speed up the IO +# side effect is we clear all potentially pre existing data so we know we always start "clean" +mount -t tmpfs -o size=75%,mode=0700 none /var/lib/containers # shellcheck disable=SC2154 showrun echo "Setting CI_DESIRED_STORAGE [=$CI_DESIRED_STORAGE] for *e2e* tests"