Skip to content

Commit 33fed53

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Add support for Rocky Linux"
2 parents 8790973 + 4e6e8f0 commit 33fed53

File tree

14 files changed

+71
-12
lines changed

14 files changed

+71
-12
lines changed

devstack/plugin.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ function octavia_install {
1818
if ! [ "$DISABLE_AMP_IMAGE_BUILD" == 'True' ]; then
1919
if [[ ${DISTRO} =~ (rhel|centos) ]]; then
2020
install_package qemu-kvm
21+
if [[ "$OCTAVIA_AMP_BASE_OS" == "rocky" ]]; then
22+
# DIB requires podman for building rockylinux images.
23+
install_package podman
24+
fi
2125
else
2226
install_package qemu
2327
fi
@@ -134,6 +138,8 @@ function build_octavia_worker_image {
134138
fi
135139
sudo mkdir -m755 ${dib_logs}
136140
sudo chown $STACK_USER ${dib_logs}
141+
# Workaround for rockylinux images
142+
export DIB_CONTAINERFILE_RUNTIME_ROOT=1
137143
$OCTAVIA_DIR/diskimage-create/diskimage-create.sh -l ${dib_logs}/$(basename $OCTAVIA_AMP_IMAGE_FILE).log $octavia_dib_tracing_arg -o $OCTAVIA_AMP_IMAGE_FILE ${PARAM_OCTAVIA_AMP_BASE_OS:-} ${PARAM_OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID:-} ${PARAM_OCTAVIA_AMP_IMAGE_SIZE:-} ${PARAM_OCTAVIA_AMP_IMAGE_ARCH:-} ${PARAM_OCTAVIA_AMP_DISABLE_TMP_FS:-} ${PARAM_OCTAVIA_AMP_ENABLE_FIPS:-}
138144
fi
139145

@@ -490,8 +496,20 @@ function create_mgmt_network_interface {
490496
fi
491497
sudo ip link set dev o-hm0 address $MGMT_PORT_MAC
492498

499+
function _get_firewall () {
500+
# The devstack CI forces the use of iptables, the openstack-INPUT table
501+
# can be used to indicate it.
502+
if sudo iptables -L -n -v | grep openstack-INPUT; then
503+
echo "iptables"
504+
elif [[ -x $(which nft 2> /dev/null) ]]; then
505+
echo "nft"
506+
else
507+
echo "iptables"
508+
fi
509+
}
510+
493511
# Check if the host is using nftables, an alternative to iptables
494-
if [ -x "$(sudo bash -c 'command -v nft')" ]; then
512+
if [[ $(_get_firewall) == "nft" ]]; then
495513
sudo nft add table inet octavia
496514
sudo nft add chain inet octavia o-hm0-incoming { type filter hook input priority 0\;}
497515
sudo nft flush chain inet octavia o-hm0-incoming

diskimage-create/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Command syntax:
107107
[-f]
108108
[-g **repository branch** | stable/train | stable/stein | ... ]
109109
[-h]
110-
[-i **ubuntu-minimal** | fedora | centos-minimal | rhel ]
110+
[-i **ubuntu-minimal** | fedora | centos-minimal | rhel | rocky ]
111111
[-k <kernel package name> ]
112112
[-l <log file> ]
113113
[-m]

diskimage-create/diskimage-create.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ usage() {
2828
echo " [-f]"
2929
echo " [-g **repository branch** | stable/train | stable/stein | ... ]"
3030
echo " [-h]"
31-
echo " [-i **ubuntu-minimal** | fedora | centos-minimal | rhel ]"
31+
echo " [-i **ubuntu-minimal** | fedora | centos-minimal | rhel | rocky ]"
3232
echo " [-k <kernel package name> ]"
3333
echo " [-l <log file> ]"
3434
echo " [-m]"
@@ -150,6 +150,7 @@ while getopts "a:b:c:d:efg:hi:k:l:mno:pt:r:s:vw:xy" opt; do
150150
[ "$AMP_BASEOS" != "fedora" ] && \
151151
[ "$AMP_BASEOS" != "centos" ] && \
152152
[ "$AMP_BASEOS" != "centos-minimal" ] && \
153+
[ "$AMP_BASEOS" != "rocky" ] && \
153154
[ "$AMP_BASEOS" != "rhel" ]; then
154155
echo "Error: Unsupported base OS $AMP_BASEOS specified"
155156
exit 3
@@ -160,6 +161,9 @@ while getopts "a:b:c:d:efg:hi:k:l:mno:pt:r:s:vw:xy" opt; do
160161
if [ "$AMP_BASEOS" == "centos" ]; then
161162
AMP_BASEOS="centos-minimal"
162163
fi
164+
if [ "$AMP_BASEOS" == "rocky" ]; then
165+
AMP_BASEOS="rocky-container"
166+
fi
163167
;;
164168
k)
165169
AMP_KERNEL=$OPTARG
@@ -245,6 +249,8 @@ elif [ "${AMP_BASEOS}" = "centos-minimal" ]; then
245249
export DIB_RELEASE=${AMP_DIB_RELEASE:-"9-stream"}
246250
elif [ "${AMP_BASEOS}" = "fedora" ]; then
247251
export DIB_RELEASE=${AMP_DIB_RELEASE:-"28"}
252+
elif [ "${AMP_BASEOS}" = "rocky-container" ]; then
253+
export DIB_RELEASE=${AMP_DIB_RELEASE:-"9"}
248254
fi
249255

250256
AMP_OUTPUTFILENAME=${AMP_OUTPUTFILENAME:-"$PWD/amphora-x64-haproxy.qcow2"}
@@ -454,7 +460,7 @@ AMP_element_sequence="$AMP_element_sequence cloud-init-datasources"
454460
AMP_element_sequence="$AMP_element_sequence remove-default-ints"
455461

456462
# SELinux systems
457-
if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [ "${AMP_BASEOS}" = "rhel" ]; then
463+
if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [ "${AMP_BASEOS}" = "rhel" ] || [ "${AMP_BASEOS}" = "rocky-container" ]; then
458464
if [ "$AMP_ENABLE_FULL_MAC_SECURITY" -ne 1 ]; then
459465
AMP_element_sequence="$AMP_element_sequence selinux-permissive"
460466
else
@@ -464,7 +470,7 @@ if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [
464470
fi
465471

466472
# Disable the dnf makecache timer
467-
if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [ "${AMP_BASEOS}" = "rhel" ]; then
473+
if [ "${AMP_BASEOS}" = "centos-minimal" ] || [ "${AMP_BASEOS}" = "fedora" ] || [ "${AMP_BASEOS}" = "rhel" ] || [ "${AMP_BASEOS}" = "rocky-container" ]; then
468474
AMP_element_sequence="$AMP_element_sequence disable-makecache"
469475
fi
470476

elements/amphora-agent/pkg-map

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,19 @@
4141
"dkms": "",
4242
"network-scripts": ""
4343
}
44+
},
45+
"rocky": {
46+
"9": {
47+
"curl": "curl-minimal",
48+
"isc-dhcp-client": "dhcp-client",
49+
"python3-dev": "platform-python-devel",
50+
"python3-venv": "",
51+
"python3": "python39",
52+
"vlan": "",
53+
"screen": "",
54+
"dkms": "",
55+
"network-scripts": ""
56+
}
4457
}
4558
},
4659
"family": {

elements/amphora-agent/post-install.d/90-remove-build-deps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ case $DISTRO_NAME in
1515
ubuntu | debian )
1616
apt-get --assume-yes purge --auto-remove
1717
;;
18-
fedora | centos* | rhel* )
18+
fedora | centos* | rhel* | rocky )
1919
YUM=${YUM:-yum}
2020
${YUM} -v -y autoremove
2121
;;

