Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions .github/workflows/overcloud-host-image-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ on:
options:
- SMS Lab
- Leafcloud
cpu-platform-architecture:
description: Select the image's build architecture
type: choice
default: x86_64
options:
- x86_64
- aarch64
secrets:
KAYOBE_VAULT_PASSWORD:
required: true
Expand All @@ -32,6 +39,8 @@ env:
ANSIBLE_FORCE_COLOR: True
KAYOBE_ENVIRONMENT: ci-builder
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
overcloud_dib_architecture: ${{ inputs.cpu-platform-architecture == 'x86_64' && 'amd64' || 'arm64' }}
pulp_artifact_type: ${{ inputs.cpu-platform-architecture == 'x86_64' && 'kayobe-images' || 'kayobe-images/aarch64' }}
jobs:
runner-selection:
uses: ./.github/workflows/runner-selector.yml
Expand Down Expand Up @@ -212,7 +221,7 @@ jobs:
source venvs/kayobe/bin/activate &&
source src/kayobe-config/kayobe-env --environment ci-builder &&
kayobe seed host command run \
--command "sudo apt update && sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv containerd docker.io docker-buildx" --show-output
--command "sudo apt update && sudo apt -y install gcc git libffi-dev python3-dev python-is-python3 python3-venv containerd docker.io docker-buildx qemu-user-static" --show-output
env:
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}

Expand Down Expand Up @@ -256,7 +265,7 @@ jobs:
src/kayobe-config/etc/kayobe/ansible/pulp-artifact-upload.yml \
-e artifact_path=/opt/kayobe/images/overcloud-rocky-9 \
-e artifact_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
-e artifact_type="kayobe-images" \
-e artifact_type=${{ env.pulp_artifact_type }} \
-e file_regex="*.qcow2" \
-e os_distribution="rocky" \
-e os_release="9"
Expand All @@ -271,7 +280,8 @@ jobs:
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
-e local_image_path="/opt/kayobe/images/overcloud-rocky-9/overcloud-rocky-9.qcow2" \
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }}
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }} \
-e cpu_platform=${{ env.overcloud_dib_architecture }}
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand All @@ -285,7 +295,8 @@ jobs:
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
-e local_image_path="/opt/kayobe/images/overcloud-rocky-9/overcloud-rocky-9.qcow2" \
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }}
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }} \
-e cpu_platform=${{ env.overcloud_dib_architecture }}
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML_OTHER_CLOUD }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID_OTHER_CLOUD }}
Expand Down Expand Up @@ -324,7 +335,7 @@ jobs:
src/kayobe-config/etc/kayobe/ansible/pulp-artifact-upload.yml \
-e artifact_path=/opt/kayobe/images/overcloud-ubuntu-noble \
-e artifact_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
-e artifact_type="kayobe-images" \
-e artifact_type=${{ env.pulp_artifact_type }} \
-e file_regex="*.qcow2" \
-e os_distribution="ubuntu" \
-e os_release="noble"
Expand All @@ -339,7 +350,8 @@ jobs:
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
-e local_image_path="/opt/kayobe/images/overcloud-ubuntu-noble/overcloud-ubuntu-noble.qcow2" \
-e image_name=overcloud-ubuntu-noble-${{ steps.host_image_tag.outputs.host_image_tag }}
-e image_name=overcloud-ubuntu-noble-${{ steps.host_image_tag.outputs.host_image_tag }} \
-e cpu_platform=${{ env.overcloud_dib_architecture }}
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
Expand All @@ -353,7 +365,8 @@ jobs:
kayobe playbook run \
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
-e local_image_path="/opt/kayobe/images/overcloud-ubuntu-noble/overcloud-ubuntu-noble.qcow2" \
-e image_name=overcloud-ubuntu-noble-${{ steps.host_image_tag.outputs.host_image_tag }}
-e image_name=overcloud-ubuntu-noble-${{ steps.host_image_tag.outputs.host_image_tag }} \
-e cpu_platform=${{ env.overcloud_dib_architecture }}
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML_OTHER_CLOUD }}
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID_OTHER_CLOUD }}
Expand Down
2 changes: 1 addition & 1 deletion etc/kayobe/ansible/openstack-host-image-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
hosts: seed
vars:
local_image_path: /opt/kayobe/images/overcloud-{{ os_distribution }}-{{ os_release }}/overcloud-{{ os_distribution }}-{{ os_release }}.qcow2
image_name: overcloud-{{ os_distribution }}-{{ os_release }}
image_name: overcloud-{{ os_distribution }}-{{ os_release }}-{{ cpu_platform }}
tasks:
- name: Upload image to Glance
block:
Expand Down
8 changes: 7 additions & 1 deletion etc/kayobe/kolla.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,16 @@ kolla_ansible_source_version: "{{ stackhpc_kolla_ansible_source_version }}"
###############################################################################
# Kolla configuration.


# Kolla base container image architecture. Options are "x86_64", "aarch64".
# Default is "{{ ansible_facts.architecture }}"
# NOTE(bbezak): evaluating this var locally for non facts gathering playbooks
kolla_base_arch: "{{ 'aarch64' if lookup('pipe','uname -m') in ['aarch64','arm64'] else 'x86_64' }}"
kolla_base_arch: >-
{{
'aarch64' if (stackhpc_cpu_arch_override is defined and stackhpc_cpu_arch_override | length > 0 and stackhpc_cpu_arch_override == 'arm64')
else (stackhpc_cpu_arch_override if (stackhpc_cpu_arch_override is defined and stackhpc_cpu_arch_override | length > 0)
else ('aarch64' if lookup('pipe','uname -m') in ['aarch64','arm64'] else 'x86_64'))
}}

