Modernize the Metal3 functional jobs

- Use Zuul's cloning feature for Metal3 jobs
- Provide information on how to use these jobs on stable branches.
- Hardcode the emulator information since its location keeps changing
  in the BMO repository.
- Use Zuul's cache for Cirros images

Change-Id: Icdea4eef1be0317b5c933948d031145a0ac680f6
Signed-off-by: Dmitry Tantsur <dtantsur@protonmail.com>
This commit is contained in:
Dmitry Tantsur
2026-06-26 08:56:13 +02:00
parent 31a6daca48
commit 7a26aef6c1
9 changed files with 69 additions and 65 deletions
+4
View File
@@ -283,6 +283,10 @@ is not supposed to run in stable or bugfix branches, and also comment out or
remove the tox codespell job to avoid failures due to version changes, spelling
is fixed in master and most recent stable branches only and backported "as is".
The remaining metal3 jobs can be left on stable and bugfix branches but they
need to be updated once the metal3 community follows up with its releases. See
the comments in the job definitions for instructions.
Things to do before releasing
=============================
+2
View File
@@ -3,6 +3,7 @@
hosts: all
gather_facts: no
vars:
bmo_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/baremetal-operator'].src_dir }}"
local_install_path: /usr/local
logdir: "{{ ansible_user_dir }}/metal3-logs"
bmo_artifacts: "{{ bmo_source }}/test/e2e/_artifacts"
@@ -56,6 +57,7 @@
- df -h
- df -i
- lsblk -ap
- ss -n -l -p
- name: Fetch redfish-emulator logs
shell: "docker logs vbmctl-sushy-tools > {{ logdir }}/redfish-emulator.log 2>&1"
+13 -33
View File
@@ -2,11 +2,12 @@
- name: BMO Functional Tests - Preparation
hosts: all
vars:
bmo_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/baremetal-operator'].src_dir }}"
local_install_path: /usr/local
junit2html_venv: "{{ ansible_user_dir }}/venv"
logdir: "{{ ansible_user_dir }}/metal3-logs"
bmo_branch: main
ironic_image_branch: main
# Values hardcoded in BMO tests configuration
redfish_emulator_address: 192.168.222.1
redfish_emulator_port: 8000
environment:
PATH: "{{ local_install_path }}/bin:{{ ansible_env.PATH }}"
@@ -70,43 +71,22 @@
path: "{{ logdir }}"
state: directory
- name: Checkout ironic-image
git:
repo: "https://github.com/metal3-io/ironic-image.git"
dest: "{{ ironic_image_source }}"
version: "{{ ironic_image_branch }}"
force: yes
- name: Checkout baremetal-operator
git:
repo: "https://github.com/metal3-io/baremetal-operator.git"
dest: "{{ bmo_source }}"
version: "{{ bmo_branch }}"
force: yes
- name: Download and install yq
get_url:
url: https://github.com/mikefarah/yq/releases/download/v4.53.2/yq_linux_amd64
mode: '0755'
dest: "{{ local_install_path }}/bin/yq"
become: yes
- name: Get sushy-tools IP address
command: yq '.spec.networks[0].address' '{{ bmo_source }}/test/e2e/config/vbmctl.yaml'
register: redfish_emulator_address
- name: Get sushy-tools bridge name
command: yq '.spec.networks[0].bridge' '{{ bmo_source }}/test/e2e/config/vbmctl.yaml'
register: redfish_emulator_bridge
- name: Enable access to sushy-tools in iptables
iptables:
chain: INPUT
protocol: tcp
destination: "{{ redfish_emulator_address.stdout | trim }}"
destination: "{{ redfish_emulator_address }}"
destination_port: "{{ redfish_emulator_port }}"
in_interface: "{{ redfish_emulator_bridge.stdout | trim }}"
jump: ACCEPT
action: insert
rule_num: 1
become: yes
- name: Copy cached Cirros images
synchronize:
src: "/opt/cache/files/"
dest: "{{ bmo_source }}/test/e2e/images/"
rsync_opts:
- '--include=cirros-*-disk.img'
- '--exclude=*'
delegate_to: "{{ inventory_hostname }}"
+2
View File
@@ -2,9 +2,11 @@
- name: BMO Functional Tests
hosts: all
vars:
ironic_image_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/ironic-image'].src_dir }}"
local_install_path: /usr/local
redfish_emulator_port: 8000
environment:
IRONIC_CUSTOM_VERSION: "{{ ironic_custom_version }}"
IRONIC_SOURCE: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/ironic'].src_dir }}"
PATH: "{{ local_install_path }}/go/bin:{{ local_install_path }}/bin:{{ ansible_env.PATH }}"
BMC_PROTOCOL: redfish-virtualmedia
+2
View File
@@ -3,6 +3,7 @@
hosts: all
gather_facts: no
vars:
irso_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/ironic-standalone-operator'].src_dir }}"
local_install_path: /usr/local
logdir: "{{ ansible_user_dir }}/metal3-logs"
junit_output: "{{ logdir }}/report.xml"
@@ -51,6 +52,7 @@
- df -h
- df -i
- lsblk -ap
- ss -n -l -p
- name: Copy logs to the zuul location
synchronize:
+1 -11
View File
@@ -2,6 +2,7 @@
- name: IrSO Functional Tests - Preparation
hosts: all
vars:
irso_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/ironic-standalone-operator'].src_dir }}"
local_install_path: /usr/local
junit2html_venv: "{{ ansible_user_dir }}/venv"
kubectl_version: "1.33.4"
@@ -51,17 +52,6 @@
path: "{{ logdir }}"
state: directory
- name: Checkout Metal3 repositories
git:
repo: "https://github.com/metal3-io/{{ item.name }}.git"
dest: "{{ item.path }}"
force: yes
loop:
- name: ironic-image
path: "{{ ironic_image_source }}"
- name: ironic-standalone-operator
path: "{{ irso_source }}"
- name: Calculate go version
shell: make -sC "{{ irso_source }}" go-version 2> /dev/null | tail -n1
register: go_version
+3 -2
View File
@@ -2,13 +2,14 @@
- name: IrSO Functional Tests
hosts: all
vars:
ironic_image_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/ironic-image'].src_dir }}"
irso_source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/metal3-io/ironic-standalone-operator'].src_dir }}"
local_install_path: /usr/local
logdir: "{{ ansible_user_dir }}/metal3-logs"
environment:
CLUSTER_TYPE: minikube
CONTAINER_RUNTIME: docker
IRONIC_CUSTOM_IMAGE: localhost/ironic:test
IRONIC_CUSTOM_VERSION: latest
IRONIC_CUSTOM_VERSION: "{{ ironic_custom_version }}"
IRONIC_SOURCE: "{{ ansible_user_dir }}/{{ zuul.projects['opendev.org/openstack/ironic'].src_dir }}"
LOGDIR: "{{ logdir }}"
PATH: "{{ local_install_path }}/go/bin:{{ local_install_path }}/bin:{{ ansible_env.PATH }}"
+39 -18
View File
@@ -2,7 +2,7 @@
- job:
name: metal3-base
abstract: true
description: Base job for metal3-dev-env based ironic jobs.
description: Base job for metal3 based ironic jobs.
nodeset: ironic-single-node-noble
timeout: 5400
required-projects:
@@ -24,6 +24,7 @@
name: metal3-integration
description: Run metal3 CI on ironic.
parent: metal3-base
timeout: 7200
run: playbooks/metal3-ci/run.yaml
post-run: playbooks/metal3-ci/post.yaml
@@ -44,21 +45,31 @@
pre-run: playbooks/irso-ci/pre.yaml
run: playbooks/irso-ci/run.yaml
post-run: playbooks/irso-ci/post.yaml
timeout: 7200
nodeset: ironic-single-node-noble
required-projects:
- opendev.org/openstack/ironic
# FIXME(dtantsur): add these to zuul config and stop cloning manually
# - github.com/metal3-io/ironic-image
# - github.com/metal3-io/ironic-standalone-operator
- name: github.com/metal3-io/ironic-image
# NOTE(dtantsur): to run this job on stable or bugfix branches, update
# the overridden checkout with the corresponding ironic-image branch
# once it's created and set ironic_custom_version as described below.
# Example: release-35.0
override-checkout: main
- name: github.com/metal3-io/ironic-standalone-operator
# NOTE(dtantsur): IrSO is compatible with the 3 latest Ironic releases.
# Update this pin once the IrSO branch is created (a few days or a week
# after an ironic-image release) to avoid issues down the road.
# Example: release-0.9
override-checkout: main
vars:
ironic_image_source: "{{ ansible_user_dir }}/ironic-image"
irso_source: "{{ ansible_user_dir }}/ironic-standalone-operator"
# NOTE(dtantsur): this version field tells IrSO which features to expect
# from Ironic and thus what to test. Update this field once the
# corresponding version of ironic-image is released and IrSO is updated
# to support it. Using old values may require pinning IrSO branch.
# Example: 35.0
ironic_custom_version: latest
- job:
name: metal3-baremetal-operator-functional
description: |
BareMetal Operator (BMO) functional tests tests.
BareMetal Operator (BMO) functional tests.
These tests set up a Kind cluster with virtual bare metal hosts using
libvirt, deploy Ironic and BMO, and run the BMO e2e test suite.
@@ -69,13 +80,23 @@
pre-run: playbooks/bmo-ci/pre.yaml
run: playbooks/bmo-ci/run.yaml
post-run: playbooks/bmo-ci/post.yaml
timeout: 7200
nodeset: ironic-single-node-noble
required-projects:
- opendev.org/openstack/ironic
# FIXME(dtantsur): add these to zuul config and stop cloning manually
# - github.com/metal3-io/ironic-image
# - github.com/metal3-io/baremetal-operator
- name: github.com/metal3-io/ironic-image
# NOTE(dtantsur): to run this job on stable or bugfix branches, update
# the overridden checkout with the corresponding ironic-image branch
# once it's created and set ironic_custom_version as described above.
# Example: release-35.0
override-checkout: main
- name: github.com/metal3-io/baremetal-operator
# NOTE(dtantsur): BMO is normally compatible with a wide range of
# Ironic versions, but the tests may assume newer functionality.
# Additionally, BMO's CI scripts bundle a specific version of IrSO, and
# that version may become incompatible with older versions of Ironic.
# It's recommended to pin this checkout eventually on older branches.
# Example: release-0.12
override-checkout: main
vars:
ironic_image_source: "{{ ansible_user_dir }}/ironic-image"
bmo_source: "{{ ansible_user_dir }}/baremetal-operator"
# NOTE(dtantsur): this version field tells IrSO which features to expect
# from Ironic and thus what to test. See the IrSO job definition for
# information on how and when to update it.
ironic_custom_version: latest
+3 -1
View File
@@ -56,13 +56,15 @@
# CI Jobs Below this line may be *removed* on Stable Branches #
###############################################################
# NOTE(TheJulia): At present, metal3 doesn't leverage
# stable branches, and as far as we are aware these jobs
# stable branches, and as far as we are aware this job
# can be removed once this branch is made stable.
# TODO(TheJulia): Re-enable the metal3-integration job once we
# figure out what is going on with it and quay regarding
# 502 Bad Gateway errors when accessing containers.
- metal3-integration:
voting: false
# NOTE(dtantsur) see comments in zuul.d/metal3-jobs.yaml on how to
# configure these 2 jobs for stable and bugfix branches.
- metal3-baremetal-operator-functional:
voting: false
- metal3-ironic-standalone-operator-functional: