From 3e87bc0e8405ffc4dd23ff75e233461aff923e01 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Fri, 5 Sep 2025 16:28:33 -0500 Subject: [PATCH 1/5] re-introduce basic ci/cd --- .github/workflows/ci.yml | 34 ++++++++++++++---------------- tests/setup_ciab.sh | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 19 deletions(-) create mode 100755 tests/setup_ciab.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ceacbdd4..ed1a7176 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,27 +4,23 @@ 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] - env: - CC_ANSIBLE_SITE: /opt/site-config - defaults: - run: - shell: bash + ci: + name: basic setup checks + runs-on: [ ubuntu-22.04 ] 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: run test script + run: tests/setup_ciab.sh diff --git a/tests/setup_ciab.sh b/tests/setup_ciab.sh new file mode 100755 index 00000000..a4c7e546 --- /dev/null +++ b/tests/setup_ciab.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# This script sets up chi-in-a-box for testing +# It assumes that you have already cloned the chi-in-a-box repository + +# Rather than assume anything about the network interfaces, it creates dummy interfaces +# for external and internal api networks + +# Features not tested! +# - federated identity +# - baremetal nodes +# - floating IPs + + +setup_networking () { + # Create dummy interfaces + + + # 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 +} + +### Start main section + +setup_networking + +# setup venv and install deps +./cc-ansible install_deps + +# initialize cc-ansible site +./cc-ansible init --site ../site-config From 6c123edd218f712aa3a22b2666be75abf97cf406 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Fri, 5 Sep 2025 16:39:59 -0500 Subject: [PATCH 2/5] try again --- .github/workflows/ci.yml | 29 ++++++++++++++++++++++-- tests/configs/chi_edge.yaml | 32 ++++++++++++++++++++++++++ tests/setup_ciab.sh | 45 ------------------------------------- tests/setup_ifaces.sh | 18 +++++++++++++++ 4 files changed, 77 insertions(+), 47 deletions(-) create mode 100644 tests/configs/chi_edge.yaml delete mode 100755 tests/setup_ciab.sh create mode 100755 tests/setup_ifaces.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed1a7176..9bc5b6aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,36 @@ jobs: ci: name: basic setup checks runs-on: [ ubuntu-22.04 ] + env: + CC_ANSIBLE_SITE: /opt/site-config steps: + - name: checkout chi-in-a-box uses: actions/checkout@v5 with: submodules: true - - name: run test script - run: tests/setup_ciab.sh + - 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 diff --git a/tests/configs/chi_edge.yaml b/tests/configs/chi_edge.yaml new file mode 100644 index 00000000..aa0467ec --- /dev/null +++ b/tests/configs/chi_edge.yaml @@ -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 diff --git a/tests/setup_ciab.sh b/tests/setup_ciab.sh deleted file mode 100755 index a4c7e546..00000000 --- a/tests/setup_ciab.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# This script sets up chi-in-a-box for testing -# It assumes that you have already cloned the chi-in-a-box repository - -# Rather than assume anything about the network interfaces, it creates dummy interfaces -# for external and internal api networks - -# Features not tested! -# - federated identity -# - baremetal nodes -# - floating IPs - - -setup_networking () { - # Create dummy interfaces - - - # 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 -} - -### Start main section - -setup_networking - -# setup venv and install deps -./cc-ansible install_deps - -# initialize cc-ansible site -./cc-ansible init --site ../site-config diff --git a/tests/setup_ifaces.sh b/tests/setup_ifaces.sh new file mode 100755 index 00000000..55b19ad8 --- /dev/null +++ b/tests/setup_ifaces.sh @@ -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 From 68c8dd4a4de6039e12bb5ec6c28d8bd83a6f4840 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Fri, 5 Sep 2025 16:49:15 -0500 Subject: [PATCH 3/5] add debug logs --- cc-ansible | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cc-ansible b/cc-ansible index bf115605..a96e4da6 100755 --- a/cc-ansible +++ b/cc-ansible @@ -56,6 +56,7 @@ done # install_deps() { + set -x # install kolla-ansible, perform updates if necessary. # create virtualenv @@ -94,9 +95,12 @@ install_deps() { | tar xz && mv ${YQ_BINARY} "$VIRTUALENV/bin/yq" fi + echo $(env) + # 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) - + + set +x } init() { From e9584182afe30a674aa43b249cb3dfd016e9fb23 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Fri, 5 Sep 2025 16:58:33 -0500 Subject: [PATCH 4/5] install KA from git repo, not submodule --- .gitmodules | 4 ---- cc-ansible | 7 +------ requirements.txt | 3 ++- src/kolla-ansible | 1 - 4 files changed, 3 insertions(+), 12 deletions(-) delete mode 160000 src/kolla-ansible diff --git a/.gitmodules b/.gitmodules index d100f6c3..e1750f92 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/cc-ansible b/cc-ansible index a96e4da6..3d33246e 100755 --- a/cc-ansible +++ b/cc-ansible @@ -82,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 @@ -95,8 +92,6 @@ install_deps() { | tar xz && mv ${YQ_BINARY} "$VIRTUALENV/bin/yq" fi - echo $(env) - # 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) diff --git a/requirements.txt b/requirements.txt index f8bacf33..bbcda6f6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ # ansible version for kolla-ansible 2023.1 release -ansible >=6,<8 \ No newline at end of file +ansible >=6,<8 +git+https://github.com/ChameleonCloud/kolla-ansible.git@chameleoncloud/2023.1 diff --git a/src/kolla-ansible b/src/kolla-ansible deleted file mode 160000 index 568df787..00000000 --- a/src/kolla-ansible +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 568df787eeba52116c081ba575c60152242d7135 From 0aaf5129a4cbbadca6e43100cfe013a46ec58665 Mon Sep 17 00:00:00 2001 From: Michael Sherman Date: Fri, 5 Sep 2025 17:01:15 -0500 Subject: [PATCH 5/5] get rid of basedir stuff --- cc-ansible | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/cc-ansible b/cc-ansible index 3d33246e..7d6558d1 100755 --- a/cc-ansible +++ b/cc-ansible @@ -273,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 *"