Skip to content

Commit

Permalink
Merge branch 'stackhpc:stackhpc/yoga' into stackhpc/yoga
Browse files Browse the repository at this point in the history
  • Loading branch information
scrungus authored May 23, 2023
2 parents f1157fe + ecd3f04 commit c4eab14
Show file tree
Hide file tree
Showing 27 changed files with 656 additions and 27 deletions.
245 changes: 245 additions & 0 deletions .github/workflows/overcloud-host-image-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
---
name: Build overcloud host images
on:
workflow_dispatch:
inputs:
centos:
description: Build CentOS Stream 8
type: boolean
default: true
rocky8:
description: Build Rocky Linux 8
type: boolean
default: true
rocky9:
description: Build Rocky Linux 9
type: boolean
default: true
ubuntu-focal:
description: Build Ubuntu 20.04 Focal
type: boolean
default: true
ubuntu-jammy:
description: Build Ubuntu 22.04 Jammy
type: boolean
default: true

env:
ANSIBLE_FORCE_COLOR: True
jobs:
overcloud-host-image-build:
name: Build overcloud host images
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
runs-on: [self-hosted, stackhpc-kayobe-config-kolla-builder]
steps:
- uses: actions/checkout@v3
with:
path: src/kayobe-config

- name: Determine OpenStack release
id: openstack_release
run: |
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v3
with:
repository: stackhpc/kayobe
ref: refs/heads/stackhpc/${{ steps.openstack_release.outputs.openstack_release }}
path: src/kayobe

# FIXME: Failed in kolla-ansible : Ensure the latest version of pip is installed
- name: Install dependencies
run: |
sudo dnf -y install python3-virtualenv
- name: Setup networking
run: |
if ! ip l show breth1 >/dev/null 2>&1; then
sudo ip l add breth1 type bridge
fi
sudo ip l set breth1 up
if ! ip a show breth1 | grep 192.168.33.3/24; then
sudo ip a add 192.168.33.3/24 dev breth1
fi
if ! ip l show dummy1 >/dev/null 2>&1; then
sudo ip l add dummy1 type dummy
fi
sudo ip l set dummy1 up
sudo ip l set dummy1 master breth1
- name: Install Kayobe
run: |
mkdir -p venvs &&
pushd venvs &&
python3 -m venv kayobe &&
source kayobe/bin/activate &&
pip install -U pip &&
pip install ../src/kayobe
- name: Bootstrap the control host
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe control host bootstrap
- name: Configure the seed host
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe seed host configure
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}

- name: Create bifrost_httpboot Docker volume
run: |
if [[ $(sudo docker volume ls -f Name=bifrost_httpboot -q | wc -l) = 0 ]]; then
sudo docker volume create bifrost_httpboot
fi
- name: Clean any previous build artifact
run: |
rm -f /tmp/updated_images.txt
- name: Build a CentOS Stream 8 overcloud host image
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe overcloud host image build --force-rebuild \
-e os_distribution=centos \
-e stackhpc_overcloud_dib_name=overcloud-centos-stream-8
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.centos

- name: Upload CentOS Stream 8 overcloud host image artifact
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
-e image_path='/opt/kayobe/images/overcloud-centos-stream-8' \
-e os_distribution='centos'
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.centos

- name: Build a Rocky Linux 8 overcloud host image
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe overcloud host image build --force-rebuild \
-e os_distribution=rocky \
-e os_release='8' \
-e stackhpc_overcloud_dib_name=overcloud-rocky-linux-8
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky8

- name: Upload Rocky Linux 8 overcloud host image artifact
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
-e image_path='/opt/kayobe/images/overcloud-rocky-linux-8' \
-e os_distribution='rocky'
-e os_release='8' \
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky8

- name: Build a Rocky Linux 9 overcloud host image
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe overcloud host image build --force-rebuild \
-e os_distribution=rocky \
-e os_release='9' \
-e stackhpc_overcloud_dib_name=overcloud-rocky-linux-9
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky9

- name: Upload Rocky Linux 9 overcloud host image artifact
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
-e image_path='/opt/kayobe/images/overcloud-rocky-linux-9' \
-e os_distribution='rocky' \
-e os_release='9'
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky9

# FIXME: Need EPEL on CentOS for debootstrap. It is disabled by default.
# Do this via config?
- name: Enable EPEL repository
run: |
sudo dnf config-manager --set-enabled epel
- name: Build a Ubuntu Focal 20.04 overcloud host image
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe overcloud host image build --force-rebuild \
-e os_distribution=ubuntu \
-e os_release=focal \
-e stackhpc_overcloud_dib_name=overcloud-ubuntu-focal
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-focal

- name: Upload Ubuntu Focal 20.04 overcloud host image artifact
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
-e image_path='/opt/kayobe/images/overcloud-ubuntu-focal' \
-e os_distribution='ubuntu' \
-e os_release=focal
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-focal

- name: Build a Ubuntu Jammy 22.04 overcloud host image
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe overcloud host image build --force-rebuild \
-e os_distribution=ubuntu \
-e os_release=jammy \
-e stackhpc_overcloud_dib_name=overcloud-ubuntu-jammy
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-jammy

- name: Upload Ubuntu Jammy 22.04 overcloud host image artifact
run: |
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/pulp-host-image-upload.yml \
-e image_path='/opt/kayobe/images/overcloud-ubuntu-jammy' \
-e os_distribution='ubuntu' \
-e os_release=jammy
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-jammy

- name: Upload updated images artifact
uses: actions/upload-artifact@v3
with:
name: Updated images list
path: /tmp/updated_images.txt
retention-days: 7
if: always()

- name: Clean up old images
run: |
sudo rm -rf /opt/kayobe/images/
if: always()
Loading

0 comments on commit c4eab14

Please sign in to comment.