From 68c78b28cae81c4748a77c7ebe74102fcabf6dcf Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Mon, 13 Nov 2023 15:57:43 +0000 Subject: [PATCH 01/12] [zuul] Update base job for stf-base * Add in required projects: dataplane-operator, infra-operator, openstack-operator * Remove nodeset from stf-base it overrides the nodeset set in the base job. The nodeset is going to be used to select the OCP version --- .zuul.yaml | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 2 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 994d65327..fec4488d1 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,8 +1,62 @@ --- +- job: + name: stf-base-2node + parent: podified-multinode-edpm-deployment-crc + nodeset: + nodes: + - name: controller + label: cloud-centos-9-stream-tripleo-vexxhost + - name: crc + label: coreos-crc-extracted-xxl + abstract: true + required-projects: + - name: openstack-k8s-operators/dataplane-operator + override-checkout: main + - name: openstack-k8s-operators/infra-operator + override-checkout: main + - name: github.com/openstack-k8s-operators/openstack-operator + override-checkout: main + - name: openstack-k8s-operators/openstack-must-gather + override-checkout: main + vars: + cifmw_deploy_edpm: false + podified_validation: true + cifmw_run_tests: false + extra-vars: + crc_ci_bootstrap_networking: + networks: + default: + range: 192.168.122.0/24 + mtu: 1500 + internal-api: + vlan: 20 + range: 172.17.0.0/24 + storage: + vlan: 21 + range: 172.18.0.0/24 + tenant: + vlan: 22 + range: 172.19.0.0/24 + instances: + controller: + networks: + default: + ip: 192.168.122.11 + crc: + networks: + default: + ip: 192.168.122.10 + internal-api: + ip: 172.17.0.5 + storage: + ip: 172.18.0.5 + tenant: + ip: 172.19.0.5 + - job: name: stf-base # defined in: https://review.rdoproject.org/cgit/config/tree/zuul.d/_jobs-crc.yaml - parent: base-simple-crc + parent: stf-base-2node abstract: true description: | Run the stf-run-ci role, and then test stf @@ -24,7 +78,6 @@ - ci/test_stf.yml post-run: - ci/post-collect_logs.yml - nodeset: centos-9-crc-xxl # The default (~30 minutes) is not enough to run through all the job stages timeout: 3600 vars: From 065c9c33153760aedc48f3281a52ccd027bc8723 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Mon, 11 Dec 2023 18:39:19 +0000 Subject: [PATCH 02/12] [zuul] define nodesets for easy reuse * Define the nodeset * Rename the base * Select OCP version with the nodeset --- .zuul.yaml | 92 +++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 63 insertions(+), 29 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index fec4488d1..d8a8da21b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,13 +1,31 @@ --- +- nodeset: + name: stf-crc_extracted-ocp412 + nodes: + - name: controller + label: cloud-centos-9-stream-tripleo-vexxhost + - name: crc + label: coreos-crc-extracted-2.19.0-xxl + +- nodeset: + name: stf-crc_extracted-ocp413 + nodes: + - name: controller + label: cloud-centos-9-stream-tripleo-vexxhost + - name: crc + label: coreos-crc-extracted-2.28.0-xxl + +- nodeset: + name: stf-crc_extracted-ocp414 + nodes: + - name: controller + label: cloud-centos-9-stream-tripleo-vexxhost + - name: crc + label: coreos-crc-extracted-2.30.0-xxl + - job: name: stf-base-2node parent: podified-multinode-edpm-deployment-crc - nodeset: - nodes: - - name: controller - label: cloud-centos-9-stream-tripleo-vexxhost - - name: crc - label: coreos-crc-extracted-xxl abstract: true required-projects: - name: openstack-k8s-operators/dataplane-operator @@ -80,9 +98,6 @@ - ci/post-collect_logs.yml # The default (~30 minutes) is not enough to run through all the job stages timeout: 3600 - vars: - # Pass vars to crc cli https://review.rdoproject.org/cgit/config/tree/playbooks/crc/simple-start.yaml#n30 - crc_parameters: '--memory 16000 --disk-size 80 --cpus 6' # Increase from 14336 - job: name: stf-crc-nightly_bundles @@ -115,49 +130,64 @@ name: stf-crc-ocp_412-nightly_bundles parent: stf-crc-nightly_bundles description: | - Deploy STF using the nightly bundles on OCP 4.12 - vars: - crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.12.13/crc_libvirt_4.12.13_amd64.crcbundle' + Deploy STF using the nightly bundles on OCP 4.12.13 + nodeset: stf-crc_extracted-ocp412 - job: name: stf-crc-ocp_413-nightly_bundles parent: stf-crc-nightly_bundles description: | - Deploy STF using the nightly bundles on OCP 4.13 - vars: - crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.13.14/crc_libvirt_4.13.14_amd64.crcbundle' + Deploy STF using the nightly bundles on OCP 4.13.14 + nodeset: stf-crc_extracted-ocp413 + +- job: + name: stf-crc-ocp_414-nightly_bundles + parent: stf-crc-nightly_bundles + description: | + Deploy STF using the nightly bundles on OCP 4.14.3 + nodeset: stf-crc_extracted-ocp414 - job: name: stf-crc-ocp_412-local_build parent: stf-crc-local_build description: | - Build images locally and deploy STF on OCP 4.12 - vars: - crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.12.13/crc_libvirt_4.12.13_amd64.crcbundle' + Build images locally and deploy STF on OCP 4.12.13 + nodeset: stf-crc_extracted-ocp412 - job: name: stf-crc-ocp_413-local_build parent: stf-crc-local_build description: | - Build images locally and deploy STF on OCP 4.13 - vars: - crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.13.14/crc_libvirt_4.13.14_amd64.crcbundle' + Build images locally and deploy STF on OCP 4.13.14 + nodeset: stf-crc_extracted-ocp413 + +- job: + name: stf-crc-ocp_414-local_build + parent: stf-crc-local_build + description: | + Build images locally and deploy STF on OCP 4.14.3 + nodeset: stf-crc_extracted-ocp414 - job: name: stf-crc-ocp_412-local_build-index_deploy parent: stf-crc-local_build-index_deploy description: | - Build STF locally and deploy from index on OCP 4.12 - vars: - crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.12.13/crc_libvirt_4.12.13_amd64.crcbundle' + Build STF locally and deploy from index on OCP 4.12.13 + nodeset: stf-crc_extracted-ocp412 - job: name: stf-crc-ocp_413-local_build-index_deploy parent: stf-crc-local_build-index_deploy description: | - Build STF locally and deploy from index on OCP 4.13 - vars: - crc_ocp_bundle: 'https://mirror.openshift.com/pub/openshift-v4/clients/crc/bundles/openshift/4.13.14/crc_libvirt_4.13.14_amd64.crcbundle' + Build STF locally and deploy from index on OCP 4.13.14 + nodeset: stf-crc_extracted-ocp413 + +- job: + name: stf-crc-ocp_414-local_build-index_deploy + parent: stf-crc-local_build-index_deploy + description: | + Build STF locally and deploy from index on OCP 4.14.3 + nodeset: stf-crc_extracted-ocp414 - project-template: name: stf-crc-jobs @@ -167,12 +197,16 @@ jobs: - stf-crc-ocp_412-nightly_bundles: voting: false - - stf-crc-ocp_412-local_build - - stf-crc-ocp_412-local_build-index_deploy - stf-crc-ocp_413-nightly_bundles: voting: false + - stf-crc-ocp_414-nightly_bundles: + voting: false + - stf-crc-ocp_412-local_build - stf-crc-ocp_413-local_build + - stf-crc-ocp_414-local_build + - stf-crc-ocp_412-local_build-index_deploy - stf-crc-ocp_413-local_build-index_deploy + - stf-crc-ocp_414-local_build-index_deploy - project: name: infrawatch/service-telemetry-operator From a1776cb9a1303305b5cb14bc3b5e2388f5d61b80 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Wed, 22 Nov 2023 20:05:24 +0000 Subject: [PATCH 03/12] [zuul] Add a login command to get initial kubeconfig file --- .zuul.yaml | 2 ++ ci/pre-2node.yml | 34 ++++++++++++++++++++++++++++++++++ ci/pre-get_kubeconfig.yml | 16 ++++++++++++++++ 3 files changed, 52 insertions(+) create mode 100644 ci/pre-2node.yml create mode 100644 ci/pre-get_kubeconfig.yml diff --git a/.zuul.yaml b/.zuul.yaml index d8a8da21b..4ef0c6b52 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -36,6 +36,8 @@ override-checkout: main - name: openstack-k8s-operators/openstack-must-gather override-checkout: main + pre-run: + - ci/pre-2node.yml vars: cifmw_deploy_edpm: false podified_validation: true diff --git a/ci/pre-2node.yml b/ci/pre-2node.yml new file mode 100644 index 000000000..6f78f99d9 --- /dev/null +++ b/ci/pre-2node.yml @@ -0,0 +1,34 @@ +--- +- name: "Do pre-work to get kubeconfig" + hosts: controller + vars: + ci_framework_dir: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir }}" + environment: + PATH: "~/.crc/bin:~/.crc/bin/oc:~/bin:{{ ansible_env.PATH }}" + tasks: + # this task is temperory, eventually, this whole play will be in a separate file, which will do the common tasks already. + - name: "Set the sto_dir if it isn't already set" + ansible.builtin.set_fact: + sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' + when: sto_dir | default('') | length == 0 + + - name: "Run bootstrap playbook" + ansible.builtin.shell: + cmd: | + ansible-playbook -e@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml {{ ci_framework_dir }}/ci_framework/playbooks/01-bootstrap.yml + chdir: "{{ ci_framework_dir }}" + + - name: "Check for oc" + ansible.builtin.shell: + which oc + ignore_errors: true + + - name: "Copy the login playbook to the controller" + ansible.builtin.copy: + src: "{{ playbook_dir }}/pre-get_kubeconfig.yml" + dest: "{{ ansible_user_dir }}/login.yml" + + - name: "Run the login playbook" + ansible.builtin.shell: + cmd: | + ansible-playbook -e@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml {{ ansible_user_dir }}/login.yml diff --git a/ci/pre-get_kubeconfig.yml b/ci/pre-get_kubeconfig.yml new file mode 100644 index 000000000..5bf7d10a2 --- /dev/null +++ b/ci/pre-get_kubeconfig.yml @@ -0,0 +1,16 @@ +--- +# This file will be copied to the controller, and then run from there using shell: cmd=`ansible-playbook ...` +# This is required because I want to use some role from the ci-framework, and the implementation includes some plugins/actions which aren't installed properly. It's because zuul doesn't support installing from collections, and the actions won't exist on the zuul executer. +- hosts: localhost + gather_facts: true + tasks: + - name: "Log into OpenShift" + ansible.builtin.shell: + cmd: | + oc login -u {{ cifmw_openshift_user }} -p {{ cifmw_openshift_password }} --insecure-skip-tls-verify=true {{ cifmw_openshift_api }} + + - name: "Link the kubeconfig file" + ansible.builtin.shell: + cmd: | + mkdir -p {{ cifmw_openshift_kubeconfig | dirname }} + ln -s {{ ansible_env.HOME }}/.kube/config {{ cifmw_openshift_kubeconfig }} From 164e295ee721a89055a079b5f17a682744c827ae Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Tue, 19 Dec 2023 17:36:05 +0000 Subject: [PATCH 04/12] [stf-run-ci] Add retries to pre-clean --- build/stf-run-ci/tasks/pre-clean.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/stf-run-ci/tasks/pre-clean.yml b/build/stf-run-ci/tasks/pre-clean.yml index 712d188bf..87e649ddd 100644 --- a/build/stf-run-ci/tasks/pre-clean.yml +++ b/build/stf-run-ci/tasks/pre-clean.yml @@ -135,6 +135,8 @@ - openshift-cert-manager-operator - cert-manager-operator - cert-manager + retries: 3 + delay: 10 - name: Remove Elasticsearch ignore_errors: true From 6c49b7f4377b4a7d44d98ffd08abe5b9fc7de5b7 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Tue, 19 Dec 2023 18:51:09 +0000 Subject: [PATCH 05/12] Update galaxy requirements --- ci/prepare.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/prepare.yml b/ci/prepare.yml index 02be5114c..e26b9b8bc 100644 --- a/ci/prepare.yml +++ b/ci/prepare.yml @@ -33,7 +33,7 @@ name: "{{ item }}" with_items: - "kubernetes.core:2.3.2" - - "community.general:6.2.0" + - "community.general" - name: "Log into the cluster" ansible.builtin.import_role: From ce8d214383e50c0ade93a936878e8384cbfa1fa1 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Fri, 22 Dec 2023 10:42:19 +0000 Subject: [PATCH 06/12] [ci] Add retry to login command --- ci/pre-get_kubeconfig.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/pre-get_kubeconfig.yml b/ci/pre-get_kubeconfig.yml index 5bf7d10a2..867628742 100644 --- a/ci/pre-get_kubeconfig.yml +++ b/ci/pre-get_kubeconfig.yml @@ -8,6 +8,8 @@ ansible.builtin.shell: cmd: | oc login -u {{ cifmw_openshift_user }} -p {{ cifmw_openshift_password }} --insecure-skip-tls-verify=true {{ cifmw_openshift_api }} + retries: 10 + delay: 10 - name: "Link the kubeconfig file" ansible.builtin.shell: From 14c28fff52d66031bb7dd8c39a84be0fa02a3280 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Fri, 22 Dec 2023 12:12:37 +0000 Subject: [PATCH 07/12] [ci] Configure kubeconfig for rhol_crc role --- ci/deploy_stf.yml | 2 ++ ci/post-collect_logs.yml | 2 ++ ci/prepare.yml | 2 ++ ci/test_stf.yml | 2 ++ 4 files changed, 8 insertions(+) diff --git a/ci/deploy_stf.yml b/ci/deploy_stf.yml index cd1e4d2ed..9bc2fcbc1 100644 --- a/ci/deploy_stf.yml +++ b/ci/deploy_stf.yml @@ -19,6 +19,8 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml + vars: + cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Deploy STF using stf-run-ci" ansible.builtin.import_role: diff --git a/ci/post-collect_logs.yml b/ci/post-collect_logs.yml index 11b27f109..538852ac6 100644 --- a/ci/post-collect_logs.yml +++ b/ci/post-collect_logs.yml @@ -37,6 +37,8 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml + vars: + cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Gather logs from stf deployment" ansible.builtin.import_role: diff --git a/ci/prepare.yml b/ci/prepare.yml index e26b9b8bc..ed271f3ea 100644 --- a/ci/prepare.yml +++ b/ci/prepare.yml @@ -39,6 +39,8 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml + vars: + cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Create the service-telemetry project" kubernetes.core.k8s: diff --git a/ci/test_stf.yml b/ci/test_stf.yml index 4fcec7c13..0b0c9e7ec 100644 --- a/ci/test_stf.yml +++ b/ci/test_stf.yml @@ -19,6 +19,8 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml + vars: + cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Run STF smoketests" ansible.builtin.shell: From d1212fb1d9bf5e2549f24e2eeaaaec62abd2e4ad Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Fri, 22 Dec 2023 12:59:48 +0000 Subject: [PATCH 08/12] Apply suggestions from code review --- .zuul.yaml | 25 +++++++++++++------------ ci/pre-2node.yml | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 4ef0c6b52..a1bdfaa4b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -23,18 +23,19 @@ - name: crc label: coreos-crc-extracted-2.30.0-xxl +# Based on the 2-node job cookbook at https://github.com/openstack-k8s-operators/ci-framework/blob/main/docs/source/cookbooks/zuul-job-nodeset.md - job: name: stf-base-2node parent: podified-multinode-edpm-deployment-crc abstract: true required-projects: - - name: openstack-k8s-operators/dataplane-operator + - name: github.com/openstack-k8s-operators/dataplane-operator override-checkout: main - - name: openstack-k8s-operators/infra-operator + - name: github.com/openstack-k8s-operators/infra-operator override-checkout: main - name: github.com/openstack-k8s-operators/openstack-operator override-checkout: main - - name: openstack-k8s-operators/openstack-must-gather + - name: github.com/openstack-k8s-operators/openstack-must-gather override-checkout: main pre-run: - ci/pre-2node.yml @@ -132,63 +133,63 @@ name: stf-crc-ocp_412-nightly_bundles parent: stf-crc-nightly_bundles description: | - Deploy STF using the nightly bundles on OCP 4.12.13 + Deploy STF using the nightly bundles on OCP 4.12 nodeset: stf-crc_extracted-ocp412 - job: name: stf-crc-ocp_413-nightly_bundles parent: stf-crc-nightly_bundles description: | - Deploy STF using the nightly bundles on OCP 4.13.14 + Deploy STF using the nightly bundles on OCP 4.13 nodeset: stf-crc_extracted-ocp413 - job: name: stf-crc-ocp_414-nightly_bundles parent: stf-crc-nightly_bundles description: | - Deploy STF using the nightly bundles on OCP 4.14.3 + Deploy STF using the nightly bundles on OCP 4.14 nodeset: stf-crc_extracted-ocp414 - job: name: stf-crc-ocp_412-local_build parent: stf-crc-local_build description: | - Build images locally and deploy STF on OCP 4.12.13 + Build images locally and deploy STF on OCP 4.12 nodeset: stf-crc_extracted-ocp412 - job: name: stf-crc-ocp_413-local_build parent: stf-crc-local_build description: | - Build images locally and deploy STF on OCP 4.13.14 + Build images locally and deploy STF on OCP 4.13 nodeset: stf-crc_extracted-ocp413 - job: name: stf-crc-ocp_414-local_build parent: stf-crc-local_build description: | - Build images locally and deploy STF on OCP 4.14.3 + Build images locally and deploy STF on OCP 4.14 nodeset: stf-crc_extracted-ocp414 - job: name: stf-crc-ocp_412-local_build-index_deploy parent: stf-crc-local_build-index_deploy description: | - Build STF locally and deploy from index on OCP 4.12.13 + Build STF locally and deploy from index on OCP 4.12 nodeset: stf-crc_extracted-ocp412 - job: name: stf-crc-ocp_413-local_build-index_deploy parent: stf-crc-local_build-index_deploy description: | - Build STF locally and deploy from index on OCP 4.13.14 + Build STF locally and deploy from index on OCP 4.13 nodeset: stf-crc_extracted-ocp413 - job: name: stf-crc-ocp_414-local_build-index_deploy parent: stf-crc-local_build-index_deploy description: | - Build STF locally and deploy from index on OCP 4.14.3 + Build STF locally and deploy from index on OCP 4.14 nodeset: stf-crc_extracted-ocp414 - project-template: diff --git a/ci/pre-2node.yml b/ci/pre-2node.yml index 6f78f99d9..72e8dcf46 100644 --- a/ci/pre-2node.yml +++ b/ci/pre-2node.yml @@ -15,7 +15,7 @@ - name: "Run bootstrap playbook" ansible.builtin.shell: cmd: | - ansible-playbook -e@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml {{ ci_framework_dir }}/ci_framework/playbooks/01-bootstrap.yml + ansible-playbook -e@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml {{ ci_framework_dir }}/playbooks/01-bootstrap.yml chdir: "{{ ci_framework_dir }}" - name: "Check for oc" From 1506080a6de323848bf87fb5dd345ef02ec02c8d Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Mon, 8 Jan 2024 17:16:15 +0000 Subject: [PATCH 09/12] Zuul: Update how we get the initial kubeconfig (#558) * use ci-framework infra playbook * add make targets to do set-up * link the kubeconfig files * Remove pre-get_kubeconfig.yml; the script is no longer used --- build/stf-run-ci/tasks/create_builds.yml | 2 -- ci/pre-2node.yml | 33 +++++++++++++++++------- ci/pre-get_kubeconfig.yml | 18 ------------- 3 files changed, 24 insertions(+), 29 deletions(-) delete mode 100644 ci/pre-get_kubeconfig.yml diff --git a/build/stf-run-ci/tasks/create_builds.yml b/build/stf-run-ci/tasks/create_builds.yml index e54b77cb9..8d287b121 100644 --- a/build/stf-run-ci/tasks/create_builds.yml +++ b/build/stf-run-ci/tasks/create_builds.yml @@ -23,7 +23,6 @@ - name: Kill first build since it will always fail (triggered on BuildConfig creation) ansible.builtin.shell: sleep 10 ; oc delete build {{ artifact.name }}-1 -n "{{ namespace }}" - ignore_errors: true retries: 3 delay: 10 register: kill_build @@ -34,7 +33,6 @@ ansible.builtin.command: oc start-build {{ artifact.name }} -n "{{ namespace }}" --follow --wait --from-dir "{{ artifact.working_build_dir }}" register: build_results when: build_lookup.resources | length == 0 - ignore_errors: true retries: 3 delay: 10 until: build_results.rc == 0 diff --git a/ci/pre-2node.yml b/ci/pre-2node.yml index 72e8dcf46..e4b0f2cf5 100644 --- a/ci/pre-2node.yml +++ b/ci/pre-2node.yml @@ -18,17 +18,32 @@ ansible-playbook -e@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml {{ ci_framework_dir }}/playbooks/01-bootstrap.yml chdir: "{{ ci_framework_dir }}" - - name: "Check for oc" + - name: Run ci_framework infra playbook ansible.builtin.shell: - which oc - ignore_errors: true + cmd: | + ansible-playbook -e cifmw_use_opn=false -e cifmw_use_devscripts=false -e cifmw_basedir={{ ansible_user_dir }}/ci-framework-data/ -e cifmw_openshift_setup_skip_internal_registry_tls_verify=true playbooks/02-infra.yml + chdir: "{{ ci_framework_dir }}" + + - name: Run make targets for setup + community.general.make: + chdir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/openstack-k8s-operators/ci-framework"].src_dir }}' + target: "{{ item }}" + with_items: + - setup_tests + - setup_molecule + + - name: Check for the kubeconfig file + ansible.builtin.shell: + cmd: | + ls {{ cifmw_openshift_kubeconfig }} - - name: "Copy the login playbook to the controller" - ansible.builtin.copy: - src: "{{ playbook_dir }}/pre-get_kubeconfig.yml" - dest: "{{ ansible_user_dir }}/login.yml" + - name: Symlink the kubeconfig files + ansible.builtin.shell: + cmd: | + mkdir -p {{ ansible_env.HOME }}/.kube/ + ln -s {{ cifmw_openshift_kubeconfig }} {{ ansible_env.HOME }}/.kube/config - - name: "Run the login playbook" + - name: Check for the kubeconfig file ansible.builtin.shell: cmd: | - ansible-playbook -e@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml {{ ansible_user_dir }}/login.yml + ls -l {{ ansible_env.HOME }}/.kube/config diff --git a/ci/pre-get_kubeconfig.yml b/ci/pre-get_kubeconfig.yml deleted file mode 100644 index 867628742..000000000 --- a/ci/pre-get_kubeconfig.yml +++ /dev/null @@ -1,18 +0,0 @@ ---- -# This file will be copied to the controller, and then run from there using shell: cmd=`ansible-playbook ...` -# This is required because I want to use some role from the ci-framework, and the implementation includes some plugins/actions which aren't installed properly. It's because zuul doesn't support installing from collections, and the actions won't exist on the zuul executer. -- hosts: localhost - gather_facts: true - tasks: - - name: "Log into OpenShift" - ansible.builtin.shell: - cmd: | - oc login -u {{ cifmw_openshift_user }} -p {{ cifmw_openshift_password }} --insecure-skip-tls-verify=true {{ cifmw_openshift_api }} - retries: 10 - delay: 10 - - - name: "Link the kubeconfig file" - ansible.builtin.shell: - cmd: | - mkdir -p {{ cifmw_openshift_kubeconfig | dirname }} - ln -s {{ ansible_env.HOME }}/.kube/config {{ cifmw_openshift_kubeconfig }} From 7b973c727e2b51d2203b29a61345476963ee93c2 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Mon, 8 Jan 2024 17:17:29 +0000 Subject: [PATCH 10/12] [ci] Add common-tasks.yml to cover the tasks that setup every play (#556) --- ci/common-tasks.yml | 13 +++++++++++++ ci/deploy_stf.yml | 14 ++------------ ci/post-collect_logs.yml | 14 ++------------ ci/prepare.yml | 14 ++------------ ci/test_stf.yml | 14 ++------------ 5 files changed, 21 insertions(+), 48 deletions(-) create mode 100644 ci/common-tasks.yml diff --git a/ci/common-tasks.yml b/ci/common-tasks.yml new file mode 100644 index 000000000..40ff4ad1e --- /dev/null +++ b/ci/common-tasks.yml @@ -0,0 +1,13 @@ +--- +- name: "Set the sto_dir if it isn't already set" + ansible.builtin.set_fact: + sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' + when: sto_dir | default('') | length == 0 + +- name: "Get vars common to all jobs" + ansible.builtin.include_vars: + file: "vars-zuul-common.yml" + +- name: "Get scenario-specific vars" + ansible.builtin.include_vars: + file: "vars-{{ scenario }}.yml" diff --git a/ci/deploy_stf.yml b/ci/deploy_stf.yml index 9bc2fcbc1..b5204c2ac 100644 --- a/ci/deploy_stf.yml +++ b/ci/deploy_stf.yml @@ -2,18 +2,8 @@ - name: "Deploy STF" hosts: controller tasks: - - name: "Set the sto_dir if it isn't already set" - ansible.builtin.set_fact: - sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' - when: sto_dir | default('') | length == 0 - - - name: "Get vars common to all jobs" - ansible.builtin.include_vars: - file: "vars-zuul-common.yml" - - - name: "Get scenario-specific vars" - ansible.builtin.include_vars: - file: "vars-{{ scenario }}.yml" + - name: "Setup play vars" + ansible.builtin.include_tasks: "common-tasks.yml" - name: "Log into the cluster" ansible.builtin.import_role: diff --git a/ci/post-collect_logs.yml b/ci/post-collect_logs.yml index 538852ac6..b7d612349 100644 --- a/ci/post-collect_logs.yml +++ b/ci/post-collect_logs.yml @@ -14,18 +14,8 @@ name: Collect logs on the controller gather_facts: false tasks: - - name: "Set the sto_dir if it isn't already set" - ansible.builtin.set_fact: - sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' - when: sto_dir | default('') | length == 0 - - - name: "Get vars common to all jobs" - ansible.builtin.include_vars: - file: "vars-zuul-common.yml" - - - name: "Get scenario-specific vars" - ansible.builtin.include_vars: - file: "vars-{{ scenario }}.yml" + - name: "Setup play vars" + ansible.builtin.include_tasks: "common-tasks.yml" - name: "Create log dir" ansible.builtin.file: diff --git a/ci/prepare.yml b/ci/prepare.yml index ed271f3ea..4d2b69764 100644 --- a/ci/prepare.yml +++ b/ci/prepare.yml @@ -2,18 +2,8 @@ - name: "Prepare the environment for running stf" hosts: controller tasks: - - name: "Set the sto_dir if it isn't already set" - ansible.builtin.set_fact: - sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' - when: sto_dir | default('') | length == 0 - - - name: "Get vars common to all jobs" - ansible.builtin.include_vars: - file: "vars-zuul-common.yml" - - - name: "Get scenario-specific vars" - ansible.builtin.include_vars: - file: "vars-{{ scenario }}.yml" + - name: "Setup play vars" + ansible.builtin.include_tasks: "common-tasks.yml" - name: "Update pip" ansible.builtin.pip: diff --git a/ci/test_stf.yml b/ci/test_stf.yml index 0b0c9e7ec..4afca7a14 100644 --- a/ci/test_stf.yml +++ b/ci/test_stf.yml @@ -2,18 +2,8 @@ - name: "Run tests to verify that STF runs as expected" hosts: controller tasks: - - name: "Set the sto_dir if it isn't already set" - ansible.builtin.set_fact: - sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' - when: sto_dir | default('') | length == 0 - - - name: "Get vars common to all jobs" - ansible.builtin.include_vars: - file: "vars-zuul-common.yml" - - - name: "Get scenario-specific vars" - ansible.builtin.include_vars: - file: "vars-{{ scenario }}.yml" + - name: "Setup play vars" + ansible.builtin.include_tasks: "common-tasks.yml" - name: "Log into the cluster" ansible.builtin.import_role: From 9944614cdcad9a79b805e87b9e3e245a801d7225 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Tue, 9 Jan 2024 17:49:39 +0000 Subject: [PATCH 11/12] [zuul] Update the labels used for extracted CRC --- .zuul.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index a1bdfaa4b..732fa94fc 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -5,7 +5,7 @@ - name: controller label: cloud-centos-9-stream-tripleo-vexxhost - name: crc - label: coreos-crc-extracted-2.19.0-xxl + label: coreos-crc-extracted-2-19-0-xxl - nodeset: name: stf-crc_extracted-ocp413 @@ -13,7 +13,7 @@ - name: controller label: cloud-centos-9-stream-tripleo-vexxhost - name: crc - label: coreos-crc-extracted-2.28.0-xxl + label: coreos-crc-extracted-2-28-0-xxl - nodeset: name: stf-crc_extracted-ocp414 @@ -21,7 +21,7 @@ - name: controller label: cloud-centos-9-stream-tripleo-vexxhost - name: crc - label: coreos-crc-extracted-2.30.0-xxl + label: coreos-crc-extracted-2-30-0-xxl # Based on the 2-node job cookbook at https://github.com/openstack-k8s-operators/ci-framework/blob/main/docs/source/cookbooks/zuul-job-nodeset.md - job: From 430a07846cb5fe3d73f27969ac51d066a05c4c34 Mon Sep 17 00:00:00 2001 From: Emma Foley Date: Wed, 10 Jan 2024 18:53:49 +0000 Subject: [PATCH 12/12] Remove non-default cifmw_rhol_crc_kubeconfig value --- ci/deploy_stf.yml | 2 -- ci/post-collect_logs.yml | 2 -- ci/pre-2node.yml | 16 ---------------- ci/prepare.yml | 2 -- ci/test_stf.yml | 2 -- 5 files changed, 24 deletions(-) diff --git a/ci/deploy_stf.yml b/ci/deploy_stf.yml index b5204c2ac..b90683f6a 100644 --- a/ci/deploy_stf.yml +++ b/ci/deploy_stf.yml @@ -9,8 +9,6 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml - vars: - cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Deploy STF using stf-run-ci" ansible.builtin.import_role: diff --git a/ci/post-collect_logs.yml b/ci/post-collect_logs.yml index b7d612349..c37b512df 100644 --- a/ci/post-collect_logs.yml +++ b/ci/post-collect_logs.yml @@ -27,8 +27,6 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml - vars: - cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Gather logs from stf deployment" ansible.builtin.import_role: diff --git a/ci/pre-2node.yml b/ci/pre-2node.yml index e4b0f2cf5..1d44b5f40 100644 --- a/ci/pre-2node.yml +++ b/ci/pre-2node.yml @@ -6,7 +6,6 @@ environment: PATH: "~/.crc/bin:~/.crc/bin/oc:~/bin:{{ ansible_env.PATH }}" tasks: - # this task is temperory, eventually, this whole play will be in a separate file, which will do the common tasks already. - name: "Set the sto_dir if it isn't already set" ansible.builtin.set_fact: sto_dir: '{{ ansible_env.HOME }}/{{ zuul.projects["github.com/infrawatch/service-telemetry-operator"].src_dir }}' @@ -32,18 +31,3 @@ - setup_tests - setup_molecule - - name: Check for the kubeconfig file - ansible.builtin.shell: - cmd: | - ls {{ cifmw_openshift_kubeconfig }} - - - name: Symlink the kubeconfig files - ansible.builtin.shell: - cmd: | - mkdir -p {{ ansible_env.HOME }}/.kube/ - ln -s {{ cifmw_openshift_kubeconfig }} {{ ansible_env.HOME }}/.kube/config - - - name: Check for the kubeconfig file - ansible.builtin.shell: - cmd: | - ls -l {{ ansible_env.HOME }}/.kube/config diff --git a/ci/prepare.yml b/ci/prepare.yml index 4d2b69764..9557d34b1 100644 --- a/ci/prepare.yml +++ b/ci/prepare.yml @@ -29,8 +29,6 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml - vars: - cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Create the service-telemetry project" kubernetes.core.k8s: diff --git a/ci/test_stf.yml b/ci/test_stf.yml index 4afca7a14..493775a3f 100644 --- a/ci/test_stf.yml +++ b/ci/test_stf.yml @@ -9,8 +9,6 @@ ansible.builtin.import_role: name: rhol_crc tasks_from: add_crc_creds.yml - vars: - cifmw_rhol_crc_kubeconfig: "{{ ansible_env.HOME }}/.kube/config" - name: "Run STF smoketests" ansible.builtin.shell: