Add support for CentOS Stream 9 in DIB

CentOS Stream 9 is close to be released, and official mirrors are
already poplated. This patch is adding support to centos-minimal in CS9.

Also enable centos-minimal/[8,9]-stream-build-succeeds tests.

This patch is being tested together with [1] to apply following list of elements:

 vm centos-minimal simple-init growroot nodepool-base openstack-repos infra-package-needs

[1] https://review.opendev.org/c/openstack/project-config/+/811442

Change-Id: Iecf7f7e4c992bb23437b6461cdd04cdca96aafa6
changes/92/811392/20
Alfredo Moralejo 1 year ago
parent d5a01519c6
commit cdff9045c0
  1. 13
      .zuul.d/jobs.yaml
  2. 2
      .zuul.d/project.yaml
  3. 26
      contrib/setup-gate-mirrors.sh
  4. 6
      diskimage_builder/elements/bootloader/finalise.d/50-bootloader
  5. 1
      diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/README.rst
  6. 1
      diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/element-deps
  7. 1
      diskimage_builder/elements/centos-minimal/test-elements/9-stream-build-succeeds/environment.d/09-set-distro.bash
  8. 2
      diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/appstream.repo
  9. 2
      diskimage_builder/elements/centos-minimal/yum.repos.d/8-stream/base.repo
  10. 10
      diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/appstream.repo
  11. 10
      diskimage_builder/elements/centos-minimal/yum.repos.d/9-stream/base.repo
  12. 2
      diskimage_builder/elements/yum-minimal/package-installs.yaml
  13. 7
      diskimage_builder/elements/yum-minimal/pkg-map
  14. 6
      diskimage_builder/elements/yum-minimal/root.d/08-yum-chroot
  15. 1
      roles/dib-functests/tasks/main.yaml
  16. 16
      roles/dib-setup-gate-mirrors/tasks/main.yaml
  17. 6
      roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/appstream.repo.j2
  18. 6
      roles/dib-setup-gate-mirrors/templates/centos-minimal/9-stream/base.repo.j2
  19. 1
      tests/install_test_deps.sh

@ -105,6 +105,19 @@
# TODO: set when CentOS 8 Stream repos mirrored.
# mirror: "http://{{ zuul_site_mirror_fqdn }}/centos"
- job:
name: dib-nodepool-functional-openstack-centos-9-stream-src
description: |
Test building and booting a Centos 9 Stream image with Nodepool and
OpenStack.
parent: dib-nodepool-functional-src-base
vars:
nodepool_diskimage:
base_element: centos-minimal
release: '9-stream'
# TODO: set when CentOS 9 Stream repos mirrored.
# mirror: "http://{{ zuul_site_mirror_fqdn }}/centos"
- job:
name: dib-nodepool-functional-openstack-fedora-34-containerfile-src
description: |

@ -17,6 +17,7 @@
- dib-nodepool-functional-openstack-centos-7-src
- dib-nodepool-functional-openstack-centos-8-src
- dib-nodepool-functional-openstack-centos-8-stream-src
- dib-nodepool-functional-openstack-centos-9-stream-src
- dib-nodepool-functional-openstack-fedora-34-containerfile-src
- dib-nodepool-functional-openstack-ubuntu-xenial-src
- dib-nodepool-functional-openstack-ubuntu-bionic-src
@ -46,6 +47,7 @@
- dib-nodepool-functional-openstack-centos-7-src
- dib-nodepool-functional-openstack-centos-8-src
- dib-nodepool-functional-openstack-centos-8-stream-src
- dib-nodepool-functional-openstack-centos-9-stream-src
- dib-nodepool-functional-openstack-fedora-34-containerfile-src
- dib-nodepool-functional-openstack-ubuntu-xenial-src
- dib-nodepool-functional-openstack-ubuntu-bionic-src

@ -103,5 +103,31 @@ baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/extras/\$basearch/os/
gpgcheck=0
EOF
# Centos 8-stream Minimal
CENTOS_MIN_DIR=$BASE_DIR/centos-minimal/yum.repos.d/8-stream
mkdir -p $CENTOS_MIN_DIR
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-base.repo
[base]
name=CentOS-\$releasever - Base
baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/BaseOS/\$basearch/os/
gpgcheck=0
EOF
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-appstream.repo
[base]
name=CentOS-\$releasever - AppStream
baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/AppStream/\$basearch/os/
gpgcheck=0
EOF
cat <<EOF > $CENTOS_MIN_DIR/dib-mirror-extras.repo
#additional packages that may be useful
[extras]
name=CentOS-\$releasever - Extras
baseurl=$NODEPOOL_CENTOS_MIRROR/\$releasever/extras/\$basearch/os/
gpgcheck=0
EOF
## apt sources (todo)

