diff --git a/.github/workflows/overcloud-host-image-build.yml b/.github/workflows/overcloud-host-image-build.yml index cbccca23e..551dd3a84 100644 --- a/.github/workflows/overcloud-host-image-build.yml +++ b/.github/workflows/overcloud-host-image-build.yml @@ -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. @@ -62,10 +63,6 @@ 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: @@ -73,10 +70,14 @@ jobs: 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 docker ps + + - name: Install package dependencies run: | - sudo dnf -y install python3-virtualenv zstd + sudo apt update + sudo apt install -y build-essential git unzip nodejs python3 python3-wheel python3-pip python3-venv - name: Setup networking run: | @@ -93,14 +94,6 @@ jobs: 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) - run: | - (sudo killall dhclient || true) && sudo systemctl restart network - - name: Install Kayobe run: | mkdir -p venvs && @@ -116,19 +109,28 @@ 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 }} - - - 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 + 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 [[ $(docker volume ls -f Name=bifrost_httpboot -q | wc -l) = 0 ]]; then + # docker volume create bifrost_httpboot + # fi - name: Generate clouds.yaml run: | @@ -169,7 +171,7 @@ 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 \ @@ -177,9 +179,8 @@ jobs: --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 }} @@ -213,7 +214,7 @@ 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 \ @@ -221,8 +222,8 @@ jobs: --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 }} @@ -257,7 +258,7 @@ 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 \ @@ -265,8 +266,8 @@ jobs: --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 }} @@ -301,7 +302,7 @@ 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 \ @@ -309,8 +310,8 @@ jobs: --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 }} @@ -345,7 +346,7 @@ 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 \ @@ -353,8 +354,8 @@ jobs: --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 }} @@ -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()