From 398e07e6f2bb5a2f763a22a8e4801108c242ffe2 Mon Sep 17 00:00:00 2001 From: Neil Hanlon Date: Sat, 22 Jan 2022 17:39:16 -0500 Subject: [PATCH] Add new container element - Rocky Linux Introduce new container image for Rocky Linux, a downstream clone of Red Hat Enterprise Linux. Keep non-voting in Check for a while before adding to any gate checks Signed-off-by: Neil Hanlon Change-Id: Ib383f60bc23b434b400f85c376840a000cafc697 Related-Bug: https://review.opendev.org/805800/ --- .zuul.d/jobs.yaml | 13 +++++++++++++ .zuul.d/project.yaml | 2 ++ diskimage_builder/elements/pkg-map/bin/pkg-map | 3 ++- .../elements/rocky-container/README.rst | 9 +++++++++ .../elements/rocky-container/containerfiles/8 | 7 +++++++ .../elements/rocky-container/element-deps | 8 ++++++++ .../environment.d/10-01-rocky-distro-name.bash | 4 ++++ .../rocky-container/environment.d/11-yum-dnf.bash | 1 + .../elements/rocky-container/package-installs.yaml | 13 +++++++++++++ .../test-elements/build-succeeds/README.rst | 1 + .../test-elements/build-succeeds/element-deps | 2 ++ 11 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 diskimage_builder/elements/rocky-container/README.rst create mode 100644 diskimage_builder/elements/rocky-container/containerfiles/8 create mode 100644 diskimage_builder/elements/rocky-container/element-deps create mode 100644 diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro-name.bash create mode 100644 diskimage_builder/elements/rocky-container/environment.d/11-yum-dnf.bash create mode 100644 diskimage_builder/elements/rocky-container/package-installs.yaml create mode 100644 diskimage_builder/elements/rocky-container/test-elements/build-succeeds/README.rst create mode 100644 diskimage_builder/elements/rocky-container/test-elements/build-succeeds/element-deps diff --git a/.zuul.d/jobs.yaml b/.zuul.d/jobs.yaml index a7cab07e..26ee6ecf 100644 --- a/.zuul.d/jobs.yaml +++ b/.zuul.d/jobs.yaml @@ -132,6 +132,19 @@ base_element: fedora-container release: '35' +- job: + name: dib-nodepool-functional-openstack-rockylinux-8-containerfile-src + description: | + Test building and booting a Rocky Linux image from a + containerfile with Nodepool and OpenStack (using released + libraries) + parent: dib-nodepool-functional-src-base + vars: + nodepool_debug: true + nodepool_diskimage: + base_element: rocky-container + release: '8' + - job: name: dib-nodepool-functional-openstack-ubuntu-xenial-src description: | diff --git a/.zuul.d/project.yaml b/.zuul.d/project.yaml index eb658a56..c7509d5f 100644 --- a/.zuul.d/project.yaml +++ b/.zuul.d/project.yaml @@ -19,6 +19,8 @@ - dib-nodepool-functional-openstack-centos-8-stream-src - dib-nodepool-functional-openstack-centos-9-stream-src - dib-nodepool-functional-openstack-fedora-35-containerfile-src + - dib-nodepool-functional-openstack-rockylinux-8-containerfile-src: + voting: false - dib-nodepool-functional-openstack-ubuntu-xenial-src - dib-nodepool-functional-openstack-ubuntu-bionic-src - dib-nodepool-functional-openstack-ubuntu-focal-src diff --git a/diskimage_builder/elements/pkg-map/bin/pkg-map b/diskimage_builder/elements/pkg-map/bin/pkg-map index cf8b2f9c..fefb6007 100755 --- a/diskimage_builder/elements/pkg-map/bin/pkg-map +++ b/diskimage_builder/elements/pkg-map/bin/pkg-map @@ -26,7 +26,8 @@ log = logging.getLogger() def os_family(distro): family = None - if distro in ['fedora', 'rhel', 'rhel7', 'centos', 'centos7', 'openeuler']: + if distro in ['fedora', 'rhel', 'rhel7', 'centos', 'centos7', 'openeuler', + 'rocky']: family = 'redhat' elif distro in ['debian', 'ubuntu']: family = 'debian' diff --git a/diskimage_builder/elements/rocky-container/README.rst b/diskimage_builder/elements/rocky-container/README.rst new file mode 100644 index 00000000..04208445 --- /dev/null +++ b/diskimage_builder/elements/rocky-container/README.rst @@ -0,0 +1,9 @@ +================ +rocky-container +================ + +Create a minimal image based on Rocky Linux container image + +This element sets the ``DISTRO_NAME`` var to 'rocky'. The release of +rocky to be installed can be controlled through the ``DIB_RELEASE`` +variable, which defaults the latest supported release. diff --git a/diskimage_builder/elements/rocky-container/containerfiles/8 b/diskimage_builder/elements/rocky-container/containerfiles/8 new file mode 100644 index 00000000..e619137f --- /dev/null +++ b/diskimage_builder/elements/rocky-container/containerfiles/8 @@ -0,0 +1,7 @@ +FROM docker.io/library/rockylinux:8 + +RUN dnf install -y findutils util-linux sudo python3 NetworkManager + +RUN systemctl unmask console-getty.service dev-hugepages.mount \ + getty.target sys-fs-fuse-connections.mount systemd-logind.service \ + systemd-remount-fs.service diff --git a/diskimage_builder/elements/rocky-container/element-deps b/diskimage_builder/elements/rocky-container/element-deps new file mode 100644 index 00000000..d9ef0bf4 --- /dev/null +++ b/diskimage_builder/elements/rocky-container/element-deps @@ -0,0 +1,8 @@ +cache-url +containerfile +package-installs +redhat-common +rpm-distro +source-repositories +vm +yum diff --git a/diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro-name.bash b/diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro-name.bash new file mode 100644 index 00000000..61120156 --- /dev/null +++ b/diskimage_builder/elements/rocky-container/environment.d/10-01-rocky-distro-name.bash @@ -0,0 +1,4 @@ +export DISTRO_NAME=rocky +export DIB_RELEASE=${DIB_RELEASE:-8} # always the most recent major +export EFI_BOOT_DIR="EFI/rocky" +export DIB_YUM_MINIMAL_CREATE_INTERFACES=0 diff --git a/diskimage_builder/elements/rocky-container/environment.d/11-yum-dnf.bash b/diskimage_builder/elements/rocky-container/environment.d/11-yum-dnf.bash new file mode 100644 index 00000000..91514f1e --- /dev/null +++ b/diskimage_builder/elements/rocky-container/environment.d/11-yum-dnf.bash @@ -0,0 +1 @@ +export YUM=dnf diff --git a/diskimage_builder/elements/rocky-container/package-installs.yaml b/diskimage_builder/elements/rocky-container/package-installs.yaml new file mode 100644 index 00000000..15659ce9 --- /dev/null +++ b/diskimage_builder/elements/rocky-container/package-installs.yaml @@ -0,0 +1,13 @@ +audit: +dnf-plugins-core: +dracut: +dracut-config-generic: +grubby: +kernel: +initscripts: +man-pages: +redhat-rpm-config: +linux-firmware: + uninstall: true +linux-firmware-whence: + uninstall: true diff --git a/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/README.rst b/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/README.rst new file mode 100644 index 00000000..200dea04 --- /dev/null +++ b/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/README.rst @@ -0,0 +1 @@ +Verify we can build a rocky-container image. diff --git a/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/element-deps b/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/element-deps new file mode 100644 index 00000000..4be9e9fe --- /dev/null +++ b/diskimage_builder/elements/rocky-container/test-elements/build-succeeds/element-deps @@ -0,0 +1,2 @@ +openstack-ci-mirrors +vm