Skip to content

Commit 943f4b3

Browse files
committed
add basic zuul jobs
This change adds 2 new zuul jobs first we leaverge the common zuul kuttl job that is designed to run kuttl form in tree. to enable that i have ported the webhook install fix form nova-operator second the nova-operator-tempest-multinode job is used as a base for a placemnet version to provide tempest coverage on placement operator changes.
1 parent 942d238 commit 943f4b3

File tree

5 files changed

+199
-1
lines changed

5 files changed

+199
-1
lines changed

.zuul.yaml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,69 @@
11
---
2+
- job:
3+
name: placement-operator-kuttl
4+
parent: cifmw-multinode-kuttl-operator-target
5+
dependencies: ["openstack-meta-content-provider"]
6+
roles:
7+
- zuul: github.com/openstack-k8s-operators/ci-framework
8+
post-run:
9+
- ci/playbooks/collect-logs.yaml
10+
vars:
11+
collection_namespace_override: "placement-kuttl-default"
12+
operator_name: placement-operator
13+
placement_repo: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/placement-operator"
14+
zuul_log_collection: true
15+
placement_hook: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/placement-operator'].src_dir }}/ci/placement-operator-kuttl/deploy_webhooks.yaml"
16+
pre_kuttl_from_operator:
17+
- name: 70 Create placement webhooks
18+
type: playbook
19+
source: "{{ placement_hook }}"
20+
extra_vars:
21+
placement_catalog_image: "{{ content_provider_registry_ip }}:5001/openstack-k8s-operators/placement-operator-index:{{ zuul.patchset }}"
22+
extra-vars:
23+
crc_ci_bootstrap_networking:
24+
networks:
25+
default:
26+
range: 192.168.122.0/24
27+
mtu: 1500
28+
internal-api:
29+
vlan: 20
30+
range: 172.17.0.0/24
31+
storage:
32+
vlan: 21
33+
range: 172.18.0.0/24
34+
tenant:
35+
vlan: 22
36+
range: 172.19.0.0/24
37+
instances:
38+
controller:
39+
networks:
40+
default:
41+
ip: 192.168.122.11
42+
crc:
43+
networks:
44+
default:
45+
ip: 192.168.122.10
46+
internal-api:
47+
ip: 172.17.0.5
48+
storage:
49+
ip: 172.18.0.5
50+
tenant:
51+
ip: 172.19.0.5
52+
53+
- job:
54+
name: placement-operator-tempest-multinode
55+
parent: nova-operator-tempest-multinode
56+
vars:
57+
cifmw_test_operator_tempest_include_list: |
58+
'(?!.*\[.*\bslow\b.*\])(^tempest\.api)'
59+
'(?!.*\[.*\bslow\b.*\])(^tempest\.scenario)|(^tempest\.serial_tests)'
260
361
- project:
462
name: openstack-k8s-operators/placement-operator
563
default-branch: main
664
merge-mode: rebase
765
github-check:
866
jobs:
9-
- noop
67+
- openstack-meta-content-provider
68+
- placement-operator-kuttl
69+
- placement-operator-tempest-multinode

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ DEFAULT_IMG ?= quay.io/openstack-k8s-operators/placement-operator:latest
5555
IMG ?= $(DEFAULT_IMG)
5656
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
5757
ENVTEST_K8S_VERSION = 1.29
58+
CATALOG_IMAGE ?= quay.io/openstack-k8s-operators/placement-operator-index:latest
5859

5960
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
6061
ifeq (,$(shell go env GOBIN))
@@ -384,3 +385,10 @@ PHONY: crd-schema-check
384385
crd-schema-check: manifests
385386
INSTALL_DIR=$(LOCALBIN) CRD_SCHEMA_CHECKER_VERSION=$(CRD_SCHEMA_CHECKER_VERSION) hack/build-crd-schema-checker.sh
386387
INSTALL_DIR=$(LOCALBIN) BASE_REF="$${PULL_BASE_SHA:-$(BRANCH)}" hack/crd-schema-checker.sh
388+
389+
.PHONY: run_with_olm
390+
run_with_olm: export CATALOG_IMG=${CATALOG_IMAGE}
391+
run_with_olm: ## Install placement operator via olm
392+
bash ci/olm.sh
393+
oc apply -f ci/olm.yaml
394+
timeout 300s bash -c "while ! (oc get csv -n openstack-operators -l operators.coreos.com/placement-operator.openstack-operators -o jsonpath='{.items[*].status.phase}' | grep Succeeded); do sleep 1; done"