elements/amphora-fips/environment.d/95-enable-fips

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ case $DISTRO_NAME in
1212
echo "ERROR: $DISTRO_NAME is not supported for FIPS mode."
1313
exit 1
1414
;;
15-
fedora | centos* | rhel* )
15+
fedora | centos* | rhel* | rocky )
1616
DIB_DRACUT_ENABLED_MODULES+="
1717
- name: fips
1818
"

elements/amphora-fips/post-install.d/10-enable-fips

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ case $DISTRO_NAME in
1212
echo "ERROR: $DISTRO_NAME is not supported for FIPS mode."
1313
exit 1
1414
;;
15-
fedora | centos* | rhel* )
15+
fedora | centos* | rhel* | rocky )
1616
update-crypto-policies --no-reload --set FIPS
1717
;;
1818
*)

elements/cpu-pinning/environment.d/80-kernel-cpu-affinity

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
set -euo pipefail
2424

2525
case $DISTRO_NAME in
26-
ubuntu | debian | fedora | centos* | rhel* )
26+
ubuntu | debian | fedora | centos* | rhel* | rocky )
2727
DIB_BOOTLOADER_DEFAULT_CMDLINE+=" irqaffinity=0"
2828
# This will be ignored on single vCPU systems
2929
DIB_BOOTLOADER_DEFAULT_CMDLINE+=" isolcpus=1-N"