@ -163,6 +163,12 @@ if grep -qe "^\s*GRUB_ENABLE_BLSCFG=true" /etc/default/grub; then
USE_GRUBBY=true
fi
# When building CentOS9 with centos-minimal /etc/default/grub does not exist
# after grub2-tools installation. However we need CS9 to use grubby.
if [[ "$DISTRO_NAME" == "centos" ]] && [[ $DIB_RELEASE =~ 9 ]]; then
USE_GRUBBY=true
fi
# Override the root device to the default label, and disable uuid
# lookup.
if [ -n "$USE_GRUBBY" ]; then

@ -1,5 +1,5 @@
[Stream-AppStream]
name=CentOS-Stream - AppStream
mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=AppStream
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream
gpgcheck=0

@ -1,5 +1,5 @@
[Stream-BaseOS]
name=CentOS-Stream - Base
mirrorlist=http://mirrorlist.centos.org/?release=8-stream&arch=$basearch&repo=BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS
gpgcheck=0

@ -0,0 +1,10 @@
[appstream]
name=CentOS Stream 9 - AppStream
metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-9-stream&arch=$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=0
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1

@ -0,0 +1,10 @@
[baseos]
name=CentOS Stream 9 - BaseOS
metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=$basearch
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgcheck=0
repo_gpgcheck=0
metadata_expire=6h
countme=1
enabled=1

@ -17,4 +17,4 @@ linux-firmware-whence:
# mirrors the default packages installed in upstream cloud images
# to facilitate a basic network.
NetworkManager:
dhcp-client:
dhcp-client:

@ -15,6 +15,13 @@
}
}
},
"release": {
"centos": {
"9-stream": {
"lsb_release": "ed hostname patch postfix tar time"
}
}
},
"family": {
"redhat": {
"lsb_release": "redhat-lsb-core"

@ -87,6 +87,8 @@ function _install_repos {
packages+="basesystem filesystem setup "
if [[ ${DISTRO_NAME} = fedora && ${DIB_RELEASE} -gt 29 ]]; then
packages+="fedora-release-cloud fedora-release-common "
elif [[ ${DISTRO_NAME} == 'centos' && ${DIB_RELEASE} = '9-stream' ]]; then
packages+="bash glibc ncurses-libs "
elif [[ ${DISTRO_NAME} == 'openeuler' ]]; then
packages+="openEuler-release "
else
@ -104,7 +106,7 @@ function _install_repos {
fi
# CentOS 8.1 split repositories and GPG keys out into subpackages
if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE} > "7" ]]; then
if [[ ${DISTRO_NAME} = centos && ${DIB_RELEASE%-stream} -gt 7 ]]; then
packages+="centos-gpg-keys "
if [[ "$DIB_RELEASE" =~ (stream) ]]; then
packages+="centos-stream-release centos-stream-repos "
@ -141,7 +143,7 @@ function _install_repos {
local temp_tmp
temp_tmp=$(mktemp -d)
TMPDIR=${temp_tmp} ${HOST_YUM_DOWNLOADER} --verbose \
--releasever=${DIB_RELEASE/-*/} \
--releasever=${DIB_RELEASE} \
--setopt=reposdir=$repo \
--setopt=cachedir=$temp_tmp \
--destdir=$WORKING \

@ -49,6 +49,7 @@
args:
executable: /bin/bash
become: yes
when: ansible_os_family == 'Debian'
- name: Run dib functional tests
shell:

@ -39,6 +39,22 @@
- appstream.repo
- extras.repo
- name: Create centos-minimal 9-stream directory
file:
path: "{{ dib_gate_mirror_repos }}/centos-minimal/9-stream/yum.repos.d"
state: directory
mode: 0775
recurse: yes
- name: Install centos-minimal 9-stream repo files
template:
dest: "{{ dib_gate_mirror_repos }}/centos-minimal/9-stream/yum.repos.d/dib-mirror-{{ item }}"
mode: 0644
src: "centos-minimal/9-stream/{{ item }}.j2"
with_items:
- base.repo
- appstream.repo
- name: Create fedora-minimal directories
file:
path: "{{ dib_gate_mirror_repos }}/fedora-minimal/{{ item }}/yum.repos.d"

@ -0,0 +1,6 @@
[Stream-AppStream]
name=CentOS-Stream - AppStream
# Switch to mirrors once available
metalink=https://mirrors.centos.org/metalink?repo=centos-appstream-9-stream&arch=$basearch
gpgcheck=0

@ -0,0 +1,6 @@
[Stream-BaseOS]
name=CentOS-Stream - BaseOS
# Switch to mirrors once available
metalink=https://mirrors.centos.org/metalink?repo=centos-baseos-9-stream&arch=$basearch
gpgcheck=0

@ -7,6 +7,7 @@ sudo apt-get update || true
sudo apt-get install -y --force-yes \
docker.io || \
sudo yum -y install --enablerepo=epel \
yum-utils \
debootstrap \
dpkg \
docker || \

Loading…
Cancel
Save