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