diff --git a/.zuul.yaml b/.zuul.yaml index a9e3193f2..d53ed32e9 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,32 +1,7 @@ --- -- job: - name: nova-operator-base - description: | - This is the base job for all nova-operator tests that will deploy - openstack. the base job does not deploy openstack but it does use - the nova-operator-content-provider job to provide a registry with - built operators and installs them on a crc environment. Child jobs - should take this deployed crc and use the installed operators to - deploy openstack and then test it. This job will fetch the job - output directory so child jobs can just add additional logs to that - in there post-playbooks. - parent: cifmw-podified-multinode-edpm-base-crc - abstract: true - attempts: 1 - dependencies: ["openstack-meta-content-provider"] - required-projects: - - github.com/openstack-k8s-operators/ci-framework - - github.com/openstack-k8s-operators/install_yamls - roles: - - zuul: github.com/openstack-k8s-operators/ci-framework - pre-run: - - ci/nova-operator-base/playbooks/pre-wrapper.yaml - post-run: - - ci/nova-operator-base/playbooks/collect-logs.yaml - - job: name: nova-operator-kuttl - parent: nova-operator-base + parent: cifmw-multinode-kuttl-operator-target dependencies: ["openstack-meta-content-provider"] roles: - zuul: github.com/openstack-k8s-operators/ci-framework @@ -34,14 +9,12 @@ This job deploy a basic "Compute Starter Kit" topology https://www.openstack.org/software/sample-configs#compute-starter-kit that is the minium set of openstack services required to boot a vm. - pre-run: - - ci/nova-operator-kuttl/playbooks/deploy-deps.yaml - run: - - ci/nova-operator-kuttl/playbooks/run-kuttl.yaml - nodeset: centos-9-medium-crc-extracted-2-39-0-3xl vars: collection_namespace_override: "nova-kuttl-default" + operator_name: nova-operator zuul_log_collection: true + post-run: + - ci/nova-operator-base/playbooks/collect-logs.yaml extra-vars: crc_ci_bootstrap_networking: networks: diff --git a/ci/nova-operator-base/ansible.cfg b/ci/nova-operator-base/ansible.cfg deleted file mode 100644 index 765ca2213..000000000 --- a/ci/nova-operator-base/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -roles_path = /usr/share/ansible/roles:/etc/ansible/roles:../../../ci-framework/roles diff --git a/ci/nova-operator-base/ci_fw_vars.yaml b/ci/nova-operator-base/ci_fw_vars.yaml deleted file mode 100644 index eda16763d..000000000 --- a/ci/nova-operator-base/ci_fw_vars.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -ansible_user_dir: "{{ lookup('env', 'HOME') }}" -cifmw_installyamls_repos: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/install_yamls" -cifmw_install_yamls_vars: - STORAGE_CLASS: crc-csi-hostpath-provisioner - BMO_SETUP: false - -cifmw_openshift_user: "kubeadmin" -cifmw_openshift_password: "123456789" -cifmw_openshift_kubeconfig: "{{ ansible_user_dir }}/.crc/machines/crc/kubeconfig" - -cifmw_openshift_setup_skip_internal_registry: true - -# edpm_prepare role vars -cifmw_operator_build_meta_name: "openstack-operator" -cifmw_edpm_prepare_skip_crc_storage_creation: true - -cifmw_rhol_crc_use_installyamls: true diff --git a/ci/nova-operator-base/inventory.ini b/ci/nova-operator-base/inventory.ini deleted file mode 100644 index cb7a1e19f..000000000 --- a/ci/nova-operator-base/inventory.ini +++ /dev/null @@ -1,9 +0,0 @@ -[openshift] -controller ansible_connection=local - -[openshift:vars] -local_install_yamls_basedir="~/repos/install_yamls" -collection_namespace_override="nova-kuttl-default" - -[all:vars] -ansible_user_dir="~/" diff --git a/ci/nova-operator-base/playbooks/pre-wrapper.yaml b/ci/nova-operator-base/playbooks/pre-wrapper.yaml deleted file mode 100644 index f764d4a1b..000000000 --- a/ci/nova-operator-base/playbooks/pre-wrapper.yaml +++ /dev/null @@ -1,33 +0,0 @@ -- name: "Run ci/nova-operator-base/playbooks/pre.yml" - hosts: controller - gather_facts: true - vars: - nova_operator_basedir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/nova-operator" - ansible_playbook_command: "ansible-playbook -vv" - ansible_playbook_command_suffix: >- - -e @scenarios/centos-9/base.yml - -e @{{nova_operator_basedir}}/ci/nova-operator-base/ci_fw_vars.yaml - {%- if cifmw_extras is defined %} - {%- for extra_vars in cifmw_extras %} - -e "{{ extra_vars }}" - {%- endfor %} - {%- endif %} - -e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/parameters/zuul-params.yml" - ci_framework_playbooks_path: "{{[ ansible_user_dir, - zuul.projects['github.com/openstack-k8s-operators/ci-framework'].src_dir, - 'playbooks'] | ansible.builtin.path_join }}" - pre_playbook: "{{nova_operator_basedir}}/ci/nova-operator-base/playbooks/pre.yaml" - controller_logs_dir: "{{ ansible_user_dir }}/zuul-output/logs/controller" - tasks: - - name: Create log dir - ansible.builtin.file: - path: "{{ controller_logs_dir }}" - state: directory - mode: "0755" - - name: Run pre playbook - ansible.builtin.shell: - executable: /bin/bash - chdir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework" - cmd: >- - {{ansible_playbook_command}} {{ansible_playbook_command_suffix}} {{pre_playbook}} - 2>&1 | tee {{ controller_logs_dir }}/nova-operator-base_pre.log diff --git a/ci/nova-operator-base/playbooks/pre.yaml b/ci/nova-operator-base/playbooks/pre.yaml deleted file mode 100644 index fff98a37c..000000000 --- a/ci/nova-operator-base/playbooks/pre.yaml +++ /dev/null @@ -1,128 +0,0 @@ ---- -- name: Run ci_framework bootstrap playbook - ansible.builtin.import_playbook: >- - {{[ ansible_user_dir, - zuul.projects["github.com/openstack-k8s-operators/ci-framework"].src_dir, - "playbooks/01-bootstrap.yml"] | ansible.builtin.path_join}} - -- hosts: "{{ cifmw_target_host | default('localhost') }}" - name: install dev tools - tasks: - - name: Download install_yamls deps - ansible.builtin.include_role: - name: 'install_yamls_makes' - tasks_from: 'make_download_tools' - -- name: Run ci_framework infra playbook - ansible.builtin.import_playbook: >- - {{[ ansible_user_dir, - zuul.projects["github.com/openstack-k8s-operators/ci-framework"].src_dir, - "playbooks/02-infra.yml"] | ansible.builtin.path_join}} - -- name: Build dataset hook - hosts: localhost - gather_facts: false - connection: local - tasks: - - name: Load parameters - ansible.builtin.include_vars: - dir: "{{ item }}" - loop: - - "{{ cifmw_basedir }}/artifacts/parameters" - - "/etc/ci/env" - loop_control: - label: "{{ item }}" - - - name: Check we have some compute in inventory - ansible.builtin.set_fact: - has_compute: >- - {% set ns = namespace(found=false) -%} - {% for host in hostvars.keys() -%} - {% if host is match('^compute.*') -%} - {% set ns.found = true -%} - {% endif -%} - {% endfor -%} - {{ ns.found }} - - - name: Ensure that the isolated net was configured for crc - ansible.builtin.assert: - that: - - crc_ci_bootstrap_networks_out is defined - - "'crc' in crc_ci_bootstrap_networks_out" - - "'default' in crc_ci_bootstrap_networks_out['crc']" - - - name: Ensure we have needed bits for compute when needed - when: - - has_compute | bool - ansible.builtin.assert: - that: - - "'compute' in crc_ci_bootstrap_networks_out" - - "'default' in crc_ci_bootstrap_networks_out['compute']" - - - name: Set facts for further usage within the framework - ansible.builtin.set_fact: - cifmw_edpm_prepare_extra_vars: - NNCP_INTERFACE: "{{ crc_ci_bootstrap_networks_out.crc.default.iface }}" - NETWORK_MTU: "{{ crc_ci_bootstrap_networks_out.crc.default.mtu }}" - -- hosts: "{{ cifmw_target_host | default('localhost') }}" - name: Deploy Openstack Operators - tasks: - - name: Set install_yamls Makefile environment variables - vars: - operators_build_output: "{{ (cifmw_operator_build_output | default({'operators':{}})).operators }}" - ansible.builtin.set_fact: - cifmw_edpm_prepare_common_env: >- - {{ - cifmw_install_yamls_environment | - combine({'PATH': cifmw_path}) | - combine(cifmw_edpm_prepare_extra_vars | default({})) - }} - cifmw_edpm_prepare_make_openstack_env: | - OPENSTACK_IMG: "{{ cifmw_operator_build_output.operators['openstack-operator']['image_catalog'] | default(omit) }}" - OPENSTACK_BUNDLE_IMG: "{{ cifmw_operator_build_output.operators['openstack-operator']['image_bundle'] | default(omit) }}" - NOVA_IMG: "{{ cifmw_operator_build_output.operators['nova-operator']['image_catalog'] | default(omit) }}" - cifmw_edpm_prepare_operators_build_output: "{{ operators_build_output }}" - - name: Deploy openstack Operators - block: - - name: detect if openstack operator is installed - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: "oc get sub --ignore-not-found=true -n openstack-operators -o name openstack-operator" - ignore_errors: true - register: openstack_operator_subscription - - name: Install openstack operator - when: openstack_operator_subscription.stdout == "" - vars: - make_openstack_env: "{{ cifmw_edpm_prepare_common_env | - combine(cifmw_edpm_prepare_make_openstack_env | from_yaml)}}" - make_openstack_dryrun: "{{ cifmw_edpm_prepare_dry_run }}" - ansible.builtin.include_role: - name: 'install_yamls_makes' - tasks_from: 'make_openstack' - - name: Wait for OpenStack subscription creation - when: openstack_operator_subscription.stdout == "" - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: >- - oc get sub openstack-operator - --namespace=openstack-operators - -o=jsonpath='{.status.installplan.name}' - register: cifmw_edpm_prepare_wait_installplan_out - until: cifmw_edpm_prepare_wait_installplan_out.rc == 0 and cifmw_edpm_prepare_wait_installplan_out.stdout != "" - retries: 30 - delay: 10 - - name: Wait for OpenStack operator to get installed - when: openstack_operator_subscription.stdout == "" - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: >- - oc wait InstallPlan {{ cifmw_edpm_prepare_wait_installplan_out.stdout }} - --namespace=openstack-operators - --for=jsonpath='{.status.phase}'=Complete --timeout=20m diff --git a/ci/nova-operator-kuttl/ansible.cfg b/ci/nova-operator-kuttl/ansible.cfg deleted file mode 100644 index 765ca2213..000000000 --- a/ci/nova-operator-kuttl/ansible.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[defaults] -roles_path = /usr/share/ansible/roles:/etc/ansible/roles:../../../ci-framework/roles diff --git a/ci/nova-operator-kuttl/inventory.ini b/ci/nova-operator-kuttl/inventory.ini deleted file mode 100644 index 390656c8f..000000000 --- a/ci/nova-operator-kuttl/inventory.ini +++ /dev/null @@ -1,9 +0,0 @@ -[openshift] -controller ansible_connection=local - -[openshift:vars] -local_nova_operator_basedir= "~/repos/nova-operator" -local_log_dir= "/tmp/nova-operator-kuttl/logs" - -[all:vars] -ansible_user_dir="~/" diff --git a/ci/nova-operator-kuttl/playbooks/deploy-deps.yaml b/ci/nova-operator-kuttl/playbooks/deploy-deps.yaml deleted file mode 100644 index b64661026..000000000 --- a/ci/nova-operator-kuttl/playbooks/deploy-deps.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -- hosts: controller - vars: - nova_operator_basedir: "{{local_nova_operator_basedir | default(ansible_user_dir + '/src/github.com/openstack-k8s-operators/nova-operator')}}" - tasks: - - name: install kuttl test_suite dependencies - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: make kuttl-test-prep - chdir: "{{nova_operator_basedir}}" - register: result - until: result.rc == 0 - retries: 3 - delay: 10 - changed_when: true diff --git a/ci/nova-operator-kuttl/playbooks/run-kuttl.yaml b/ci/nova-operator-kuttl/playbooks/run-kuttl.yaml deleted file mode 100644 index 09208bb17..000000000 --- a/ci/nova-operator-kuttl/playbooks/run-kuttl.yaml +++ /dev/null @@ -1,25 +0,0 @@ -- hosts: controller - vars: - nova_operator_basedir: "{{local_nova_operator_basedir | default(ansible_user_dir + '/src/github.com/openstack-k8s-operators/nova-operator')}}" - kuttl_log_dir: "{{local_log_dir | default(ansible_user_dir + '/zuul-output/logs/controller')}}" - tasks: - - name: install kuttl test_suite dependencies - environment: - KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}" - PATH: "{{ cifmw_path | default(ansible_env.PATH) }}" - ansible.builtin.command: - cmd: make kuttl-test-run - chdir: "{{nova_operator_basedir}}" - changed_when: true - register: kuttl_test_run - - name: Create log dir - ansible.builtin.file: - path: "{{kuttl_log_dir}}" - state: directory - mode: "0755" - recurse: yes - - name: save output to file - ansible.builtin.copy: - content: "{{kuttl_test_run.stdout}}" - dest: "{{kuttl_log_dir}}/kuttl-test-run.out" - when: kuttl_test_run.stdout is defined