Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 38 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,48 @@ name: CI for chi-in-a-box script
on:
push:
branches:
- master
- main
- stable/*
pull_request:
branches:
- master
- main
- stable/*
workflow_dispatch: {}

jobs:
test:
name: test cc-ansible
runs-on: [self-hosted, kvm, ciab, ubuntu-18.04]
ci:
name: basic setup checks
runs-on: [ ubuntu-22.04 ]
env:
CC_ANSIBLE_SITE: /opt/site-config
defaults:
run:
shell: bash
steps:
- name: Checkout code base
uses: actions/checkout@v2
- name: init site-config
run: "./cc-ansible init"
continue-on-error: true
- run: "./cc-ansible bootstrap-servers"
- run: "./cc-ansible prechecks"
- run: "./cc-ansible pull"
- run: "./cc-ansible genconfig"

- name: checkout chi-in-a-box
uses: actions/checkout@v5
with:
submodules: true

- name: setup dummy network interfaces
run: tests/setup_ifaces.sh

- name: install deps
run: ./cc-ansible install_deps

- name: initialize site-config
run: ./cc-ansible init

# TODO: Parameterize config file choice
- name: configure site for test config
run: cp tests/configs/chi_edge.yaml ${CC_ANSIBLE_SITE}/defaults.yaml

- name: bootstrap system
run: ./cc-ansible bootstrap-servers

- name: pull containers
run: ./cc-ansible pull

- name: generate configs
run: ./cc-ansible genconfig

- name: deploy services
run: ./cc-ansible deploy
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "src/kolla-ansible"]
path = src/kolla-ansible
url = https://github.com/chameleoncloud/kolla-ansible
branch = chameleoncloud/2023.1
[submodule "kolla/node_custom_config/themes/chameleon_theme"]
path = kolla/node_custom_config/horizon/themes/chameleoncloud
url = https://github.com/ChameleonCloud/horizon-theme
22 changes: 4 additions & 18 deletions cc-ansible
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [shellcheck] reported by reviewdog 🐶
Double quote array expansions to avoid re-splitting elements. SC2068

${POSARGS[@]}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚫 [shellcheck] reported by reviewdog 🐶
Double quote array expansions to avoid re-splitting elements. SC2068

${POSARGS[@]}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
This function is never invoked. Check usage (or ignored if invoked indirectly). SC2329

_edit_passwords_cleanup() {

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [shellcheck] reported by reviewdog 🐶
ansible_path is referenced but not assigned. SC2154

playbook_file="$ansible_path/$(basename "$CC_ANSIBLE_PLAYBOOK")"

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: ./bin/activate: openBinaryFile: does not exist (No such file or directory) SC1091

source "${VIRTUALENV}/bin/activate"

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ done
#

install_deps() {
set -x
# install kolla-ansible, perform updates if necessary.

# create virtualenv
Expand All @@ -81,10 +82,7 @@ install_deps() {

git submodule update --init

pip install \
-r requirements.txt \
--config-settings editable_mode=strict \
-e src/kolla-ansible
pip install -r requirements.txt

# Update/install yq, adding it to the venv bin path
YQ_VERSION=4.9.6
Expand All @@ -96,7 +94,8 @@ install_deps() {

# install kolla-ansible galaxy deps. We use a subshell to drop back out of the venv afterwards
(source "${VIRTUALENV}/bin/activate" && kolla-ansible install-deps)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 [shellcheck] reported by reviewdog 🐶
Not following: ./bin/activate: openBinaryFile: does not exist (No such file or directory) SC1091



set +x
}

init() {
Expand Down Expand Up @@ -274,25 +273,12 @@ if [[ -f "$CC_ANSIBLE_ENV" ]]; then
set -a; source "$(realpath "$CC_ANSIBLE_ENV")"; set +a
fi

find_kolla_ansible_base_dir () {
kolla_direct_url="$(find ${VIRTUAL_ENV}/lib/ -wholename '*kolla_ansible*.dist-info/direct_url.json' -print -quit)"
if test -n "${kolla_direct_url}"; then
# Editable install in local path
direct_url="$(yq eval '.url' ${kolla_direct_url})"
BASEDIR="${direct_url#file:\/\/}"
else
BASEDIR="${VIRTUAL_ENV}/share/kolla-ansible"
fi
echo "${BASEDIR}/ansible"
}

# Handle subcommands
if [[ -n "${command:-}" ]]; then
$command "$@"
exit $?
fi

ansible_path="$(find_kolla_ansible_base_dir)"
if [[ -n "${CC_ANSIBLE_PLAYBOOK:-}" ]]; then
echo "**********************************************************************"
echo "* Playbook override detected! This playbook will be executed within *"
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# ansible version for kolla-ansible 2023.1 release
ansible >=6,<8
ansible >=6,<8
git+https://github.com/ChameleonCloud/kolla-ansible.git@chameleoncloud/2023.1
1 change: 0 additions & 1 deletion src/kolla-ansible
Submodule kolla-ansible deleted from 568df7
32 changes: 32 additions & 0 deletions tests/configs/chi_edge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---

### Overrides for edge configuration

enable_heat: false
enable_glance: false
enable_nova: false
enable_ironic: false

enable_k3s: yes
enable_zun: yes


# temp for debugging
enable_blazar: false
enable_doni: false
enable_tunelo: false

enable_central_logging: false
enable_prometheus: false


network_interface: veth-inta
kolla_internal_vip_address: 10.10.10.254
kolla_internal_fqdn: "{{ kolla_internal_vip_address }}"


kolla_external_vip_interface: veth-publica
kolla_external_vip_address: 192.168.200.254
kolla_external_fqdn: "{{ kolla_external_vip_address }}"

k3s_tag: c777a4a
18 changes: 18 additions & 0 deletions tests/setup_ifaces.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

# kolla public/external iface
sudo ip link add veth_publica type veth peer veth_publicb
sudo ip addr add 192.168.200.10/24 dev veth_publica
sudo ip link set veth_publica up
sudo ip link set veth_publicb up

# kolla internal iface
sudo ip link add veth_inta type veth peer veth_intb
sudo ip addr add 10.10.10.10/24 dev veth_inta
sudo ip link set veth_inta up
sudo ip link set veth_intb up

# neutron external iface
sudo ip link add veth_neutrona type veth peer veth_neutronb
sudo ip link set veth_neutrona up
sudo ip link set veth_neutronb up
Loading