Skip to content

Commit f9daa75

Browse files
committed
Test opendev watcher master content in CI job
In order to test opendev watcher master content in CI job, this pr adds following things: * opendev-master-watcher-operator-pipeline project template which will run meta content provider from master and then Deploy EDPM job watcher-operator-validation-master from master content. It will help to test any opendev watcher patches with master edpm job. * It changes the existing job watcher-operator-validation (still deploying the antelope content) with update_containers: false to avoid using meta content provider containers. This change will help to test master content with antelope job as in downstream, we are going to backport lots of watcher master patches downstream. It will help to avoid breakage in advance. * It also updates the existing watcher-operator-validation and watcher-operator-kuttl job to use openstack-meta-content-provider-master as a job dependencies. Depends-On: https://review.opendev.org/c/openstack/watcher/+/938893 Depends-On: openstack-k8s-operators/ci-framework#2675 Related-Jira: https://issues.redhat.com/browse/OSPRH-13660 Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
1 parent 65536a3 commit f9daa75

File tree

4 files changed

+123
-13
lines changed

4 files changed

+123
-13
lines changed

.zuul.yaml

Lines changed: 83 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,35 @@
22
- project:
33
name: openstack-k8s-operators/watcher-operator
44
default-branch: main
5+
templates:
6+
- opendev-master-watcher-operator-pipeline
57
github-check:
68
jobs:
79
- noop
810
- watcher-operator-doc-preview
9-
- openstack-meta-content-provider:
10-
vars:
11-
cifmw_operator_build_meta_build: false
1211
- watcher-operator-validation
1312
- watcher-operator-kuttl
1413

1514
- job:
1615
name: watcher-operator-base
1716
parent: podified-multinode-edpm-deployment-crc-2comp
18-
dependencies: ["openstack-meta-content-provider"]
17+
dependencies: ["openstack-meta-content-provider-master"]
1918
description: |
2019
A multinode EDPM Zuul job which has one ansible controller, one
2120
extracted crc and two computes. It will be used for testing watcher-operator.
2221
vars:
2322
watcher_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
2423
watcher_hook: "{{ watcher_repo }}/ci/playbooks/deploy_watcher_service.yaml"
2524
watcher_coo_hook: "{{ watcher_repo }}/ci/playbooks/deploy_cluster_observability_operator.yaml"
25+
run_tempest: false
26+
# Based on current testing, https://github.com/openstack-k8s-operators/watcher-operator/pull/47#issuecomment-2607474033
27+
# We need decision engine and applier CRD to ready to run
28+
# whole test suite
29+
cifmw_test_operator_tempest_include_list: |
30+
watcher_tempest_plugin.tests.api.admin.test_api_discovery.TestApiDiscovery
31+
# Donot use openstack services containers from meta content provider master
32+
# job.
33+
cifmw_update_containers_openstack: false
2634
# controlplane customization to deploy telemetry service
2735
cifmw_edpm_prepare_timeout: 60
2836
cifmw_edpm_prepare_kustomizations:
@@ -65,25 +73,37 @@
6573
parent: watcher-operator-base
6674
description: |
6775
A zuul job to validate the watcher operator and its service deployment.
76+
It will deploy podified and EDPM using current-podified antelope content.
77+
During watcher deployment, It will fetch master current-podified hash and pull
78+
openstack watcher services containers from meta content provider.
79+
It will test current-podified control plane EDPM deployment with openstack watcher
80+
master content.
81+
extra-vars:
82+
# Override zuul meta content provider provided content_provider_dlrn_md5_hash
83+
# var. As returned dlrn md5 hash comes from master release but job is using
84+
# antelope content.
85+
content_provider_dlrn_md5_hash: ''
6886
vars:
69-
run_tempest: false
70-
# Based on current testing, https://github.com/openstack-k8s-operators/watcher-operator/pull/47#issuecomment-2607474033
71-
# We need decision engine and applier CRD to ready to run
72-
# whole test suite
73-
cifmw_test_operator_tempest_include_list: |
74-
watcher_tempest_plugin.tests.api.admin.test_api_discovery.TestApiDiscovery
87+
# Donot use openstack services containers from meta content provider master
88+
# job.
89+
cifmw_update_containers_openstack: false
7590

