Skip to content

Commit

Permalink
Refactor jobs to use scenario and test config files
Browse files Browse the repository at this point in the history
Our jobs are getting bigger, and new jobs are duplicating some
common information, while other may have different test configuration
per upstream branch
This patch tries to better organize configuration in scenario and test
files that can be shared between jobs.
  • Loading branch information
viroel committed Feb 28, 2025
1 parent e5ee092 commit 1774f1c
Show file tree
Hide file tree
Showing 4 changed files with 115 additions and 81 deletions.
98 changes: 17 additions & 81 deletions .zuul.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,75 +19,20 @@
A multinode EDPM Zuul job which has one ansible controller, one
extracted crc and two computes. It will be used for testing watcher-operator.
vars:
watcher_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
watcher_hook: "{{ watcher_repo }}/ci/playbooks/deploy_watcher_service.yaml"
watcher_coo_hook: "{{ watcher_repo }}/ci/playbooks/deploy_cluster_observability_operator.yaml"
run_tempest: false
cifmw_test_operator_concurrency: 1
cifmw_test_operator_tempest_include_list: |
watcher_tempest_plugin.*
# We need to exclude client_functional tests until we have watcherclient installed in the
# tempest container.
# Some strategies execution tests are failing. Excluding until the work on the watcher-tempest-plugin
# is finished upstream.
cifmw_test_operator_tempest_exclude_list: |
watcher_tempest_plugin.*client_functional.*
watcher_tempest_plugin.tests.scenario(?!.*\b(?:test_execute_workload_balancing|test_execute_host_maintenance|test_execute_vm_workload_consolidation)\b).*
# Donot use openstack services containers from meta content provider master
# job.
cifmw_update_containers_openstack: false
# controlplane customization to deploy telemetry service
cifmw_edpm_prepare_timeout: 60
cifmw_edpm_prepare_kustomizations:
- apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: openstack
patches:
- patch: |-
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: unused
spec:
telemetry:
enabled: true
template:
metricStorage:
enabled: true
monitoringStack:
alertingEnabled: false
target:
kind: OpenStackControlPlane
cifmw_install_yamls_whitelisted_vars: &install_yamls_whitelist
- 'WATCHER_REPO'
- 'WATCHER_BRANCH'
- 'OUTPUT_DIR'
pre_deploy_create_coo_subscription:
- name: Deploy cluster-observability-operator
type: playbook
source: "{{ watcher_coo_hook }}"
post_deploy:
- name: Deploy watcher service
type: playbook
source: "{{ watcher_hook }}"
extra_vars:
watcher_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/watcher-operator-index:{{ zuul.patchset }}"
cifmw_tempest_tempestconf_config:
overrides: |
compute.min_microversion 2.56
compute.min_compute_nodes 2
placement.min_microversion 1.29
compute-feature-enabled.live_migration true
compute-feature-enabled.block_migration_for_live_migration true
service_available.sg_core true
telemetry_services.metric_backends prometheus
telemetry.disable_ssl_certificate_validation true
telemetry.ceilometer_polling_interval 15
optimize.datasource ''
cifmw_test_operator_tempest_external_plugin:
- repository: "https://opendev.org/openstack/watcher-tempest-plugin.git"
changeRepository: "https://review.opendev.org/openstack/watcher-tempest-plugin"
changeRefspec: "refs/heads/master"
deploy_watcher_service_extra_vars:
watcher_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/watcher-operator-index:{{ zuul.patchset }}"
cifmw_extras:
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].
src_dir }}/scenarios/centos-9/multinode-ci.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].
src_dir }}/scenarios/centos-9/horizon.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/watcher-operator'].
src_dir }}/ci/scenarios/edpm.yml"
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/watcher-operator'].
src_dir }}/ci/tests/watcher-master.yml"

