Skip to content

Commit d43b5ac

Browse files
Merge pull request #1063 from Nordix/nuhakala/ci-suse-images
Add openSUSE Leap 15.6 node and CI images
2 parents 595e7d1 + 1d1ee21 commit d43b5ac

File tree

12 files changed

+200
-1
lines changed

12 files changed

+200
-1
lines changed

jenkins/image_building/build-image.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ elif [[ "${AGENT_OS}" == "centos" ]]; then
4343
sudo pip3 install virtualenv
4444

4545
python3 -m virtualenv venv
46+
elif [[ "${AGENT_OS}" == "opensuse-leap" ]]; then
47+
sudo zypper refresh
48+
sudo zypper -n in python3-devel python3-pip qemu
49+
50+
python3 -m venv venv
4651
else
4752
echo "Unsupported AGENT_OS: ${AGENT_OS}"
4853
exit 1
@@ -62,7 +67,7 @@ if [[ "${IMAGE_OS}" == "ubuntu" ]]; then
6267
# Setting upstrem Ubuntu 24.04 image
6368
export DIB_CLOUD_IMAGES="https://cloud-images.ubuntu.com/${DIB_RELEASE}/20250725"
6469
numeric_release=24.04
65-
else
70+
elif [[ "${IMAGE_OS}" == "centos" ]]; then
6671
numeric_release=9
6772
# Setting upstrem Centos 9 stream image
6873
centos_upstream_img="CentOS-Stream-GenericCloud-9-20250811.0.x86_64.qcow2"
@@ -71,6 +76,14 @@ else
7176
wget -O "${REPO_ROOT}/${centos_upstream_img}" "https://cloud.centos.org/centos/9-stream/x86_64/images/${centos_upstream_img}"
7277
fi
7378
export DIB_LOCAL_IMAGE="${REPO_ROOT}/${centos_upstream_img}"
79+
elif [[ "${IMAGE_OS}" == "leap" ]]; then
80+
numeric_release="15_6"
81+
export DIB_RELEASE="15.6"
82+
export DIB_BOOTLOADER_DEFAULT_CMDLINE="nofb nomodeset gfxpayload=text root=LABEL=cloudimg-rootfs"
83+
# Patch DIB source to accept openSUSE Leap 15.6
84+
# shellcheck disable=SC2016
85+
sed -i '8i15.6) export OPENSUSE_REPO_DIR=openSUSE_Leap_${DIB_RELEASE} ;;' \
86+
"${REPO_ROOT}"/venv/lib/python*/site-packages/diskimage_builder/elements/opensuse/environment.d/10-opensuse-distro-name.bash
7487
fi
7588

7689
if [[ "${IMAGE_TYPE}" == "node" ]]; then