7691
- job:
7792
name: watcher-operator-kuttl
93+
dependencies: ["openstack-meta-content-provider-master"]
7894
parent: cifmw-multinode-kuttl-operator-target
7995
description: |
8096
A zuul job to run watcher operator kuttl tests.
97+
It will pull operator images from meta content provider. There is no
98+
change in openstack services container images.
8199
vars:
82100
operator_name: watcher-operator
83101
cifmw_install_yamls_whitelisted_vars: *install_yamls_whitelist
84102
watcher_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
85103
watcher_hook: "{{ watcher_repo }}/ci/playbooks/deploy_watcher_service.yaml"
86104
deploy_watcher_service: false
105+
# Do not fetch dlrn md5 hash
106+
fetch_dlrn_hash: false
87107
# run the hook to install watcher at the end of the cifmw infra playbook. If we try to run it
88108
# as a standalone plabyook, it tries to load the cifmw ci_script action
89109
# plugin from the zuul executor and doesn't find it
@@ -93,6 +113,13 @@
93113
source: "{{ watcher_hook }}"
94114
extra_vars:
95115
watcher_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/watcher-operator-index:{{ zuul.patchset }}"
116+
extra-vars:
117+
# Override zuul meta content provider provided content_provider_dlrn_md5_hash
118+
# var. As returned dlrn md5 hash comes from master release but job is using
119+
# antelope content.
120+
content_provider_dlrn_md5_hash: ''
121+
# We also need to override the registry otherwise kuttl test will fail
122+
content_provider_os_registry_url: "quay.io/podified-master-centos9"
96123

97124
- job:
98125
name: watcher-operator-doc-preview
@@ -103,3 +130,49 @@
103130
vars:
104131
asciidoc_available: true
105132
doc_available: false
133+
134+
##########################################################
135+
# #
136+
# Master Zuul Jobs #
137+
# #
138+
##########################################################
139+
- job:
140+
name: openstack-meta-content-provider-master
141+
description: |
142+
A zuul job building content from OpenDev master release.
143+
parent: openstack-meta-content-provider
144+
vars:
145+
cifmw_operator_build_meta_build: false
146+
cifmw_bop_openstack_release: master
147+
cifmw_bop_dlrn_baseurl: "https://trunk.rdoproject.org/centos9-master"
148+
cifmw_repo_setup_branch: master
149+
cifmw_build_containers_registry_namespace: podified-master-centos9
150+
151+
- job:
152+
name: watcher-operator-validation-master
153+
parent: watcher-operator-base
154+
description: |
155+
A Zuul job consuming content from openstack-meta-content-provider-master
156+
and deploying EDPM with master content.
157+
vars:
158+
cifmw_repo_setup_branch: master
159+
# To consume containers from meta content provider
160+
cifmw_update_containers_openstack: true
161+
cifmw_update_containers_org: podified-master-centos9
162+
163+
##########################################################
164+
# #
165+
# Project Template #
166+
# #
167+
##########################################################
168+
169+
- project-template:
170+
name: opendev-master-watcher-operator-pipeline
171+
description: |
172+
Project template to run meta content provider and
173+
EDPM job with master opendev and github operator
174+
content.
175+
github-check:
176+
jobs:
177+
- openstack-meta-content-provider-master
178+
- watcher-operator-validation-master

Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,8 +375,14 @@ update-watcher-csv:
375375
fi
376376

377377
CATALOG_IMAGE ?= quay.io/openstack-k8s-operators/watcher-operator-index:latest
378+
WATCHER_API_IMAGE_URL_DEFAULT ?= quay.io/podified-master-centos9/openstack-watcher-api:current-podified
379+
WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT ?= quay.io/podified-master-centos9/openstack-watcher-decision-engine:current-podified
380+
WATCHER_APPLIER_IMAGE_URL_DEFAULT ?= quay.io/podified-master-centos9/openstack-watcher-applier:current-podified
378381

