From 204610f44d06547eccfef123cb290c4500c62db4 Mon Sep 17 00:00:00 2001 From: Dawud M <7688823+technowhizz@users.noreply.github.com> Date: Mon, 27 Mar 2023 10:47:29 +0000 Subject: [PATCH 1/7] Update HAProxy alerting rules HAProxy alerting rules have been updated to use the server name that is down, rather than the name of the instance that reported the down server --- etc/kayobe/kolla/config/prometheus/haproxy.rules | 4 ++-- .../update-haproxy-alerting-rules-5594547666659c0f.yaml | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/update-haproxy-alerting-rules-5594547666659c0f.yaml diff --git a/etc/kayobe/kolla/config/prometheus/haproxy.rules b/etc/kayobe/kolla/config/prometheus/haproxy.rules index 090f6e37a..274ebf4eb 100644 --- a/etc/kayobe/kolla/config/prometheus/haproxy.rules +++ b/etc/kayobe/kolla/config/prometheus/haproxy.rules @@ -30,7 +30,7 @@ groups: labels: severity: critical annotations: - summary: "HAProxy server down (instance {{ $labels.instance }})" - description: "HAProxy server is down" + summary: "HAProxy server down at {{ $labels.server }}" + description: "HAProxy server for {{ $labels.backend }} is down at {{ $labels.server }}" {% endraw %} diff --git a/releasenotes/notes/update-haproxy-alerting-rules-5594547666659c0f.yaml b/releasenotes/notes/update-haproxy-alerting-rules-5594547666659c0f.yaml new file mode 100644 index 000000000..e327a45b1 --- /dev/null +++ b/releasenotes/notes/update-haproxy-alerting-rules-5594547666659c0f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + HAProxy alerting rules have been updated to use the server name that is + down, rather than the name of the instance that reported the down server. From 01e8fd1f9307a004306c09bf68c1ab49b1744640 Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Thu, 4 May 2023 21:22:51 +0200 Subject: [PATCH 2/7] Revert "Build Neutron from stackhpc fork" The upstream fix for the IPv6 metadata DAD failure was merged on all branches up to Victoria [1]. This reverts commit 9df33a626e0d809790d067a05d1e3844cb16e90b. [1] https://review.opendev.org/q/I6b544c5528cb22e5e8846fc47dfb8b05f70f975c --- etc/kayobe/kolla.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/etc/kayobe/kolla.yml b/etc/kayobe/kolla.yml index 217d4d66a..92dd8dd31 100644 --- a/etc/kayobe/kolla.yml +++ b/etc/kayobe/kolla.yml @@ -140,10 +140,6 @@ kolla_sources: type: git location: https://github.com/stackhpc/magnum.git reference: stackhpc/wallaby - neutron-base: - type: git - location: https://github.com/stackhpc/neutron.git - reference: stackhpc/{{ openstack_release }} neutron-base-plugin-networking-generic-switch: type: git location: https://github.com/stackhpc/networking-generic-switch.git From f2f389fd399375bd4d0bbf57314b1e7b6de2d48d Mon Sep 17 00:00:00 2001 From: Alex-Welsh <112560678+Alex-Welsh@users.noreply.github.com> Date: Wed, 10 May 2023 12:23:56 +0100 Subject: [PATCH 3/7] Add workflows to build and promote overcloud host images (#509) * CI: Add overcloud-host-image-build workflow * CI: Workaround lack of internal DNS in SMS lab Use an etc-hosts DIB element to add the test Pulp server to /etc/hosts in the image. * Draft layout for pulp image hosting * upload-image removing placeholder vars * Renaming, and various fixes for, pulp_upload_image * Image upload functioning with workarounds * renaming pulp-upload-image, removing workarounds * Finalised pulp-upload-image and workflow * updated etc hosts workaround * Adding overcloud host image sources * fix ubuntu image url typo, add pulp url with auth * move image sources to separate file & small fixes * Add image promotion workflow * Rename pulp overcloud host image playbooks Rename ansible playbooks handling overcloud host image promotion * Revert changes to pull pulp overcloud host images * Correct host image promote workflow input syntax Co-authored-by: Mark Goddard --------- Co-authored-by: Mark Goddard --- .../workflows/overcloud-host-image-build.yml | 177 ++++++++++++++++++ .../overcloud-host-image-promote.yml | 121 ++++++++++++ .../ansible/pulp-host-image-promote.yml | 40 ++++ etc/kayobe/ansible/pulp-host-image-upload.yml | 109 +++++++++++ .../environments/ci-builder/overcloud-dib.yml | 20 ++ etc/kayobe/overcloud-dib.yml | 2 +- etc/kayobe/stackhpc-overcloud-dib.yml | 4 + 7 files changed, 472 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/overcloud-host-image-build.yml create mode 100644 .github/workflows/overcloud-host-image-promote.yml create mode 100644 etc/kayobe/ansible/pulp-host-image-promote.yml create mode 100644 etc/kayobe/ansible/pulp-host-image-upload.yml create mode 100644 etc/kayobe/environments/ci-builder/overcloud-dib.yml diff --git a/.github/workflows/overcloud-host-image-build.yml b/.github/workflows/overcloud-host-image-build.yml new file mode 100644 index 000000000..cf9b62806 --- /dev/null +++ b/.github/workflows/overcloud-host-image-build.yml @@ -0,0 +1,177 @@ +--- +name: Build overcloud host images +on: + workflow_dispatch: + inputs: + centos: + description: Build CentOS Stream + type: boolean + default: true + rocky: + description: Build Rocky Linux + type: boolean + default: true + ubuntu: + description: Build Ubuntu + 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: Clone StackHPC Kayobe repository + uses: actions/checkout@v3 + with: + repository: stackhpc/kayobe + ref: refs/heads/stackhpc/xena + 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 stackhpc_overcloud_dib_name=overcloud-rocky-linux-8 + env: + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: inputs.rocky + + - 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' + env: + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: inputs.rocky + + # 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 stackhpc_overcloud_dib_name=overcloud-ubuntu-focal + env: + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: inputs.ubuntu + + - 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' + env: + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: inputs.ubuntu + + - 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() diff --git a/.github/workflows/overcloud-host-image-promote.yml b/.github/workflows/overcloud-host-image-promote.yml new file mode 100644 index 000000000..cacbd575e --- /dev/null +++ b/.github/workflows/overcloud-host-image-promote.yml @@ -0,0 +1,121 @@ +--- +name: Promote overcloud host image +on: + workflow_dispatch: + inputs: + os_image: + description: Image to promote + type: choice + required: true + default: 'CentOS Stream 8' + options: + - 'CentOS Stream 8' + - 'Rocky Linux 8' + - 'Ubuntu Focal 20.04' + image_tag: + description: Tag to promote + type: string + required: true +env: + ANSIBLE_FORCE_COLOR: True +jobs: + overcloud-host-image-promote: + name: Promote overcloud host image + 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: Clone StackHPC Kayobe repository + uses: actions/checkout@v3 + with: + repository: stackhpc/kayobe + ref: refs/heads/stackhpc/xena + 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: Promote 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-promote.yml \ + -e image_path='/opt/kayobe/images/overcloud-centos-stream-8' \ + -e os_distribution='centos' \ + -e os_release='8-stream' + env: + OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: os_image == 'CentOS Stream 8' + + - name: Promote 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-promote.yml \ + -e image_path='/opt/kayobe/images/overcloud-rocky-linux-8' \ + -e os_distribution='rocky' \ + -e os_release='8' + env: + OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: os_image == 'Rocky Linux 8' + + - name: Promote 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-promote.yml \ + -e image_path='/opt/kayobe/images/overcloud-ubuntu-focal' \ + -e os_distribution='ubuntu' \ + -e os_release='focal' + env: + OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: os_image == 'Ubuntu Focal 20.04' diff --git a/etc/kayobe/ansible/pulp-host-image-promote.yml b/etc/kayobe/ansible/pulp-host-image-promote.yml new file mode 100644 index 000000000..d93d71d51 --- /dev/null +++ b/etc/kayobe/ansible/pulp-host-image-promote.yml @@ -0,0 +1,40 @@ +--- +# Tag is the version of the image to promote, stored in an env variable named OVERCLOUD_HOST_IMAGE_TAG +- name: Promote an image to production + hosts: localhost + vars: + remote_pulp_url: "{{ stackhpc_release_pulp_url }}" + remote_pulp_username: "{{ stackhpc_image_repository_username }}" + remote_pulp_password: "{{ stackhpc_image_repository_password }}" + repository_name: "kayobe-images-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}" + base_path: "kayobe-images/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}" + promotion_tag: "{{ lookup('env', 'OVERCLOUD_HOST_IMAGE_TAG') }}" + tasks: + + - name: Check whether the image exists + pulp.squeezer.file_distribution: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + name: "{{ repository_name }}_{{ promotion_tag }}" + base_path: "{{ base_path }}/{{ promotion_tag }}" + register: distribution_details + + - name: Fail if the image does not exist + fail: + msg: "Image {{ promotion_tag }} does not exist" + when: distribution_details.distribution is none + + - name: Ensure production content guard is set + pulp.squeezer.file_distribution: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + name: "{{ repository_name }}_{{ promotion_tag }}" + base_path: "{{ base_path }}/{{ promotion_tag }}" + content_guard: release + state: present + + - name: Print version tag and os + debug: + msg: "Promoted tag: {{ promotion_tag }}" diff --git a/etc/kayobe/ansible/pulp-host-image-upload.yml b/etc/kayobe/ansible/pulp-host-image-upload.yml new file mode 100644 index 000000000..b2945c83f --- /dev/null +++ b/etc/kayobe/ansible/pulp-host-image-upload.yml @@ -0,0 +1,109 @@ +--- +- name: Upload and create a distribution for an image + hosts: localhost + vars: + remote_pulp_url: "{{ stackhpc_release_pulp_url }}" + remote_pulp_username: "{{ stackhpc_image_repository_username }}" + remote_pulp_password: "{{ stackhpc_image_repository_password }}" + repository_name: "kayobe-images-{{ openstack_release }}-{{ os_distribution }}-{{ os_release }}" + base_path: "kayobe-images/{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}" + tasks: + - name: Get filename + find: + paths: "{{ image_path }}" + patterns: '*.qcow2' + register: found_files + + - name: Upload an artifact + pulp.squeezer.artifact: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + file: "{{ found_files.files[0].path }}" + state: present + + - name: Get sha256 hash + ansible.builtin.stat: + path: "{{ found_files.files[0].path }}" + checksum_algorithm: sha256 + register: file_stats + + - name: Create file content from artifact + pulp.squeezer.file_content: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + sha256: "{{ file_stats.stat.checksum }}" + relative_path: "{{ found_files.files[0].path | basename }}" + state: present + + - name: Ensure file repo exists + pulp.squeezer.file_repository: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + name: "{{ repository_name }}" + state: present + + - name: Add content to file repo + pulp.squeezer.file_repository_content: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + repository: "{{ repository_name }}" + present_content: + - relative_path: "{{ found_files.files[0].path | basename }}" + sha256: "{{ file_stats.stat.checksum }}" + + - name: Create a new publication to point to this version + pulp.squeezer.file_publication: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + repository: "{{ repository_name }}" + state: present + register: publication_details + + - name: Update distribution for latest version + pulp.squeezer.file_distribution: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + name: "{{ repository_name }}_latest" + base_path: "{{ base_path }}/latest" + publication: "{{ publication_details.publication.pulp_href }}" + content_guard: development + state: present + register: latest_distribution_details + + - name: Create distribution for given version + pulp.squeezer.file_distribution: + pulp_url: "{{ remote_pulp_url }}" + username: "{{ remote_pulp_username }}" + password: "{{ remote_pulp_password }}" + name: "{{ repository_name }}_{{ ansible_facts.date_time.iso8601_basic_short }}" + base_path: "{{ base_path }}/{{ ansible_facts.date_time.iso8601_basic_short }}" + publication: "{{ publication_details.publication.pulp_href }}" + content_guard: development + state: present + when: latest_distribution_details.changed + + - name: Update new images file with versioned path + lineinfile: + path: /tmp/updated_images.txt + line: "{{ remote_pulp_url }}/pulp/content/{{ base_path }}/\ + {{ ansible_facts.date_time.iso8601_basic_short }}/{{ found_files.files[0].path | basename }}" + create: true + when: latest_distribution_details.changed + + - name: Update new images file with latest path + lineinfile: + path: /tmp/updated_images.txt + line: "{{ remote_pulp_url }}/pulp/content/{{ base_path }}/\ + latest/{{ found_files.files[0].path | basename }}" + when: latest_distribution_details.changed + + - name: Print version tag + debug: + msg: "New tag: {{ ansible_facts.date_time.iso8601_basic_short }}" + when: latest_distribution_details.changed diff --git a/etc/kayobe/environments/ci-builder/overcloud-dib.yml b/etc/kayobe/environments/ci-builder/overcloud-dib.yml new file mode 100644 index 000000000..6a8f3b0f1 --- /dev/null +++ b/etc/kayobe/environments/ci-builder/overcloud-dib.yml @@ -0,0 +1,20 @@ +--- +# Overcloud host disk image configuration. + +############################################################################### +# Diskimage-builder configuration for overcloud host disk images. + +# Whether to build host disk images with DIB directly instead of through +# Bifrost. Setting it to true disables Bifrost image build and allows images to +# be built with the `kayobe overcloud host image build` command. Default value +# is False. This will change in a future release. +overcloud_dib_build_host_images: true + +# List of overcloud host disk images to build. Each element is a dict defining +# an image in a format accepted by the stackhpc.os-images role. Default is to +# build an image named "deployment_image" configured with the overcloud_dib_* +# variables defined below: {"name": "deployment_image", "elements": "{{ +# overcloud_dib_elements }}", "env": "{{ overcloud_dib_env_vars }}", +# "packages": "{{ overcloud_dib_packages }}"}. +overcloud_dib_host_images: + - "{{ stackhpc_overcloud_dib_host_image }}" diff --git a/etc/kayobe/overcloud-dib.yml b/etc/kayobe/overcloud-dib.yml index 9c34650ff..46a02830b 100644 --- a/etc/kayobe/overcloud-dib.yml +++ b/etc/kayobe/overcloud-dib.yml @@ -71,7 +71,7 @@ overcloud_dib_host_packages_extra: overcloud_dib_git_elements_extra: - repo: "https://github.com/stackhpc/stackhpc-image-elements" local: "{{ source_checkout_path }}/stackhpc-image-elements" - version: "v1.4.0" + version: "v1.5.0" elements_path: "elements" # List of git repositories containing Diskimage Builder (DIB) elements. See diff --git a/etc/kayobe/stackhpc-overcloud-dib.yml b/etc/kayobe/stackhpc-overcloud-dib.yml index a39e59608..5ba915c25 100644 --- a/etc/kayobe/stackhpc-overcloud-dib.yml +++ b/etc/kayobe/stackhpc-overcloud-dib.yml @@ -25,6 +25,7 @@ stackhpc_overcloud_dib_elements: - "cloud-init-datasources" - "{% if os_distribution in ['centos', 'rocky'] %}disable-selinux{% endif %}" - "enable-serial-console" + - "{% if kayobe_environment == 'ci-builder' %}etc-hosts{% endif %}" - "vm" - "block-device-efi" - "cloud-init" @@ -45,6 +46,9 @@ stackhpc_overcloud_dib_env_vars: # sometimes). # DIB_DISTRIBUTION_MIRROR: "{{ stackhpc_repo_ubuntu_focal_url if os_distribution == 'ubuntu' else '' }}" DIB_DRACUT_ENABLED_MODULES_DEFAULT_CONFIG: "{{ stackhpc_overcloud_dib_dracut_enabled_modules_default_config }}" + # FIXME: Workaround for lack of internal DNS on SMS lab. + DIB_ETC_HOSTS_EXTRA: | + 10.205.3.187 pulp-server pulp-server.internal.sms-cloud DIB_RELEASE: "{{ overcloud_dib_os_release }}" DIB_SUDOERS_FILENAME: "no-fqdn" # Avoid DNS queries during sudo commands, since we might not always have working DNS. From 545520c84eb56c6fab5558e8f754d589d5a8f943 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 10 May 2023 12:35:44 +0100 Subject: [PATCH 4/7] CI: Fix up overcloud host image workflows for Yoga --- .github/workflows/overcloud-host-image-build.yml | 8 +++++++- .github/workflows/overcloud-host-image-promote.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/overcloud-host-image-build.yml b/.github/workflows/overcloud-host-image-build.yml index cf9b62806..83cf3423c 100644 --- a/.github/workflows/overcloud-host-image-build.yml +++ b/.github/workflows/overcloud-host-image-build.yml @@ -28,11 +28,17 @@ jobs: 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/xena + 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 diff --git a/.github/workflows/overcloud-host-image-promote.yml b/.github/workflows/overcloud-host-image-promote.yml index cacbd575e..6de6d98e7 100644 --- a/.github/workflows/overcloud-host-image-promote.yml +++ b/.github/workflows/overcloud-host-image-promote.yml @@ -28,11 +28,17 @@ jobs: 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/xena + 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 From 2e42c058255f521445bb42a14230b141bbc28edf Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Wed, 10 May 2023 13:32:03 +0100 Subject: [PATCH 5/7] CI: support RL9 overcloud host image workflows --- .../workflows/overcloud-host-image-build.yml | 47 ++++++++++++++++--- .../overcloud-host-image-promote.yml | 15 ++++++ 2 files changed, 55 insertions(+), 7 deletions(-) diff --git a/.github/workflows/overcloud-host-image-build.yml b/.github/workflows/overcloud-host-image-build.yml index 83cf3423c..b7c9c17c9 100644 --- a/.github/workflows/overcloud-host-image-build.yml +++ b/.github/workflows/overcloud-host-image-build.yml @@ -4,15 +4,19 @@ on: workflow_dispatch: inputs: centos: - description: Build CentOS Stream + description: Build CentOS Stream 8 type: boolean default: true - rocky: - description: Build Rocky Linux + rocky8: + description: Build Rocky Linux 8 + type: boolean + default: true + rocky9: + description: Build Rocky Linux 9 type: boolean default: true ubuntu: - description: Build Ubuntu + description: Build Ubuntu Focal type: boolean default: true @@ -123,10 +127,11 @@ jobs: 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.rocky + if: inputs.rocky8 - name: Upload Rocky Linux 8 overcloud host image artifact run: | @@ -136,9 +141,35 @@ jobs: 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.rocky + if: inputs.rocky9 # FIXME: Need EPEL on CentOS for debootstrap. It is disabled by default. # Do this via config? @@ -152,6 +183,7 @@ jobs: 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 }} @@ -164,7 +196,8 @@ jobs: 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_distribution='ubuntu' \ + -e os_release=focal env: KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} if: inputs.ubuntu diff --git a/.github/workflows/overcloud-host-image-promote.yml b/.github/workflows/overcloud-host-image-promote.yml index 6de6d98e7..0af7db32d 100644 --- a/.github/workflows/overcloud-host-image-promote.yml +++ b/.github/workflows/overcloud-host-image-promote.yml @@ -11,6 +11,7 @@ on: options: - 'CentOS Stream 8' - 'Rocky Linux 8' + - 'Rocky Linux 9' - 'Ubuntu Focal 20.04' image_tag: description: Tag to promote @@ -112,6 +113,20 @@ jobs: KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} if: os_image == 'Rocky Linux 8' + - 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-host-image-promote.yml \ + -e image_path='/opt/kayobe/images/overcloud-rocky-linux-9' \ + -e os_distribution='rocky' \ + -e os_release='9' + env: + OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: os_image == 'Rocky Linux 9' + - name: Promote Ubuntu Focal 20.04 overcloud host image artifact run: | source venvs/kayobe/bin/activate && From 796a9b3518ce642bb7ad72713b6d5110df4b14a5 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Wed, 10 May 2023 13:55:46 +0100 Subject: [PATCH 6/7] Replace StackHPC neutron fork We need this in Yoga for OVN native DHCP. --- etc/kayobe/kolla.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/kayobe/kolla.yml b/etc/kayobe/kolla.yml index ec5a4df5e..40dfc8802 100644 --- a/etc/kayobe/kolla.yml +++ b/etc/kayobe/kolla.yml @@ -133,6 +133,10 @@ kolla_sources: type: git location: https://github.com/stackhpc/magnum.git reference: stackhpc/{{ openstack_release }} + neutron-base: + type: git + location: https://github.com/stackhpc/neutron.git + reference: stackhpc/{{ openstack_release }} neutron-base-plugin-networking-generic-switch: type: git location: https://github.com/stackhpc/networking-generic-switch.git From caa9f186c744cda1dc2557b01e65bfb9fbc0a5a4 Mon Sep 17 00:00:00 2001 From: Alex-Welsh Date: Wed, 10 May 2023 14:06:31 +0100 Subject: [PATCH 7/7] CI: Support Jammy overcloud host image workflows --- .../workflows/overcloud-host-image-build.yml | 37 +++++++++++++++++-- .../overcloud-host-image-promote.yml | 15 ++++++++ 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/.github/workflows/overcloud-host-image-build.yml b/.github/workflows/overcloud-host-image-build.yml index b7c9c17c9..b1e677aac 100644 --- a/.github/workflows/overcloud-host-image-build.yml +++ b/.github/workflows/overcloud-host-image-build.yml @@ -15,8 +15,12 @@ on: description: Build Rocky Linux 9 type: boolean default: true - ubuntu: - description: Build Ubuntu Focal + ubuntu-focal: + description: Build Ubuntu 20.04 Focal + type: boolean + default: true + ubuntu-jammy: + description: Build Ubuntu 22.04 Jammy type: boolean default: true @@ -187,7 +191,7 @@ jobs: -e stackhpc_overcloud_dib_name=overcloud-ubuntu-focal env: KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} - if: inputs.ubuntu + if: inputs.ubuntu-focal - name: Upload Ubuntu Focal 20.04 overcloud host image artifact run: | @@ -200,7 +204,32 @@ jobs: -e os_release=focal env: KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} - if: inputs.ubuntu + 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 diff --git a/.github/workflows/overcloud-host-image-promote.yml b/.github/workflows/overcloud-host-image-promote.yml index 0af7db32d..433335034 100644 --- a/.github/workflows/overcloud-host-image-promote.yml +++ b/.github/workflows/overcloud-host-image-promote.yml @@ -13,6 +13,7 @@ on: - 'Rocky Linux 8' - 'Rocky Linux 9' - 'Ubuntu Focal 20.04' + - 'Ubuntu Jammy 22.04' image_tag: description: Tag to promote type: string @@ -140,3 +141,17 @@ jobs: OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} if: os_image == 'Ubuntu Focal 20.04' + + - name: Promote 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-promote.yml \ + -e image_path='/opt/kayobe/images/overcloud-ubuntu-jammy' \ + -e os_distribution='jammy' \ + -e os_release='focal' + env: + OVERCLOUD_HOST_IMAGE_TAG: ${{ inputs.image_tag }} + KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }} + if: os_image == 'Ubuntu Jammy 22.04'