Skip to content

Commit 07d8057

Browse files
committed
Add ability to choose image build platform
1 parent 2e3e062 commit 07d8057

File tree

7 files changed

+26
-9
lines changed

7 files changed

+26
-9
lines changed

.github/workflows/overcloud-host-image-build.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ on:
1818
options:
1919
- SMS Lab
2020
- Leafcloud
21+
cpu-platform-architecture:
22+
description: Select the image's build architecture
23+
type: choice
24+
default: x86
25+
options:
26+
- x86
27+
- aarch64
2128
secrets:
2229
KAYOBE_VAULT_PASSWORD:
2330
required: true
@@ -32,6 +39,7 @@ env:
3239
ANSIBLE_FORCE_COLOR: True
3340
KAYOBE_ENVIRONMENT: ci-builder
3441
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
42+
overcloud_dib_architechture: ${{ inputs.cpu-platform-architecture == 'x86' && 'amd64' || 'arm64' }}
3543
jobs:
3644
runner-selection:
3745
uses: ./.github/workflows/runner-selector.yml
@@ -256,7 +264,7 @@ jobs:
256264
src/kayobe-config/etc/kayobe/ansible/pulp-artifact-upload.yml \
257265
-e artifact_path=/opt/kayobe/images/overcloud-rocky-9 \
258266
-e artifact_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
259-
-e artifact_type="kayobe-images" \
267+
-e artifact_type="kayobe-images/{{ inputs.cpu-platform-architecture }}" \
260268
-e file_regex="*.qcow2" \
261269
-e os_distribution="rocky" \
262270
-e os_release="9"
@@ -272,6 +280,7 @@ jobs:
272280
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
273281
-e local_image_path="/opt/kayobe/images/overcloud-rocky-9/overcloud-rocky-9.qcow2" \
274282
-e image_name=overcloud-rocky-9-${{ steps.host_image_tag.outputs.host_image_tag }}
283+
-e cpu-platform=${{ env.overcloud_dib_architechture }}
275284
env:
276285
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
277286
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
@@ -324,7 +333,7 @@ jobs:
324333
src/kayobe-config/etc/kayobe/ansible/pulp-artifact-upload.yml \
325334
-e artifact_path=/opt/kayobe/images/overcloud-ubuntu-jammy \
326335
-e artifact_tag=${{ steps.host_image_tag.outputs.host_image_tag }} \
327-
-e artifact_type="kayobe-images" \
336+
-e artifact_type="kayobe-images/{{ inputs.cpu-platform-architecture }}" \
328337
-e file_regex="*.qcow2" \
329338
-e os_distribution="ubuntu" \
330339
-e os_release="jammy"
@@ -340,6 +349,7 @@ jobs:
340349
src/kayobe-config/etc/kayobe/ansible/openstack-host-image-upload.yml \
341350
-e local_image_path="/opt/kayobe/images/overcloud-ubuntu-jammy/overcloud-ubuntu-jammy.qcow2" \
342351
-e image_name=overcloud-ubuntu-jammy-${{ steps.host_image_tag.outputs.host_image_tag }}
352+
-e cpu-platform=${{ env.overcloud_dib_architechture }}
343353
env:
344354
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
345355
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}

etc/kayobe/ansible/openstack-host-image-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
hosts: seed
77
vars:
88
local_image_path: /opt/kayobe/images/overcloud-{{ os_distribution }}-{{ os_release }}/overcloud-{{ os_distribution }}-{{ os_release }}.qcow2
9-
image_name: overcloud-{{ os_distribution }}-{{ os_release }}
9+
image_name: overcloud-{{ os_distribution }}-{{ os_release }}-{{ cpu-platform }}
1010
tasks:
1111
- name: Upload image to Glance
1212
block:

etc/kayobe/environments/ci-builder/overcloud-dib.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ overcloud_dib_build_host_images: true
1818
# "packages": "{{ overcloud_dib_packages }}"}.
1919
overcloud_dib_host_images:
2020
- "{{ stackhpc_overcloud_dib_host_image }}"
21-
22-
overcloud_dib_architecture: "arm64"

etc/kayobe/kolla.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,11 @@ kolla_build_customizations: "{{ kolla_build_customizations_common | combine(koll
426426
# Dict mapping Kolla Dockerfile ARG names to their values.
427427
kolla_build_args: {}
428428

429+
###############################################################################
430+
# Kolla platform architecture configuration.
431+
432+
kolla_base_arch: "{{ 'aarch64' if stackhpc_cpu_arch == 'arm64' else 'x86' }}"
433+
429434
###############################################################################
430435
# Kolla-ansible inventory configuration.
431436

etc/kayobe/overcloud-dib.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ overcloud_dib_host_packages_extra:
6767
overcloud_dib_git_elements_extra:
6868
- repo: "https://github.com/stackhpc/stackhpc-image-elements"
6969
local: "{{ source_checkout_path }}/stackhpc-image-elements"
70-
version: "aarch64-image-build"
70+
version: "v1.6.3"
7171
elements_path: "elements"
7272

73-
74-
overcloud_dib_architecture: "arm64"
73+
# Selects the architecture of the overcloud host image being built.
74+
overcloud_dib_architechture: "{{ 'amd64' if stackhpc_cpu_arch == 'x86' else 'arm64' }}"
7575

7676
# List of git repositories containing Diskimage Builder (DIB) elements. See
7777
# stackhpc.openstack.os_images role for usage. Default is a combination of

etc/kayobe/stackhpc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ stackhpc_include_os_minor_version_in_repo_url: false
2727

2828
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' }}"
2929

30+
# Pick build architecture for kolla and disk image builder
31+
# Choose between x86 or arm64
32+
stackhpc_cpu_arch: 'x86'
33+
3034
###############################################################################
3135
# Debs
3236
# Ubuntu jammy

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
kayobe@git+https://github.com/stackhpc/kayobe@aarch64-image-build
1+
kayobe@git+https://github.com/stackhpc/kayobe@stackhpc/2024.1
22
ansible-modules-hashivault>=5.2.1
33
jmespath

0 commit comments

Comments
 (0)