379382
.PHONY: watcher
383+
watcher: export WATCHER_API_IMAGE=${WATCHER_API_IMAGE_URL_DEFAULT}
384+
watcher: export WATCHER_DECISION_ENGINE_IMAGE=${WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT}
385+
watcher: export WATCHER_APPLIER_IMAGE=${WATCHER_APPLIER_IMAGE_URL_DEFAULT}
380386
watcher: export CATALOG_IMG=${CATALOG_IMAGE}
381387
watcher: ## Install watcher operator via olm
382388
bash ci/olm.sh
@@ -454,9 +460,9 @@ SKIP_CERT ?=false
454460
.PHONY: run-with-webhook
455461
run-with-webhook: export METRICS_PORT?=33080
456462
run-with-webhook: export HEALTH_PORT?=33081
457-
run-with-webhook: export WATCHER_API_IMAGE_URL_DEFAULT=quay.io/podified-master-centos9/openstack-watcher-api:current-podified
458-
run-with-webhook: export WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT=quay.io/podified-master-centos9/openstack-watcher-decision-engine:current-podified
459-
run-with-webhook: export WATCHER_APPLIER_IMAGE_URL_DEFAULT=quay.io/podified-master-centos9/openstack-watcher-applier:current-podified
463+
run-with-webhook: export WATCHER_API_IMAGE_URL_DEFAULT=${WATCHER_API_IMAGE_URL_DEFAULT}
464+
run-with-webhook: export WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT=${WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT}
465+
run-with-webhook: export WATCHER_APPLIER_IMAGE_URL_DEFAULT=${WATCHER_APPLIER_IMAGE_URL_DEFAULT}
460466
run-with-webhook: manifests generate fmt vet ## Run a controller from your host.
461467
/bin/bash hack/clean_local_webhook.sh
462468
/bin/bash hack/run_with_local_webhook.sh

ci/olm.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,12 @@ spec:
4545
channel: alpha
4646
source: watcher-operator-index
4747
sourceNamespace: openstack-operators
48+
config:
49+
env:
50+
- name: WATCHER_API_IMAGE_URL_DEFAULT
51+
value: ${WATCHER_API_IMAGE}
52+
- name: WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT
53+
value: ${WATCHER_DECISION_ENGINE_IMAGE}
54+
- name: WATCHER_APPLIER_IMAGE_URL_DEFAULT
55+
value: ${WATCHER_APPLIER_IMAGE}
4856
EOF_CAT

ci/playbooks/deploy_watcher_service.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,36 @@
88
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
99
PATH: "{{ cifmw_path }}"
1010
tasks:
11+
- name: Fetch dlrn md5_hash from DLRN repo
12+
when: fetch_dlrn_hash | default(true) | bool
13+
ansible.builtin.uri:
14+
url: "https://{{ watcher_dlrn_server | default('trunk.rdoproject.org') }}/{{ watcher_dlrn_namespace | default('centos9-master') }}/{{ watcher_dlrn_tag | default('current-podified') }}/delorean.repo.md5"
15+
return_content: true
16+
register: latest_dlrn_tag
17+
until: latest_dlrn_tag.status == 200
18+
retries: 6
19+
delay: 5
20+
1121
- name: Install Watcher Operator
22+
vars:
23+
_tag: "{{ latest_dlrn_tag.content | default('current-podified') }}"
24+
# When there is no Depends-On from opendev, then content_provider_os_registry_url will return null
25+
# value to child job. In that case, we need to set default to quay registry.
26+
_registry_url: >-
27+
{%- if content_provider_os_registry_url is defined and content_provider_os_registry_url == 'null' -%}
28+
quay.io/podified-master-centos9
29+
{%- else -%}
30+
{{ content_provider_os_registry_url | default('quay.io/podified-master-centos9') }}
31+
{%- endif -%}
1232
cifmw.general.ci_script:
1333
output_dir: "{{ cifmw_basedir }}/artifacts"
1434
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/watcher-operator"
1535
script: make watcher
1636
extra_args:
1737
CATALOG_IMAGE: "{{ watcher_catalog_image | default('quay.io/openstack-k8s-operators/watcher-operator-index:latest') }}"
38+
WATCHER_API_IMAGE_URL_DEFAULT: "{{ _registry_url }}/openstack-watcher-api:{{ _tag }}"
39+
WATCHER_DECISION_ENGINE_IMAGE_URL_DEFAULT: "{{ _registry_url }}/openstack-watcher-decision-engine:{{ _tag }}"
40+
WATCHER_APPLIER_IMAGE_URL_DEFAULT: "{{ _registry_url }}/openstack-watcher-applier:{{ _tag }}"
1841

1942
- name: Deploy Watcher service
2043
when: deploy_watcher_service | default('true') | bool

0 commit comments

Comments
 (0)