Skip to content

Commit 3785309

Browse files
committed
add basic CI back in
run on minimal branch push too
1 parent 9b01dfb commit 3785309

File tree

7 files changed

+152
-9
lines changed

7 files changed

+152
-9
lines changed

.github/workflows/ciab_ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
3+
on:
4+
push:
5+
branches:
6+
- 'stable/**'
7+
- 'minimal/**'
8+
pull_request:
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-22.04
13+
steps:
14+
- name: checkout chi-in-a-box
15+
uses: actions/checkout@v4
16+
with:
17+
submodules: true
18+
- name: Install uv
19+
uses: astral-sh/setup-uv@v5
20+
with:
21+
version: "0.6.4"
22+
- name: setup venv, chi-in-a-box, and site-config
23+
run: |
24+
testing/setup_ciab.sh testing/configs/base.yml
25+
- name: bootstrap servers
26+
run: |
27+
source .venv/bin/activate
28+
./cc-ansible --site site-config bootstrap-servers
29+
- name: prechecks
30+
run: |
31+
source .venv/bin/activate
32+
./cc-ansible --site site-config prechecks
33+
- name: deploy
34+
run: |
35+
source .venv/bin/activate
36+
./cc-ansible --site site-config deploy
37+
- name: post-deploy
38+
run: |
39+
source .venv/bin/activate
40+
./cc-ansible --site site-config post-deploy
41+
- name: set up tests
42+
run: |
43+
source .venv/bin/activate
44+
testing/setup_tests.sh
45+
# - name: run smoke tests
46+
# run: |
47+
# source .venv/bin/activate
48+
# rally verify start --pattern=smoke

site-config/globals.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,3 @@ keystone_admin_project: "openstack"
4343

4444
# for kvm on kvm
4545
nova_compute_virt_type: kvm
46-
47-
# haproxy IP to bind on api_network
48-
kolla_internal_vip_address: 172.16.201.254
49-
50-
# haproxy IP to bind on external_api_network
51-
kolla_external_vip_address: 172.16.202.254

site-config/inventory/host_vars/localhost

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
# therefore any provisioning can be done locally.
44
ansible_connection: local
55

6-
network_interface: eth0
7-
neutron_external_interface: eth1
8-
kolla_external_vip_interface: eth2
6+
# network_interface: eth0
7+
# kolla_external_vip_interface: eth1
8+
# neutron_external_interface: eth2

testing/configs/base.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# config for CI
2+
3+
ci_api_name: "fake_br"
4+
ci_neutron_name: "dummy1"
5+
6+
ci_api_ip: "172.18.200.10/24"
7+
ci_api_vip: "172.18.200.254"
8+
9+
# base case, single interface for api internal + external
10+
# second interface for neutron
11+
12+
kolla_internal_vip_address: "{{ ci_api_vip }}"
13+
network_interface: "{{ ci_api_name }}"
14+
neutron_external_interface: "{{ ci_neutron_name }}"

testing/setup_ciab.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
3+
# install uv
4+
# clone and checkout ciab
5+
# git submodule update --init
6+
# install python3, python3-venv
7+
8+
set -euo pipefail
9+
10+
# rm -rf .venv
11+
# rm -f site-config/passwords.yml
12+
# rm -f site-config/globals.yml
13+
14+
# load a yaml config to use.
15+
test_config="${1}"
16+
17+
# set ip addresses and ifaces
18+
./testing/setup_ifaces.sh \
19+
$(yq '.ci_api_name' $test_config) \
20+
$(yq '.ci_neutron_name' $test_config) \
21+
$(yq '.ci_api_ip' $test_config)
22+
23+
# set hostname
24+
sudo hostnamectl set-hostname "ciablocal"
25+
26+
uv venv .venv
27+
source .venv/bin/activate
28+
uv pip install \
29+
-r requirements.txt \
30+
git+https://github.com/openstack/kolla-ansible@unmaintained/2023.1
31+
32+
kolla-ansible install-deps
33+
34+
# setup passwords. Not overwriting to permit repeated runs
35+
cp --no-clobber site-config/passwords.yml{.example,}
36+
kolla-genpwd -p site-config/passwords.yml
37+
38+
# overwriting globals.yml with test config
39+
cat $test_config >> site-config/globals.yml
40+
41+
# ./cc-ansible --site site-config bootstrap-servers
42+
# ./cc-ansible --site site-config prechecks
43+
# ./cc-ansible --site site-config pull
44+
# ./cc-ansible --site site-config genconfig
45+
# ./cc-ansible --site site-config deploy
46+
# ./cc-ansible --site site-config post-deploy

testing/setup_ifaces.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/bash
2+
3+
# this script sets up network interfaces for chi-in-a-box to use
4+
# it is only useful for CI/CD purposes
5+
6+
set -x
7+
8+
function setup_ifaces {
9+
local api_name=$1
10+
local neutron_name=$2
11+
local api_ip=$3
12+
13+
sudo ip link add $api_name type bridge
14+
sudo ip link set $api_name up
15+
sudo ip addr add $api_ip dev $api_name
16+
17+
sudo ip link add kolla_veth type veth peer name $neutron_name
18+
sudo ip link set kolla_veth up
19+
sudo ip link set kolla_veth master $api_name
20+
21+
sudo ip link set $neutron_name up
22+
}
23+
24+
setup_ifaces $1 $2 $3

testing/setup_tests.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
source site-config/admin-openrc.sh
4+
5+
# set up rally tools
6+
rally db create
7+
rally deployment create --fromenv --name=existing
8+
rally deployment check
9+
10+
# create verifier to run tempest
11+
rally verify create-verifier --type tempest --name tempest-verifier
12+
13+
# print verifier config
14+
rally verify configure-verifier --show
15+
16+
# run smoke tests
17+
# rally verify start --pattern=smoke

0 commit comments

Comments
 (0)