Skip to content

Promote overcloud host image #63

Promote overcloud host image

Promote overcloud host image #63

---
name: Promote overcloud host image
on:
workflow_dispatch:
inputs:
rocky9:
description: Promote Rocky Linux 9
type: boolean
default: true
ubuntu-noble:
description: Promote Ubuntu 24.04 Noble
type: boolean
default: true
image_tag:
description: Tag to promote
type: string
required: true
cpu-platform-architecture:
description: What is the tagged image's architecture
type: choice
required: true
default: x86_64
options:
- x86_64
- aarch64
env:
ANSIBLE_FORCE_COLOR: True
pulp_artifact_type: ${{ inputs.cpu-platform-architecture == 'x86_64' && 'kayobe-images' || 'kayobe-images/aarch64' }}
jobs:
overcloud-host-image-promote:
name: Promote overcloud host image
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
runs-on: ubuntu-24.04
steps:
- name: Validate inputs
run: |
if [[ ${{ inputs.rocky9 }} == 'false' && ${{ inputs.ubuntu-noble }} == 'false' ]]; then
echo "At least one distribution must be selected"
exit 1
fi
- uses: actions/checkout@v4
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 -E "s,(stable|unmaintained)/,," >> $GITHUB_OUTPUT
working-directory: src/kayobe-config
- 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 -r ../src/kayobe-config/requirements.txt
- 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: Promote 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-artifact-promote.yml \
-e artifact_type=${{ env.pulp_artifact_type }} \
-e os_distribution='rocky' \
-e os_release='9'
env:
ARTIFACT_TAG: ${{ inputs.image_tag }}
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky9
- name: Promote Ubuntu Noble 24.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-artifact-promote.yml \
-e artifact_type=${{ env.pulp_artifact_type }} \
-e os_distribution='ubuntu' \
-e os_release='noble'
env:
ARTIFACT_TAG: ${{ inputs.image_tag }}
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-noble