jenkins/image_building/dib_elements/ci-base/pkg-map

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@
4444
"vim": "vim",
4545
"virt-manager": "virt-manager",
4646
"wget": "wget"
47+
},
48+
"suse":{
49+
"bash-completion":"bash-completion",
50+
"build-essential":"",
51+
"curl": "curl",
52+
"dnsmasq":"dnsmasq",
53+
"git": "git",
54+
"libguestfs-tools":"libguestfs",
55+
"libvirt-daemon-system":"libvirt-daemon",
56+
"make": "make",
57+
"openjdk-17-jre": "java-17-openjdk",
58+
"ovmf":"ovmf",
59+
"python3": "python3",
60+
"python3-pip":"python3-pip",
61+
"qemu-kvm":"qemu",
62+
"tree": "tree",
63+
"vim": "vim",
64+
"virt-manager": "virt-manager",
65+
"wget": "wget"
4766
}
4867
}
4968
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# leap-ci element
2+
3+
## Overview
4+
5+
**leap-ci** element installs packages and makes configuration changes
6+
specifically for leap-ci images. This element consists of two
7+
shell scripts: ***install*** which runs during the install.d phase, and
8+
***configure*** which runs during the post-install.d phase.
9+
10+
## Depends
11+
12+
* [opensuse](https://docs.openstack.org/diskimage-builder/latest/elements/opensuse/README.html)
13+
* ci-base
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
opensuse
2+
ci-base
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
## Install atop and sysstat
6+
sudo zypper refresh
7+
sudo zypper -n in atop sysstat
8+
9+
# Add metal3ci user to libvirt group
10+
sudo usermod -aG libvirt metal3ci
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
sudo sed -i "0,/.*PermitRootLogin.*/s//PermitRootLogin yes/" /etc/ssh/sshd_config
6+
7+
# SETUP MONITORING
8+
sudo zypper in -y sysstat atop atop-daemon cronie
9+
## Collect all metrics every minute
10+
sudo tee -a /etc/sysconfig/atop <<EOF
11+
LOGOPTS=""
12+
LOGINTERVAL=60
13+
LOGGENERATIONS=3
14+
LOGPATH=/var/log/atop
15+
EOF
16+
sudo mkdir -v /etc/systemd/system/sysstat-collect.timer.d/
17+
sudo sudo tee -a /etc/systemd/system/sysstat-collect.timer.d/override.conf <<EOF
18+
[Unit]
19+
Description=Run system activity accounting tool every 1 minutes
20+
[Timer]
21+
OnCalendar=*:00/1
22+
[Install]
23+
WantedBy=sysstat.service
24+
EOF
25+
sudo mkdir -p /var/log/sysstat
26+
sudo tee -a /etc/sysconfig/sysstat <<EOF
27+
HISTORY=3
28+
COMPRESSAFTER=31
29+
SADC_OPTIONS=" -S XALL"
30+
SA_DIR="/var/log/sysstat"
31+
ZIP="xz"
32+
#YESTERDAY=no
33+
#REPORTS=false
34+
DELAY_RANGE=0
35+
UMASK=0022
36+
EOF
37+
38+
## Enable services
39+
sudo systemctl enable atop.service cron.service sysstat.service
40+
41+
# Change default to shell to bash
42+
sudo usermod --shell /bin/bash metal3ci
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# leap-node element
2+
3+
## Overview
4+
5+
**leap-node** element installs packages and makes configuration changes
6+
specifically for leap-node images. This element consists of three
7+
shell scripts: ***setup-repos*** which runs during the pre-install.d phase,
8+
and ***install*** which runs during the install.d phase. Finally
9+
***pre-pull-images*** which runs during the post-install step.
10+
11+
## Depends
12+
13+
* [opensuse](https://docs.openstack.org/diskimage-builder/latest/elements/opensuse/README.html)
14+
* [base](https://docs.openstack.org/diskimage-builder/latest/elements/base/README.html)
15+
* [vm](https://docs.openstack.org/diskimage-builder/latest/elements/vm/README.html)
16+
* [devuser](https://docs.openstack.org/diskimage-builder/latest/elements/devuser/README.html)
17+
* [openssh-server](https://docs.openstack.org/diskimage-builder/latest/elements/openssh-server/README.html)
18+
* [package-installs](https://docs.openstack.org/diskimage-builder/latest/elements/package-installs/README.html)
19+
* [cloud-init-datasources](https://docs.openstack.org/diskimage-builder/latest/elements/cloud-init-datasources/README.html)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
opensuse
2+
base
3+
vm
4+
devuser
5+
openssh-server
6+
package-installs
7+
cloud-init-datasources
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env bash
2+
3+
set -eux
4+
5+
KUBERNETES_SLES_VERSION="${KUBERNETES_VERSION//v}"
6+
CRIO_SLES_VERSION="${CRIO_VERSION//v}"
7+
CRICTL_SLES_VERSION="${CRICTL_VERSION//v}"
8+
9+
sudo cat <<EOF | sudo tee /etc/modules-load.d/crio.conf
10+
overlay
11+
br_netfilter
12+
EOF
13+
14+
# Set up required sysctl params, these persist across reboots.
15+
sudo cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
16+
net.bridge.bridge-nf-call-iptables = 1
17+
net.ipv4.ip_forward = 1
18+
net.bridge.bridge-nf-call-ip6tables = 1
19+
EOF
20+
21+
sudo zypper -n in --repo kubernetes kubelet="${KUBERNETES_SLES_VERSION}" kubeadm="${KUBERNETES_SLES_VERSION}" kubectl="${KUBERNETES_SLES_VERSION}"
22+
sudo zypper -n in --repo CRI-O cri-o="${CRIO_SLES_VERSION}" cri-tools="${CRICTL_SLES_VERSION}"
23+
# keepalived is in the external oss repo, hence install it here.
24+
sudo zypper -n in keepalived
25+
# Install NM and enable it.
26+
sudo zypper -n in NetworkManager
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
conntrack-tools:
2+
ca-certificates:
3+
coreutils:
4+
gcc:
5+
git:
6+
gpg2:
7+
net-tools:
8+
openssl:
9+
socat:
10+
ethtool:
11+
iptables:
12+
keepalived:
13+
NetworkManager:

0 commit comments

Comments
 (0)