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 <pholzing@redhat.com>
This commit is contained in:
Paul Holzinger
2024-05-29 14:04:43 +02:00
parent 8650348bc9
commit e810b340ef
2 changed files with 7 additions and 4 deletions

View File

@ -150,6 +150,9 @@ setup_rootless() {
showrun groupadd -g $rootless_gid $ROOTLESS_USER showrun groupadd -g $rootless_gid $ROOTLESS_USER
showrun useradd -g $rootless_gid -u $rootless_uid --no-user-group --create-home $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 echo "$ROOTLESS_USER ALL=(root) NOPASSWD: ALL" > /etc/sudoers.d/ci-rootless
mkdir -p "$HOME/.ssh" "/home/$ROOTLESS_USER/.ssh" mkdir -p "$HOME/.ssh" "/home/$ROOTLESS_USER/.ssh"

View File

@ -167,10 +167,10 @@ runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage" graphroot = "/var/lib/containers/storage"
EOF EOF
# Since we've potentially changed important config settings, reset.
# This prevents `database graph driver "" does not match "overlay"` # mount a tmpfs for the container storage to speed up the IO
# on Debian. # side effect is we clear all potentially pre existing data so we know we always start "clean"
rm -rf /var/lib/containers/storage mount -t tmpfs -o size=75%,mode=0700 none /var/lib/containers
# shellcheck disable=SC2154 # shellcheck disable=SC2154
showrun echo "Setting CI_DESIRED_STORAGE [=$CI_DESIRED_STORAGE] for *e2e* tests" showrun echo "Setting CI_DESIRED_STORAGE [=$CI_DESIRED_STORAGE] for *e2e* tests"