From e869cdb2ad8791e7b9d55b43defb90ebfe99d9e4 Mon Sep 17 00:00:00 2001 From: Markus Lehtonen Date: Fri, 6 Sep 2024 15:17:06 +0300 Subject: [PATCH] Support Debian 11 and 12 Drop support for EOL'd Debian 10 "buster". (cherry picked from commit 0bd6f5e7bd8cf86f67d585ad8251cc66e92768cb) --- demo/lib/distro.bash | 17 ++++++++----- ...kerfile.debian-10 => Dockerfile.debian-11} | 2 +- dockerfiles/cross-build/Dockerfile.debian-12 | 25 +++++++++++++++++++ .../packages.test-suite/debian-10/binsrc.var | 1 - .../packages.test-suite/debian-10/distro.var | 1 - .../packages.test-suite/debian-11/binsrc.var | 1 + .../{debian-10 => debian-11}/cri-resmgr.cfg | 0 .../packages.test-suite/debian-11/distro.var | 1 + .../pkgtest/test01-systemd/code.var.sh | 0 .../pkgtest/topology.var.json | 0 .../reinstall_cri_resmgr.var | 0 .../packages.test-suite/debian-12/binsrc.var | 1 + .../debian-12/cri-resmgr.cfg | 6 +++++ .../packages.test-suite/debian-12/distro.var | 1 + .../pkgtest/test01-systemd/code.var.sh | 10 ++++++++ .../debian-12/pkgtest/topology.var.json | 3 +++ .../debian-12/reinstall_cri_resmgr.var | 1 + test/e2e/run.sh | 2 +- 18 files changed, 62 insertions(+), 10 deletions(-) rename dockerfiles/cross-build/{Dockerfile.debian-10 => Dockerfile.debian-11} (95%) create mode 100644 dockerfiles/cross-build/Dockerfile.debian-12 delete mode 100644 test/e2e/packages.test-suite/debian-10/binsrc.var delete mode 100644 test/e2e/packages.test-suite/debian-10/distro.var create mode 100644 test/e2e/packages.test-suite/debian-11/binsrc.var rename test/e2e/packages.test-suite/{debian-10 => debian-11}/cri-resmgr.cfg (100%) create mode 100644 test/e2e/packages.test-suite/debian-11/distro.var rename test/e2e/packages.test-suite/{debian-10 => debian-11}/pkgtest/test01-systemd/code.var.sh (100%) rename test/e2e/packages.test-suite/{debian-10 => debian-11}/pkgtest/topology.var.json (100%) rename test/e2e/packages.test-suite/{debian-10 => debian-11}/reinstall_cri_resmgr.var (100%) create mode 100644 test/e2e/packages.test-suite/debian-12/binsrc.var create mode 100644 test/e2e/packages.test-suite/debian-12/cri-resmgr.cfg create mode 100644 test/e2e/packages.test-suite/debian-12/distro.var create mode 100644 test/e2e/packages.test-suite/debian-12/pkgtest/test01-systemd/code.var.sh create mode 100644 test/e2e/packages.test-suite/debian-12/pkgtest/topology.var.json create mode 100644 test/e2e/packages.test-suite/debian-12/reinstall_cri_resmgr.var diff --git a/demo/lib/distro.bash b/demo/lib/distro.bash index a6751778b..8b6edd07f 100644 --- a/demo/lib/distro.bash +++ b/demo/lib/distro.bash @@ -132,12 +132,12 @@ ubuntu-24_04-image-url() { echo "https://cloud-images.ubuntu.com/releases/noble/release/ubuntu-24.04-server-cloudimg-amd64.img" } -debian-10-image-url() { - echo "https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-amd64.qcow2" +debian-11-image-url() { + echo "https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-amd64.qcow2" } -debian-11-image-url() { - echo "https://cloud.debian.org/images/cloud/bullseye/daily/latest/debian-11-generic-amd64-daily.qcow2" +debian-12-image-url() { + echo "https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-generic-amd64.qcow2" } debian-sid-image-url() { @@ -257,10 +257,15 @@ debian-install-kernel-dev() { echo "install: dpkg -i linux-*.deb" } -debian-10-install-containerd-pre() { +debian-11-install-containerd-pre() { debian-install-repo-key https://download.docker.com/linux/debian/gpg - debian-install-repo "deb https://download.docker.com/linux/debian buster stable" + debian-install-repo "deb https://download.docker.com/linux/debian bullseye stable" +} +debian-11-install-containerd() { + vm-command-q "[ -f /usr/bin/containerd ]" || { + distro-install-pkg containerd.io + } } debian-sid-install-containerd-post() { diff --git a/dockerfiles/cross-build/Dockerfile.debian-10 b/dockerfiles/cross-build/Dockerfile.debian-11 similarity index 95% rename from dockerfiles/cross-build/Dockerfile.debian-10 rename to dockerfiles/cross-build/Dockerfile.debian-11 index 3efdb7d3e..f3835e772 100644 --- a/dockerfiles/cross-build/Dockerfile.debian-10 +++ b/dockerfiles/cross-build/Dockerfile.debian-11 @@ -1,5 +1,5 @@ # pull in base + a minimal set of useful packages -FROM debian:buster as debian-10-build +FROM debian:bullseye as debian-11-build ARG GO_VERSION=x.yz ARG GOLICENSES_VERSION diff --git a/dockerfiles/cross-build/Dockerfile.debian-12 b/dockerfiles/cross-build/Dockerfile.debian-12 new file mode 100644 index 000000000..0e7ba3d91 --- /dev/null +++ b/dockerfiles/cross-build/Dockerfile.debian-12 @@ -0,0 +1,25 @@ +# pull in base + a minimal set of useful packages +FROM debian:bookworm as debian-11-build + +ARG GO_VERSION=x.yz +ARG GOLICENSES_VERSION +ARG CREATE_USER="test" +ARG USER_UID="" +ENV PATH /go/bin:/usr/local/go/bin:$PATH + +# pull in stuff for cgo +RUN apt-get update && \ + apt-get install -y --no-install-recommends \ + build-essential fakeroot devscripts \ + bash git make sed debhelper ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +ADD http://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz / + +RUN tar xf /go${GO_VERSION}.linux-amd64.tar.gz -C "/usr/local" && \ + rm /go${GO_VERSION}.linux-amd64.tar.gz + +RUN GOBIN=/go/bin go install github.com/google/go-licenses@${GOLICENSES_VERSION} + +RUN [ -n "$CREATE_USER" -a "$CREATE_USER" != "root" ] && \ + useradd -m -s /bin/bash $CREATE_USER -u $USER_UID diff --git a/test/e2e/packages.test-suite/debian-10/binsrc.var b/test/e2e/packages.test-suite/debian-10/binsrc.var deleted file mode 100644 index 3298c1e8a..000000000 --- a/test/e2e/packages.test-suite/debian-10/binsrc.var +++ /dev/null @@ -1 +0,0 @@ -packages/debian-10 \ No newline at end of file diff --git a/test/e2e/packages.test-suite/debian-10/distro.var b/test/e2e/packages.test-suite/debian-10/distro.var deleted file mode 100644 index 7e2707151..000000000 --- a/test/e2e/packages.test-suite/debian-10/distro.var +++ /dev/null @@ -1 +0,0 @@ -debian-10 diff --git a/test/e2e/packages.test-suite/debian-11/binsrc.var b/test/e2e/packages.test-suite/debian-11/binsrc.var new file mode 100644 index 000000000..044705da0 --- /dev/null +++ b/test/e2e/packages.test-suite/debian-11/binsrc.var @@ -0,0 +1 @@ +packages/debian-11 diff --git a/test/e2e/packages.test-suite/debian-10/cri-resmgr.cfg b/test/e2e/packages.test-suite/debian-11/cri-resmgr.cfg similarity index 100% rename from test/e2e/packages.test-suite/debian-10/cri-resmgr.cfg rename to test/e2e/packages.test-suite/debian-11/cri-resmgr.cfg diff --git a/test/e2e/packages.test-suite/debian-11/distro.var b/test/e2e/packages.test-suite/debian-11/distro.var new file mode 100644 index 000000000..d2dca6a21 --- /dev/null +++ b/test/e2e/packages.test-suite/debian-11/distro.var @@ -0,0 +1 @@ +debian-11 diff --git a/test/e2e/packages.test-suite/debian-10/pkgtest/test01-systemd/code.var.sh b/test/e2e/packages.test-suite/debian-11/pkgtest/test01-systemd/code.var.sh similarity index 100% rename from test/e2e/packages.test-suite/debian-10/pkgtest/test01-systemd/code.var.sh rename to test/e2e/packages.test-suite/debian-11/pkgtest/test01-systemd/code.var.sh diff --git a/test/e2e/packages.test-suite/debian-10/pkgtest/topology.var.json b/test/e2e/packages.test-suite/debian-11/pkgtest/topology.var.json similarity index 100% rename from test/e2e/packages.test-suite/debian-10/pkgtest/topology.var.json rename to test/e2e/packages.test-suite/debian-11/pkgtest/topology.var.json diff --git a/test/e2e/packages.test-suite/debian-10/reinstall_cri_resmgr.var b/test/e2e/packages.test-suite/debian-11/reinstall_cri_resmgr.var similarity index 100% rename from test/e2e/packages.test-suite/debian-10/reinstall_cri_resmgr.var rename to test/e2e/packages.test-suite/debian-11/reinstall_cri_resmgr.var diff --git a/test/e2e/packages.test-suite/debian-12/binsrc.var b/test/e2e/packages.test-suite/debian-12/binsrc.var new file mode 100644 index 000000000..aeee57eb9 --- /dev/null +++ b/test/e2e/packages.test-suite/debian-12/binsrc.var @@ -0,0 +1 @@ +packages/debian-12 diff --git a/test/e2e/packages.test-suite/debian-12/cri-resmgr.cfg b/test/e2e/packages.test-suite/debian-12/cri-resmgr.cfg new file mode 100644 index 000000000..c5a769e5d --- /dev/null +++ b/test/e2e/packages.test-suite/debian-12/cri-resmgr.cfg @@ -0,0 +1,6 @@ +policy: + Active: topology-aware + ReservedResources: + CPU: 750m +logger: + Debug: cri-resmgr,resource-manager,cache,policy diff --git a/test/e2e/packages.test-suite/debian-12/distro.var b/test/e2e/packages.test-suite/debian-12/distro.var new file mode 100644 index 000000000..4896f8a3c --- /dev/null +++ b/test/e2e/packages.test-suite/debian-12/distro.var @@ -0,0 +1 @@ +debian-12 diff --git a/test/e2e/packages.test-suite/debian-12/pkgtest/test01-systemd/code.var.sh b/test/e2e/packages.test-suite/debian-12/pkgtest/test01-systemd/code.var.sh new file mode 100644 index 000000000..542ea6c05 --- /dev/null +++ b/test/e2e/packages.test-suite/debian-12/pkgtest/test01-systemd/code.var.sh @@ -0,0 +1,10 @@ +# Clear cri-resmgr output from previous runs. +vm-command "journalctl --vacuum-time=1s" + +# Create a pod. +create besteffort + +# Verify that new pod was created by systemd-managed cri-resource-manager. +vm-command "journalctl -xeu cri-resource-manager | grep 'StartContainer: starting container pod0:pod0c0'" || { + command-error "failed to verify that systemd-managed cri-resource-manager launched the pod" +} diff --git a/test/e2e/packages.test-suite/debian-12/pkgtest/topology.var.json b/test/e2e/packages.test-suite/debian-12/pkgtest/topology.var.json new file mode 100644 index 000000000..2c7928382 --- /dev/null +++ b/test/e2e/packages.test-suite/debian-12/pkgtest/topology.var.json @@ -0,0 +1,3 @@ +[ + {"mem": "2G", "cores": 2, "nodes": 2, "packages": 2} +] diff --git a/test/e2e/packages.test-suite/debian-12/reinstall_cri_resmgr.var b/test/e2e/packages.test-suite/debian-12/reinstall_cri_resmgr.var new file mode 100644 index 000000000..56a6051ca --- /dev/null +++ b/test/e2e/packages.test-suite/debian-12/reinstall_cri_resmgr.var @@ -0,0 +1 @@ +1 \ No newline at end of file diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 073a914c5..bce2ea48d 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -99,7 +99,7 @@ usage() { echo " topology: JSON to override NUMA node list used in tests." echo " See: python3 ${DEMO_LIB_DIR}/topology2qemuopts.py --help" echo " distro: Linux distribution to be / already installed on vm." - echo " Supported values: debian-10, debian-sid" + echo " Supported values: debian-11, debian-12, debian-sid" echo " fedora, opensuse-tumbleweed," echo " opensuse-15.5 (same as opensuse), sles," echo " ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, ubuntu-24.04"