elements/disable-makecache/post-install.d/80-disable-makecache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set -eu
88
set -o pipefail
99

1010
case $DISTRO_NAME in
11-
fedora | centos* | rhel* )
11+
fedora | centos* | rhel* | rocky )
1212
systemctl disable dnf-makecache.timer || true
1313
;;
1414
*)

elements/haproxy-octavia/post-install.d/20-haproxy-user-group-config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ case $DISTRO_NAME in
77
ubuntu | debian )
88
HAPROXY_USER_GROUP=nogroup
99
;;
10-
fedora | centos* | rhel* )
10+
fedora | centos* | rhel* | rocky )
1111
HAPROXY_USER_GROUP=haproxy
1212
;;
1313
*)

octavia/amphorae/backends/agent/api_server/osutils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class RH(BaseOS):
116116

117117
@classmethod
118118
def is_os_name(cls, os_name):
119-
return os_name in ['fedora', 'rhel']
119+
return os_name in ['fedora', 'rhel', 'rocky']
120120

121121
def cmd_get_version_of_installed_package(self, package_name):
122122
name = self._map_package_name(package_name)

playbooks/image-build/run.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
- qemu-kvm
5151
- python3-setuptools
5252
- yum
53+
- podman
5354
when:
5455
- ansible_os_family == 'RedHat'
5556
- name: Install required pip packages
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
features:
3+
- |
4+
Added support for Rocky Linux controllers in devstack.
5+
- |
6+
Added support for Rocky Linux amphora images. To enable it, users have to
7+
build their amphora images with the ``OCTAVIA_AMP_BASE_OS=rocky`` and
8+
``OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID=9`` parameters.

zuul.d/jobs.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,19 @@
223223
amphora_os: centos
224224
amphora_os_release: 9-stream
225225

226+
- job:
227+
name: octavia-amphora-image-build-live-rocky-9
228+
parent: octavia-amphora-image-build
229+
nodeset: centos-9-stream
230+
description: |
231+
Builds a Rocky Linux 9 amphora image using diskimage-builder from Git
232+
master. This job does not publish the image.
233+
required-projects:
234+
- openstack/diskimage-builder
235+
vars:
236+
amphora_os: rocky
237+
amphora_os_release: 9
238+
226239
- job:
227240
name: octavia-v2-dsvm-scenario-nftables
228241
parent: octavia-v2-dsvm-scenario

0 commit comments

Comments
 (0)