Skip to content

Commit 40e67b7

Browse files
committed
test Zuul CI
1 parent 72d31ec commit 40e67b7

31 files changed

+867
-0
lines changed
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
2+
#!/bin/bash
3+
4+
###########################################
5+
# STACKHPC-KAYOBE-CONFIG ci-tenks VERSION #
6+
###########################################
7+
8+
# Script for a full deployment.
9+
10+
set -eu
11+
12+
BASE_PATH=~
13+
KAYOBE_BRANCH=stackhpc/2025.1
14+
KAYOBE_CONFIG_REF=${KAYOBE_CONFIG_REF:-stackhpc/2025.1}
15+
KAYOBE_ENVIRONMENT=${KAYOBE_ENVIRONMENT:-ci-tenks}
16+
17+
# Install git and tmux.
18+
if $(which dnf 2>/dev/null >/dev/null); then
19+
sudo dnf -y install git tmux
20+
else
21+
sudo apt update
22+
sudo apt -y install git tmux gcc libffi-dev python3-dev python-is-python3 python3-pip python3.12-venv
23+
fi
24+
25+
# Disable the firewall.
26+
sudo systemctl is-enabled firewalld && sudo systemctl stop firewalld && sudo systemctl disable firewalld || true
27+
28+
# Disable SELinux both immediately and permanently.
29+
if $(which setenforce 2>/dev/null >/dev/null); then
30+
sudo setenforce 0
31+
sudo sed -i 's/^SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
32+
fi
33+
34+
# Prevent sudo from performing DNS queries.
35+
echo 'Defaults q!fqdn' | sudo tee /etc/sudoers.d/no-fqdn
36+
37+
# Clone repositories
38+
cd $BASE_PATH
39+
mkdir -p src
40+
pushd src
41+
[[ -d kayobe ]] || git clone https://github.com/stackhpc/kayobe.git -b $KAYOBE_BRANCH
42+
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/stackhpc-kayobe-config kayobe-config -b $KAYOBE_CONFIG_REF
43+
[[ -d kayobe/tenks ]] || (cd kayobe && git clone https://opendev.org/openstack/tenks.git)
44+
popd
45+
46+
# Create Kayobe virtualenv
47+
mkdir -p venvs
48+
pushd venvs
49+
if [[ ! -d kayobe ]]; then
50+
python3.12 -m venv kayobe
51+
fi
52+
# NOTE: Virtualenv's activate and deactivate scripts reference an
53+
# unbound variable.
54+
set +u
55+
source kayobe/bin/activate
56+
set -u
57+
pip install -U pip
58+
pip install -r ../src/kayobe-config/requirements.txt
59+
popd
60+
61+
# Activate environment
62+
pushd $BASE_PATH/src/kayobe-config
63+
source kayobe-env --environment $KAYOBE_ENVIRONMENT
64+
65+
# Configure host networking (bridge, routes & firewall)
66+
sudo $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/configure-local-networking.sh
67+
68+
# Bootstrap the Ansible control host.
69+
kayobe control host bootstrap
70+
71+
# Configure the seed hypervisor host.
72+
kayobe seed hypervisor host configure
73+
74+
# Provision the seed VM.
75+
kayobe seed vm provision
76+
77+
# Configure the seed host, and deploy a local registry.
78+
kayobe seed host configure
79+
80+
# Deploy local pulp server as a container on the seed VM
81+
kayobe seed service deploy --tags seed-deploy-containers --kolla-tags none
82+
83+
# Deploying the seed restarts networking interface, run configure-local-networking.sh again to re-add routes.
84+
sudo $KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/configure-local-networking.sh
85+
86+
# Sync package & container repositories.
87+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-repo-sync.yml
88+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-repo-publish.yml
89+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-container-sync.yml -e stackhpc_pulp_images_kolla_filter=bifrost
90+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/pulp-container-publish.yml -e stackhpc_pulp_images_kolla_filter=bifrost
91+
92+
# Re-run full task to set up bifrost_deploy etc. using newly-populated pulp repo
93+
kayobe seed service deploy
94+
95+
# NOTE: Make sure to use ./tenks, since just ‘tenks’ will install via PyPI.
96+
(export TENKS_CONFIG_PATH=$KAYOBE_CONFIG_PATH/environments/$KAYOBE_ENVIRONMENT/tenks.yml && \
97+
export KAYOBE_CONFIG_SOURCE_PATH=$BASE_PATH/src/kayobe-config && \
98+
export KAYOBE_VENV_PATH=$BASE_PATH/venvs/kayobe && \
99+
cd $BASE_PATH/src/kayobe && \
100+
./dev/tenks-deploy-overcloud.sh ./tenks)
101+
102+
# Inspect and provision the overcloud hardware:
103+
kayobe overcloud inventory discover
104+
kayobe overcloud hardware inspect
105+
kayobe overcloud provision
106+
kayobe overcloud host configure
107+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/cephadm.yml
108+
kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/cephadm-gather-keys.yml
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
---
2+
###############################################################################
3+
# Cephadm deployment configuration.
4+
5+
# List of additional cephadm commands to run before deployment
6+
# cephadm_commands:
7+
# - "config set global osd_pool_default_size {{ [3, groups['osds'] | length] | min }}"
8+
# - "config set global osd_pool_default_min_size {{ [3, groups['osds'] | length] | min }}"
9+
10+
# Ceph OSD specification.
11+
cephadm_osd_spec:
12+
service_type: osd
13+
service_id: osd_spec_default
14+
placement:
15+
host_pattern: "*"
16+
data_devices:
17+
all: true
18+
19+
###############################################################################
20+
# Ceph post-deployment configuration.
21+
22+
# List of Ceph erasure coding profiles. See stackhpc.cephadm.ec_profiles role
23+
# for format.
24+
cephadm_ec_profiles: []
25+
26+
# List of Ceph CRUSH rules. See stackhpc.cephadm.crush_rules role for format.
27+
cephadm_crush_rules: []
28+
29+
# List of Ceph pools. See stackhpc.cephadm.pools role for format.
30+
cephadm_pools:
31+
- name: backups
32+
application: rbd
33+
state: present
34+
- name: images
35+
application: rbd
36+
state: present
37+
- name: volumes
38+
application: rbd
39+
state: present
40+
- name: vms
41+
application: rbd
42+
state: present
43+
44+
# List of Cephx keys. See stackhpc.cephadm.keys role for format.
45+
cephadm_keys:
46+
- name: client.cinder
47+
caps:
48+
mon: "profile rbd"
49+
osd: "profile rbd pool=volumes, profile rbd pool=vms, profile rbd-read-only pool=images"
50+
mgr: "profile rbd pool=volumes, profile rbd pool=vms"
51+
state: present
52+
- name: client.cinder-backup
53+
caps:
54+
mon: "profile rbd"
55+
osd: "profile rbd pool=volumes, profile rbd pool=backups"
56+
mgr: "profile rbd pool=volumes, profile rbd pool=backups"
57+
state: present
58+
- name: client.glance
59+
caps:
60+
mon: "profile rbd"
61+
osd: "profile rbd pool=images"
62+
mgr: "profile rbd pool=images"
63+
state: present
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!/bin/bash
2+
3+
set -e
4+
set -o pipefail
5+
6+
# This should be run on the seed hypervisor.
7+
8+
# IP addresses on the all-in-one Kayobe cloud network.
9+
# These IP addresses map to those statically configured in
10+
# etc/kayobe/network-allocation.yml and etc/kayobe/networks.yml.
11+
controller_vip=192.168.39.2
12+
seed_hv_ip=192.168.33.4
13+
14+
iface=$(ip route | awk '$1 == "default" {print $5; exit}')
15+
16+
# Private IP address by which the seed hypervisor is accessible in the cloud
17+
# hosting the VM.
18+
seed_hv_private_ip=$(ip a show dev $iface | awk '$1 == "inet" { gsub(/\/[0-9]*/,"",$2); print $2; exit }')
19+
20+
# Forward the following ports to the controller.
21+
# 80: Horizon
22+
# 6080: VNC console
23+
forwarded_ports="80 6080"
24+
25+
# Install iptables.
26+
if $(which dnf >/dev/null 2>&1); then
27+
sudo dnf -y install iptables
28+
else
29+
sudo apt update
30+
sudo apt -y install iptables
31+
fi
32+
33+
# Configure local networking.
34+
# Add bridges for the Kayobe networks.
35+
if ! sudo ip l show brprov >/dev/null 2>&1; then
36+
sudo ip l add brprov type bridge
37+
sudo ip l set brprov up
38+
sudo ip a add $seed_hv_ip/24 dev brprov
39+
fi
40+
41+
if ! sudo ip l show brcloud >/dev/null 2>&1; then
42+
sudo ip l add brcloud type bridge
43+
sudo ip l set brcloud up
44+
fi
45+
46+
# On Rocky Linux, bridges without a port are DOWN, which causes network
47+
# configuration to fail. Add a dummy interface and plug it into the bridge.
48+
for i in mgmt prov cloud; do
49+
if ! sudo ip l show dummy-$i >/dev/null 2>&1; then
50+
sudo ip l add dummy-$i type dummy
51+
fi
52+
done
53+
54+
# Configure IP routing and NAT to allow the seed VM and overcloud hosts to
55+
# route via this route to the outside world.
56+
sudo iptables -A POSTROUTING -t nat -o $iface -j MASQUERADE
57+
sudo sysctl -w net.ipv4.conf.all.forwarding=1
58+
59+
# FIXME: IP MASQUERADE from control plane fails without this on Ubuntu.
60+
if ! $(which dnf >/dev/null 2>&1); then
61+
sudo modprobe br_netfilter
62+
echo 0 | sudo tee /proc/sys/net/bridge/bridge-nf-call-iptables
63+
fi
64+
65+
# Configure port forwarding from the hypervisor to the Horizon GUI on the
66+
# controller.
67+
sudo iptables -A FORWARD -i $iface -o brprov -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
68+
sudo iptables -A FORWARD -i brprov -o $iface -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
69+
for port in $forwarded_ports; do
70+
# Allow new connections.
71+
sudo iptables -A FORWARD -i $iface -o brcloud -p tcp --syn --dport $port -m conntrack --ctstate NEW -j ACCEPT
72+
# Destination NAT.
73+
sudo iptables -t nat -A PREROUTING -i $iface -p tcp --dport $port -j DNAT --to-destination $controller_vip
74+
# Source NAT.
75+
sudo iptables -t nat -A POSTROUTING -o brcloud -p tcp --dport $port -d $controller_vip -j SNAT --to-source $seed_hv_private_ip
76+
done
77+
78+
echo
79+
echo "NOTE: The network configuration applied by this script is not"
80+
echo "persistent across reboots."
81+
echo "If you reboot the system, please re-run this script."
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
# Kayobe global configuration.
3+
4+
###############################################################################
5+
# OS distribution.
6+
7+
# OS distribution name. Valid options are "rocky", "ubuntu". Default is
8+
# "rocky".
9+
os_distribution: "{{ lookup('pipe', '. /etc/os-release && echo $ID') | trim }}"
10+
11+
# OS release. Valid options are "9" when os_distribution is "rocky", or
12+
# "noble" when os_distribution is "ubuntu".
13+
os_release: >-
14+
{{ (lookup('pipe', '. /etc/os-release && echo $VERSION_CODENAME') | trim) if os_distribution == 'ubuntu' else
15+
(lookup('pipe', '. /etc/os-release && echo $VERSION_ID') | trim | split('.') | first) if os_distribution == 'rocky' }}
16+
17+
###############################################################################
18+
# Extra vars.
19+
20+
# Don't prompt when rebooting hosts.
21+
confirm_reboot: true
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
###############################################################################
3+
# Network interface definitions for the compute group.
4+
5+
provision_oc_interface: "{{ 'ens2' if os_distribution == 'ubuntu' else 'eth0' }}"
6+
# Route via the seed-hypervisor to the outside world.
7+
provision_oc_gateway: 192.168.33.4
8+
9+
internal_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ internal_vlan }}"
10+
11+
storage_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ storage_vlan }}"
12+
13+
tunnel_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ tunnel_vlan }}"
14+
15+
external_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ external_vlan }}"
16+
17+
###############################################################################
18+
# Dummy variable to allow Ansible to accept this file.
19+
workaround_ansible_issue_8743: yes
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
###############################################################################
3+
# Network interface definitions for the controller group.
4+
5+
provision_oc_interface: "{{ 'ens2' if os_distribution == 'ubuntu' else 'eth0' }}"
6+
# Route via the seed-hypervisor to the outside world.
7+
provision_oc_gateway: 192.168.33.4
8+
9+
mgmt_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}"
10+
11+
provision_wl_interface: "br{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}"
12+
provision_wl_bridge_ports:
13+
- "{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}"
14+
15+
internal_interface: "{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}.{{ internal_vlan }}"
16+
17+
external_interface: "br{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}.{{ external_vlan }}"
18+
19+
public_interface: "{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}.{{ public_vlan }}"
20+
21+
storage_interface: "{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}.{{ storage_vlan }}"
22+
23+
tunnel_interface: "{{ 'ens4' if os_distribution == 'ubuntu' else 'eth2' }}.{{ tunnel_vlan }}"
24+
25+
###############################################################################
26+
# Dummy variable to allow Ansible to accept this file.
27+
workaround_ansible_issue_8743: yes
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
mgmt_interface: brmgmt
3+
mgmt_bridge_ports:
4+
- dummy-mgmt
5+
6+
provision_oc_interface: brprov
7+
provision_oc_bridge_ports:
8+
- dummy-prov
9+
10+
provision_wl_interface: brcloud
11+
provision_wl_bridge_ports:
12+
- dummy-cloud
13+
14+
internal_interface: "{{ provision_wl_interface }}.{{ internal_vlan }}"
15+
16+
public_interface: "{{ provision_wl_interface }}.{{ public_vlan }}"
17+
18+
external_interface: "{{ provision_wl_interface }}.{{ external_vlan }}"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
###############################################################################
3+
# Network interface definitions for the seed group.
4+
5+
mgmt_interface: "{{ 'ens2' if os_distribution == 'ubuntu' else 'eth0' }}"
6+
7+
provision_oc_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}"
8+
# Route via the seed-hypervisor to the outside world.
9+
provision_oc_gateway: 192.168.33.4
10+
11+
###############################################################################
12+
# Dummy variable to allow Ansible to accept this file.
13+
workaround_ansible_issue_8743: yes
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
###############################################################################
3+
# Network interface definitions for the compute group.
4+
5+
provision_oc_interface: "{{ 'ens2' if os_distribution == 'ubuntu' else 'eth0' }}"
6+
# Route via the seed-hypervisor to the outside world.
7+
provision_oc_gateway: 192.168.33.4
8+
9+
internal_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ internal_vlan }}"
10+
11+
storage_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ storage_vlan }}"
12+
13+
storage_mgmt_interface: "{{ 'ens3' if os_distribution == 'ubuntu' else 'eth1' }}.{{ storage_mgmt_vlan }}"
14+
15+
###############################################################################
16+
# Dummy variable to allow Ansible to accept this file.
17+
workaround_ansible_issue_8743: yes

0 commit comments

Comments
 (0)