Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-Welsh committed Feb 27, 2024
1 parent 11d036c commit ddba03a
Showing 1 changed file with 56 additions and 60 deletions.
116 changes: 56 additions & 60 deletions .github/workflows/overcloud-host-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ 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]
runs-on: arc-skc-host-image-builder-runner
permissions: {}
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
path: src/kayobe-config

- name: Determine OpenStack release
id: openstack_release
run: |
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' .gitreview)
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
# Generate a tag to apply to all built overcloud host images.
Expand All @@ -62,44 +63,36 @@ jobs:
run: |
echo "${{ steps.host_image_tag.outputs.host_image_tag }}"
- name: Clean any previous build artifact
run: |
rm -f /tmp/updated_images.txt
- name: Clone StackHPC Kayobe repository
uses: actions/checkout@v4
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
- name: Make sure dockerd is running and test Docker
run: |
sudo dnf -y install python3-virtualenv zstd
docker ps
- 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
# FIXME: Without this workaround we see the following issue after the runner is power cycled:
# TASK [MichaelRigart.interfaces : RedHat | ensure network service is started and enabled] ***
# Unable to start service network: Job for network.service failed because the control process exited with error code.
# See \"systemctl status network.service\" and \"journalctl -xe\" for details.
- name: Kill dhclient (workaround)
- name: Install package dependencies
run: |
(sudo killall dhclient || true) && sudo systemctl restart network
sudo apt update
sudo apt install -y build-essential git unzip nodejs python3-wheel python3-pip python3-venv
# - 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: |
Expand All @@ -116,18 +109,27 @@ jobs:
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe control host bootstrap
- name: Configure the seed host
- name: Configure localhost as a seed
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 }}
cat > src/kayobe-config/etc/kayobe/environments/ci-builder/inventory/hosts << EOF
# A 'seed' host used for building images.
# Use localhost for container image builds.
[seed]
localhost ansible_connection=local ansible_python_interpreter=/usr/bin/python3
EOF
# - 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
if [[ $(docker volume ls -f Name=bifrost_httpboot -q | wc -l) = 0 ]]; then
docker volume create bifrost_httpboot
fi
- name: Generate clouds.yaml
Expand Down Expand Up @@ -169,17 +171,16 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.centos && steps.build_centos_stream_8.outcome == 'success'

- name: Upload CentOS Stream 8 overcloud host image to SMS
- name: Upload CentOS Stream 8 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-centos-8-stream-${{ steps.host_image_tag.outputs.host_image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /opt/kayobe/images/overcloud-centos-8-stream/overcloud-centos-8-stream.qcow2 \
--private \
--os-cloud sms-lab-release \
--progress
--shared \
--os-cloud openstackprogress
env:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
Expand Down Expand Up @@ -213,16 +214,16 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky8 && steps.build_rocky_8.outcome == 'success'

- name: Upload Rocky Linux 8 overcloud host image to SMS
- name: Upload Rocky Linux 8 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-rocky-8-${{ steps.host_image_tag.outputs.host_image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /opt/kayobe/images/overcloud-rocky-8/overcloud-rocky-8.qcow2 \
--private \
--os-cloud sms-lab-release \
--shared \
--os-cloud openstack \
--progress
env:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand Down Expand Up @@ -257,16 +258,16 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.rocky9 && steps.build_rocky_9.outcome == 'success'

- name: Upload Rocky Linux 9 overcloud host image to SMS
- name: Upload Rocky Linux 9 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /opt/kayobe/images/overcloud-rocky-9/overcloud-rocky-9.qcow2 \
--private \
--os-cloud sms-lab-release \
--shared \
--os-cloud openstack \
--progress
env:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand Down Expand Up @@ -301,16 +302,16 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-focal && steps.build_ubuntu_focal.outcome == 'success'

- name: Upload Ubuntu Focal 20.04 overcloud host image to SMS
- name: Upload Ubuntu Focal 20.04 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-ubuntu-focal-${{ steps.host_image_tag.outputs.host_image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /opt/kayobe/images/overcloud-ubuntu-focal/overcloud-ubuntu-focal.qcow2 \
--private \
--os-cloud sms-lab-release \
--shared \
--os-cloud openstack \
--progress
env:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand Down Expand Up @@ -345,16 +346,16 @@ jobs:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
if: inputs.ubuntu-jammy && steps.build_ubuntu_jammy.outcome == 'success'

- name: Upload Ubuntu Jammy 22.04 overcloud host image to SMS
- name: Upload Ubuntu Jammy 22.04 overcloud host image to Cloud
run: |
source venvs/kayobe/bin/activate &&
openstack image create \
overcloud-ubuntu-jammy-${{ steps.host_image_tag.outputs.host_image_tag }} \
--container-format bare \
--disk-format qcow2 \
--file /opt/kayobe/images/overcloud-ubuntu-jammy/overcloud-ubuntu-jammy.qcow2 \
--private \
--os-cloud sms-lab-release \
--shared \
--os-cloud openstack \
--progress
env:
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand Down Expand Up @@ -432,8 +433,3 @@ jobs:
steps.build_rocky_9.outcome == 'failure' ||
steps.build_ubuntu_focal.outcome == 'failure' ||
steps.build_ubuntu_jammy.outcome == 'failure'

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

0 comments on commit ddba03a

Please sign in to comment.