ci/olm.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
cat > ci/olm.yaml <<EOF_CAT
2+
---
3+
apiVersion: v1
4+
kind: Namespace
5+
metadata:
6+
name: openstack-operators
7+
labels:
8+
pod-security.kubernetes.io/enforce: privileged
9+
security.openshift.io/scc.podSecurityLabelSync: "false"
10+
---
11+
apiVersion: operators.coreos.com/v1alpha1
12+
kind: CatalogSource
13+
metadata:
14+
name: placement-operator-index
15+
namespace: openstack-operators
16+
spec:
17+
image: ${CATALOG_IMG}
18+
sourceType: grpc
19+
---
20+
apiVersion: operators.coreos.com/v1
21+
kind: OperatorGroup
22+
metadata:
23+
name: openstack
24+
namespace: openstack-operators
25+
---
26+
apiVersion: operators.coreos.com/v1alpha1
27+
kind: Subscription
28+
metadata:
29+
name: placement-operator
30+
namespace: openstack-operators
31+
spec:
32+
name: placement-operator
33+
channel: alpha
34+
source: placement-operator-index
35+
sourceNamespace: openstack-operators
36+
EOF_CAT
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
- name: Create custom service
2+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
3+
environment:
4+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
5+
PATH: "{{ cifmw_path }}"
6+
gather_facts: false
7+
tasks:
8+
- name: Scale down deployment
9+
ansible.builtin.shell: |
10+
oc patch csv -n openstack-operators openstack-operator.v0.0.1 --type json -p="[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value": "0"}]"
11+
- name: Install Placement Operator
12+
cifmw.general.ci_script:
13+
output_dir: "{{ cifmw_basedir }}/artifacts"
14+
chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/placement-operator"
15+
script: make run_with_olm
16+
extra_args:
17+
CATALOG_IMAGE: "{{ placement_catalog_image }}"

ci/playbooks/collect-logs.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
- hosts: controller
3+
name: Collect logs on the controller
4+
gather_facts: false
5+
vars:
6+
collection_namespace: "{{ collection_namespace_override | default('openstack') }}"
7+
tasks:
8+
- name: Create log dir
9+
ansible.builtin.file:
10+
path: "{{ ansible_user_dir }}/zuul-output/logs/controller"
11+
state: directory
12+
mode: "0755"
13+
- name: Collect general openshift cr info
14+
environment:
15+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
16+
PATH: "{{ cifmw_path | default(ansible_env.PATH) }}"
17+
ansible.builtin.shell: |
18+
source ~/.bashrc
19+
collection_namespace_dir="{{ ansible_user_dir }}/zuul-output/logs/controller/{{collection_namespace}}"
20+
mkdir ${collection_namespace_dir}
21+
pushd ${collection_namespace_dir}
22+
oc get -n {{collection_namespace}} secrets > all_secrets.txt
23+
oc get -n {{collection_namespace}} pv > all_pv.txt
24+
oc get -n {{collection_namespace}} events > oc_events.txt
25+
oc get -n {{collection_namespace}} routes > oc_routes.txt
26+
oc get -n {{collection_namespace}} all > oc_all.txt
27+
popd
28+
pod_dir="${collection_namespace_dir}/pods"
29+
mkdir ${pod_dir}
30+
pushd ${pod_dir}
31+
all_pods=$(oc get -n {{collection_namespace}} pods | awk '{print $1}' | awk -F '.' '{print $1}')
32+
for pod in $all_pods; do
33+
echo $pod
34+
oc logs -n {{collection_namespace}} pod/${pod} > ${pod}-logs.txt
35+
oc get -n {{collection_namespace}} -o yaml pod/${pod} > ${pod}.yaml
36+
oc describe -n {{collection_namespace}} pod/${pod} > ${pod}-describe.txt
37+
done
38+
popd
39+
crd_logs="${collection_namespace_dir}/crd"
40+
mkdir ${crd_logs}
41+
pushd ${crd_logs}
42+
all_crds=$(oc get crd | grep openstack | awk '{print $1}' | awk -F '.' '{print $1}')
43+
for cr in $all_crds; do
44+
echo $crd
45+
oc get -n {{collection_namespace}} -o yaml $cr > ${cr}.yaml
46+
oc describe -n {{collection_namespace}} $cr > ${cr}-describe.txt
47+
done
48+
popd
49+
openstack_operator_namespace_dir="{{ ansible_user_dir }}/zuul-output/logs/controller/openstack-operators"
50+
mkdir ${openstack_operator_namespace_dir}
51+
csv_logs="${openstack_operator_namespace_dir}/csv"
52+
mkdir ${csv_logs}
53+
pushd ${csv_logs}
54+
all_csv=$(oc get -n openstack-operators csv | awk '{print $1}')
55+
for csv in $all_csv; do
56+
echo $crd
57+
oc get -n openstack-operators -o yaml csv/${csv} > ${csv}.yaml
58+
oc describe -n openstack-operators csv/${csv} > ${csv}-describe.txt
59+
done
60+
popd
61+
pod_dir="${openstack_operator_namespace_dir}/pods"
62+
mkdir ${pod_dir}
63+
pushd ${pod_dir}
64+
all_pods=$(oc get -n openstack-operators pods | awk '{print $1}' | awk -F '.' '{print $1}')
65+
for pod in $all_pods; do
66+
echo $pod
67+
oc logs -n openstack-operators pod/${pod} > ${pod}-logs.txt
68+
oc get -n openstack-operators -o yaml pod/${pod} > ${pod}.yaml
69+
oc describe -n openstack-operators pod/${pod} > ${pod}-describe.txt
70+
done
71+
popd
72+
args:
73+
chdir: "{{ ansible_user_dir }}/zuul-output/logs/controller"
74+
changed_when: true
75+
ignore_errors: true
76+
tags:
77+
- skip_ansible_lint

0 commit comments

Comments
 (0)