# Kolla base container image distribution. Options are "centos", "debian",
# "rocky", "ubuntu". Default is {{ os_distribution }}.
Expand Down
3 changes: 3 additions & 0 deletions etc/kayobe/overcloud-dib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ overcloud_dib_host_packages_extra:
# elements. See stackhpc.openstack.os_images role for usage. Default is empty.
overcloud_dib_git_elements_extra: "{{ stackhpc_dib_image_elements_repos }}"

# Selects the architecture of the overcloud host image being built.
overcloud_dib_architecture: "{{ 'amd64' if stackhpc_cpu_arch == 'x86_64' else 'arm64' }}"

# List of git repositories containing Diskimage Builder (DIB) elements. See
# stackhpc.openstack.os_images role for usage. Default is a combination of
# overcloud_dib_git_elements_default and overcloud_dib_git_elements_extra.
Expand Down
49 changes: 30 additions & 19 deletions etc/kayobe/stackhpc-overcloud-dib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ stackhpc_overcloud_dib_host_image:
elements: "{{ stackhpc_overcloud_dib_elements }}"
env: "{{ stackhpc_overcloud_dib_env_vars }}"
packages: "{{ stackhpc_overcloud_dib_packages }}"
architecture: "{{ overcloud_dib_architecture }}"

# StackHPC overcloud DIB image name.
stackhpc_overcloud_dib_name: "deployment_image"
Expand Down Expand Up @@ -55,6 +56,7 @@ stackhpc_overcloud_dib_env_vars_default:
YUM: dnf
# Workaround for stack user home ownership bug
DIB_IMAGE_CACHE: "/tmp/yum"
DIB_CONTAINERFILE_BUILDOPTS: "--platform linux/{{ overcloud_dib_architecture }}"

stackhpc_overcloud_dib_env_vars_ark:
DIB_CONTAINERFILE_BUILDOPTS: >-
Expand All @@ -63,25 +65,34 @@ stackhpc_overcloud_dib_env_vars_ark:
DIB_DISTRIBUTION_MIRROR: "{{ stackhpc_repo_ubuntu_noble_url if os_distribution == 'ubuntu' else '' }}"

# StackHPC overcloud DIB image packages.
stackhpc_overcloud_dib_packages:
- "ethtool"
- "git"
- "less"
- "logrotate"
- "net-tools"
- "nvme-cli"
- "pciutils"
- "python3"
- "smartmontools"
- "vim"
- "{% if os_distribution == 'ubuntu' %}netbase{% endif %}"
- "{% if os_distribution == 'ubuntu' %}iputils-ping{% endif %}"
- "{% if os_distribution == 'ubuntu' %}curl{% endif %}"
- "{% if os_distribution == 'ubuntu' %}apt-utils{% endif %}"
- "{% if os_distribution == 'rocky' %}NetworkManager-config-server{% endif %}"
- "{% if os_distribution == 'rocky' %}linux-firmware{% endif %}"
- "{% if os_distribution == 'rocky' %}cloud-utils-growpart{% endif %}"
- "{% if os_distribution == 'ubuntu' %}cloud-guest-utils{% endif %}"
stackhpc_overcloud_dib_packages_common:
- ethtool
- git
- less
- logrotate
- net-tools
- nvme-cli
- pciutils
- python3
- smartmontools
- vim

stackhpc_overcloud_dib_packages_ubuntu:
- netbase
- iputils-ping
- curl
- apt-utils
- cloud-guest-utils

stackhpc_overcloud_dib_packages_rocky:
- NetworkManager-config-server
- linux-firmware
- cloud-utils-growpart

stackhpc_overcloud_dib_packages: >-
{{ stackhpc_overcloud_dib_packages_common +
(stackhpc_overcloud_dib_packages_ubuntu if os_distribution == 'ubuntu' else []) +
(stackhpc_overcloud_dib_packages_rocky if os_distribution == 'rocky' else []) }}

# StackHPC overcloud DIB image block device configuration.
# This image layout conforms to the CIS partition benchmarks.
Expand Down
1 change: 1 addition & 0 deletions etc/kayobe/stackhpc-overcloud-host-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ stackhpc_build_overcloud_image_from_pulp_package_mirrors: false
# The overcloud host image source, defined by os_distribution, os_release,
# and the current stable version.
stackhpc_overcloud_host_image_url: "{{ stackhpc_release_pulp_content_url_with_auth }}/kayobe-images/\
{{ 'aarch64/' if stackhpc_cpu_arch == 'arm64' else '' }}\
{{ openstack_release }}/{{ os_distribution }}/{{ os_release }}/\
{{ stackhpc_overcloud_host_image_version }}/\
overcloud-{{ os_distribution }}-{{ os_release }}.qcow2"
Expand Down
9 changes: 9 additions & 0 deletions etc/kayobe/stackhpc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ stackhpc_include_os_minor_version_in_repo_url: false

stackhpc_rocky_9_url_version: "{{ '9.' + stackhpc_pulp_repo_rocky_9_minor_version | string if stackhpc_include_os_minor_version_in_repo_url | bool else '9' }}"

# Pick build architecture for kolla and disk image builder
# Choose between x86_64 or arm64. Leaving unset will default
# to the local architecture.
stackhpc_cpu_arch_override: ""

# If the override variable hasnt been set above then both kolla_base_arch and
# stackhpc_cpu_arch will default to the local architecture.
stackhpc_cpu_arch: "{{ 'arm64' if kolla_base_arch == 'aarch64' else kolla_base_arch }}"

###############################################################################
# Debs
# Ubuntu noble
Expand Down
Loading