@@ -104,12 +104,7 @@ jobs:
104104 strategy :
105105 fail-fast : false
106106 matrix :
107- # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
108107 include :
109- - ubuntu : 20.04
110- containerd : v1.6.36
111- runner : " ubuntu-20.04"
112- arch : amd64
113108 - ubuntu : 22.04
114109 containerd : v1.7.25
115110 runner : " ubuntu-22.04"
@@ -228,16 +223,10 @@ jobs:
228223 strategy :
229224 fail-fast : false
230225 matrix :
231- # ubuntu-20.04: cgroup v1, ubuntu-22.04 and later: cgroup v2
232226 include :
233- - ubuntu : 20.04
234- containerd : v1.6.36
235- rootlesskit : v1.1.1 # Deprecated
236- target : rootless
237- arch : amd64
238227 - ubuntu : 22.04
239228 containerd : v1.7.25
240- rootlesskit : v2.3.2
229+ rootlesskit : v1.1.1 # Deprecated
241230 target : rootless
242231 arch : amd64
243232 - ubuntu : 24.04
@@ -427,3 +416,92 @@ jobs:
427416 run : sudo vagrant up --provision-with=test-unit
428417 - name : test-integration
429418 run : sudo vagrant up --provision-with=test-integration
419+
420+ # EL8 is used for testing compatibility with cgroup v1.
421+ # Do not upgrade this to EL9 (cgroup v2).
422+ test-integration-el8 :
423+ timeout-minutes : 60
424+ name : " EL8 (cgroup v1)"
425+ strategy :
426+ fail-fast : false
427+ matrix :
428+ mode : ["rootful", "rootless"]
429+ runs-on : ubuntu-24.04
430+ steps :
431+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
432+ with :
433+ fetch-depth : 1
434+ - name : " Install QEMU"
435+ run : |
436+ set -eux
437+ sudo apt-get update
438+ sudo apt-get -qq install -y --no-install-recommends ovmf qemu-system-x86 qemu-utils
439+ sudo modprobe kvm
440+ # `sudo usermod -aG kvm $(whoami)` does not take an effect on GHA
441+ sudo chown $(whoami) /dev/kvm
442+ - name : " Install Lima"
443+ env :
444+ GITHUB_TOKEN : ${{ github.token }} # required by `gh attestation verify`
445+ run : |
446+ set -eux
447+ LIMA_VERSION=$(curl -fsSL https://api.github.com/repos/lima-vm/lima/releases/latest | jq -r .tag_name)
448+ FILE="lima-${LIMA_VERSION:1}-Linux-x86_64.tar.gz"
449+ curl -fOSL https://github.com/lima-vm/lima/releases/download/${LIMA_VERSION}/${FILE}
450+ gh attestation verify --owner=lima-vm "${FILE}"
451+ sudo tar Cxzf /usr/local "${FILE}"
452+ rm -f "${FILE}"
453+ # Export LIMA_VERSION For the GHA cache key
454+ echo "LIMA_VERSION=${LIMA_VERSION}" >>$GITHUB_ENV
455+ - uses : actions/cache@0c907a75c2c80ebcb7f088228285e798b750cf8f # v4.2.1
456+ with :
457+ path : ~/.cache/lima
458+ key : lima-${{ env.LIMA_VERSION }}
459+ - name : " Start the guest VM"
460+ run : |
461+ set -eux
462+ # containerd=none is set because the built-in containerd support conflicts with Docker
463+ limactl start \
464+ --name=default \
465+ --cpus=4 \
466+ --memory=12 \
467+ --containerd=none \
468+ --set '.mounts=null | .portForwards=[{"guestSocket":"/var/run/docker.sock","hostSocket":"{{.Dir}}/sock/docker.sock"}]' \
469+ template://almalinux-8
470+ # FIXME: the tests should be directly executed in the VM without nesting Docker inside it
471+ # https://github.com/containerd/nerdctl/issues/3858
472+ - name : " Install dockerd in the guest VM"
473+ run : |
474+ set -eux
475+ lima sudo mkdir -p /etc/systemd/system/docker.socket.d
476+ cat <<-EOF | lima sudo tee /etc/systemd/system/docker.socket.d/override.conf
477+ [Socket]
478+ SocketUser=$(whoami)
479+ EOF
480+ lima sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
481+ lima sudo dnf -q -y install docker-ce --nobest
482+ lima sudo systemctl enable --now docker
483+ - name : " Configure the host to use dockerd in the guest VM"
484+ run : |
485+ set -eux
486+ sudo systemctl disable --now docker.service docker.socket
487+ export DOCKER_HOST="unix://$(limactl ls --format '{{.Dir}}/sock/docker.sock' default)"
488+ echo "DOCKER_HOST=${DOCKER_HOST}" >>$GITHUB_ENV
489+ docker info
490+ docker version
491+ - name : " Prepare integration tests"
492+ env :
493+ MODE : ${{ matrix.mode }}
494+ run : |
495+ set -eux
496+ TARGET=test-integration
497+ [ "$MODE" = "rootless" ] && TARGET=test-integration-rootless
498+ docker build -t test-integration --target "${TARGET}" .
499+ # losetup not working as expected on EL8?
500+ # > === FAIL: cmd/nerdctl/container TestRunDevice (0.44s)
501+ # > container_run_cgroup_linux_test.go:236: assertion failed: error is not nil: loopback setup failed ([losetup --find --show /tmp/containerd-test-loopback3931357228]):
502+ # > stdout="", stderr="losetup: /tmp/containerd-test-loopback3931357228: failed to set up loop device: No such file or directory\n": exit status 1
503+ # https://github.com/containerd/nerdctl/pull/3904#issuecomment-2670917820
504+ sudo losetup -Dv
505+ sudo losetup -lv
506+ - name : " Run integration tests"
507+ run : docker run -t --rm --privileged test-integration
0 commit comments