- job:
name: watcher-operator-validation
Expand Down Expand Up @@ -119,23 +64,14 @@
It will pull operator images from meta content provider. There is no
change in openstack services container images.
vars:
operator_name: watcher-operator
cifmw_install_yamls_whitelisted_vars: *install_yamls_whitelist
watcher_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
watcher_hook: "{{ watcher_repo }}/ci/playbooks/deploy_watcher_service.yaml"
deploy_watcher_service: false
# Do not fetch dlrn md5 hash
fetch_dlrn_hash: false
# run the hook to install watcher after installing openstack-operator.
# If we try to run the hook
# as a standalone plabyook, it tries to load the cifmw ci_script action
# plugin from the zuul executor and doesn't find it
post_install_operators_kuttl_from_operator:
- name: Deploy watcher service
type: playbook
source: "{{ watcher_hook }}"
extra_vars:
watcher_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/watcher-operator-index:{{ zuul.patchset }}"
deploy_watcher_service_extra_vars:
watcher_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/watcher-operator-index:{{ zuul.patchset }}"
deploy_watcher_service: false
cifmw_extras:
- "@{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/watcher-operator'].
src_dir }}/ci/scenarios/kuttl.yml"
extra-vars:
# Override zuul meta content provider provided content_provider_dlrn_md5_hash
# var. As returned dlrn md5 hash comes from master release but job is using
Expand Down
46 changes: 46 additions & 0 deletions ci/scenarios/edpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
watcher_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
watcher_hook: "{{ watcher_repo }}/ci/playbooks/deploy_watcher_service.yaml"
watcher_coo_hook: "{{ watcher_repo }}/ci/playbooks/deploy_cluster_observability_operator.yaml"

# Watcher deploy playbooks
pre_deploy_create_coo_subscription:
- name: Deploy cluster-observability-operator
type: playbook
source: "{{ watcher_coo_hook }}"
post_deploy:
- name: Deploy watcher service
type: playbook
source: "{{ watcher_hook }}"
extra_vars: "{{ deploy_watcher_service_extra_vars | default({}) }}"

# controlplane customization to deploy telemetry service
# customMonitoringStack is used here to allow us to enable
# enableRemoteWriteReceiver, needed when pushing fake metrics
# to Prometheus server, via watcher-tempest-plugin.
cifmw_edpm_prepare_timeout: 60
cifmw_edpm_prepare_kustomizations:
- apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: openstack
patches:
- patch: |-
apiVersion: core.openstack.org/v1beta1
kind: OpenStackControlPlane
metadata:
name: unused
spec:
telemetry:
enabled: true
template:
metricStorage:
enabled: true
monitoringStack:
alertingEnabled: false
target:
kind: OpenStackControlPlane
cifmw_install_yamls_whitelisted_vars:
- 'WATCHER_REPO'
- 'WATCHER_BRANCH'
- 'OUTPUT_DIR'
21 changes: 21 additions & 0 deletions ci/scenarios/kuttl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
watcher_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
watcher_hook: "{{ watcher_repo }}/ci/playbooks/deploy_watcher_service.yaml"

cifmw_install_yamls_whitelisted_vars:
- 'WATCHER_REPO'
- 'WATCHER_BRANCH'
- 'OUTPUT_DIR'

operator_name: watcher-operator

# run the hook to install watcher after installing openstack-operator.
# If we try to run the hook
# as a standalone plabyook, it tries to load the cifmw ci_script action
# plugin from the zuul executor and doesn't find it
post_install_operators_kuttl_from_operator:
- name: Deploy watcher service
type: playbook
source: "{{ watcher_hook }}"
extra_vars:
extra_vars: "{{ deploy_watcher_service_extra_vars | default({}) }}"
31 changes: 31 additions & 0 deletions ci/tests/watcher-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Tempest and test-operator configurations
cifmw_test_operator_tempest_external_plugin:
- repository: "https://opendev.org/openstack/watcher-tempest-plugin.git"
changeRepository: "https://review.opendev.org/openstack/watcher-tempest-plugin"
changeRefspec: "refs/heads/master"

# TODO(dviroel): Enable prometheus as datasource
cifmw_tempest_tempestconf_config:
overrides: |
compute.min_microversion 2.56
compute.min_compute_nodes 2
placement.min_microversion 1.29
compute-feature-enabled.live_migration true
compute-feature-enabled.block_migration_for_live_migration true
service_available.sg_core true
telemetry_services.metric_backends prometheus
telemetry.disable_ssl_certificate_validation true
telemetry.ceilometer_polling_interval 15
optimize.datasource ''
run_tempest: false
cifmw_test_operator_concurrency: 1
cifmw_test_operator_tempest_include_list: |
watcher_tempest_plugin.*
# We need to exclude client_functional tests until we have watcherclient installed in the
# tempest container.
# Some strategies execution tests are failing. Excluding until the work on the watcher-tempest-plugin
# is finished upstream.
cifmw_test_operator_tempest_exclude_list: |
watcher_tempest_plugin.*client_functional.*
watcher_tempest_plugin.tests.scenario(?!.*\b(?:test_execute_workload_balancing|test_execute_host_maintenance|test_execute_vm_workload_consolidation)\b).*

0 comments on commit 1774f1c

Please sign in to comment.