From 47fee115eb2a4949c467bab3e6116a7c3bf06ec4 Mon Sep 17 00:00:00 2001 From: Doug Szumski Date: Tue, 30 Apr 2019 14:55:57 +0000 Subject: [PATCH] CI: Add monasca scenario Adds the following new Zuul job for testing deployment of Monasca and associated services: * kolla-ansible-centos8-source-monasca All core OpenStack services except for Keystone are disabled to ensure enough memory is available. A follow up patch will replace the basic tests here with Tempest. Co-Authored-By: Doug Szumski Change-Id: I5d33fd3d7b69798ba0aa23509f7b809065f61c19 --- tests/run.yml | 11 +++- tests/setup_gate.sh | 7 +++ tests/templates/globals-default.j2 | 6 +++ tests/templates/inventory.j2 | 22 +++++++- tests/test-monasca.sh | 84 ++++++++++++++++++++++++++++++ zuul.d/base.yaml | 11 ++++ zuul.d/jobs.yaml | 8 +++ zuul.d/nodesets.yaml | 27 ++++++++++ zuul.d/project.yaml | 1 + 9 files changed, 173 insertions(+), 4 deletions(-) create mode 100755 tests/test-monasca.sh diff --git a/tests/run.yml b/tests/run.yml index b2ed4a3aec..c5a4d9bbbc 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -10,7 +10,7 @@ - name: set facts for commonly used variables vars: # NOTE(yoctozepto): needed here to use in other facts too - openstack_core_enabled: "{{ scenario not in ['bifrost', 'mariadb', 'prometheus-efk'] }}" + openstack_core_enabled: "{{ scenario not in ['bifrost', 'mariadb', 'prometheus-efk', 'monasca'] }}" set_fact: kolla_inventory_path: "/etc/kolla/inventory" logs_dir: "/tmp/logs" @@ -22,7 +22,7 @@ build_image_tag: "change_{{ zuul.change | default('none') }}" openstack_core_enabled: "{{ openstack_core_enabled }}" openstack_core_tested: "{{ scenario in ['core', 'ceph-ansible', 'zun', 'cells', 'swift', 'linuxbridge', 'ovn'] }}" - dashboard_enabled: "{{ openstack_core_enabled }}" + dashboard_enabled: "{{ openstack_core_enabled or scenario in ['monasca'] }}" upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt" docker_image_tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}" @@ -427,6 +427,13 @@ chdir: "{{ kolla_ansible_src_dir }}" when: scenario == "magnum" + - name: Run test-monasca.sh script + script: + cmd: test-monasca.sh + executable: /bin/bash + chdir: "{{ kolla_ansible_src_dir }}" + when: scenario == "monasca" + - name: Run test-masakari.sh script script: cmd: test-masakari.sh diff --git a/tests/setup_gate.sh b/tests/setup_gate.sh index a408904c69..5d9ce2ddeb 100755 --- a/tests/setup_gate.sh +++ b/tests/setup_gate.sh @@ -26,6 +26,9 @@ function setup_openstack_clients { if [[ $SCENARIO == scenario_nfv ]]; then packages+=(python-tackerclient python-barbicanclient python-mistralclient) fi + if [[ $SCENARIO == monasca ]]; then + packages+=(python-monascaclient) + fi if [[ "debian" == $BASE_DISTRO ]]; then sudo apt -y install python3-venv fi @@ -85,6 +88,10 @@ function prepare_images { GATE_IMAGES="^cron,^elasticsearch,^fluentd,^grafana,^haproxy,^keepalived,^kibana,^kolla-toolbox,^mariadb,^memcached,^prometheus,^rabbitmq" fi + if [[ $SCENARIO == "monasca" ]]; then + # FIXME(mgoddard): No need for OpenStack core images. + GATE_IMAGES+=",^elasticsearch,^influxdb,^kafka,^kibana,^logstash,^monasca,^storm,^zookeeper" + fi sudo tee -a /etc/kolla/kolla-build.conf < /tmp/logs/ansible/test-monasca 2>&1 + result=$? + if [[ $result != 0 ]]; then + echo "Monasca test failed. See ansible/test-monasca for details" + else + echo "Successfully tested Monasca. See ansible/test-monasca for details" + fi + return $result +} + +test_monasca diff --git a/zuul.d/base.yaml b/zuul.d/base.yaml index e51e37b18c..f702d3476d 100644 --- a/zuul.d/base.yaml +++ b/zuul.d/base.yaml @@ -148,6 +148,17 @@ vars: scenario: masakari +- job: + name: kolla-ansible-monasca-base + parent: kolla-ansible-base + voting: false + files: + - ^ansible/roles/(elasticsearch|influxdb|kafka|kibana|monasca|storm|zookeeper)/ + - ^tests/test-monasca.sh + - ^tests/test-dashboard.sh + vars: + scenario: monasca + - job: name: kolla-ansible-mariadb-base parent: kolla-ansible-base diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index c81273c38f..d92bd13265 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -292,6 +292,14 @@ base_distro: centos install_type: source +- job: + name: kolla-ansible-centos8-source-monasca + parent: kolla-ansible-monasca-base + nodeset: kolla-ansible-centos8-multi-monasca + vars: + base_distro: centos + install_type: source + - job: name: kolla-ansible-centos8-source-cells parent: kolla-ansible-cells-base diff --git a/zuul.d/nodesets.yaml b/zuul.d/nodesets.yaml index e60c5617f1..29434ecfbb 100644 --- a/zuul.d/nodesets.yaml +++ b/zuul.d/nodesets.yaml @@ -70,3 +70,30 @@ nodes: - name: primary label: nested-virt-centos-8 + +- nodeset: + name: kolla-ansible-centos8-multi-monasca + nodes: + - name: primary + label: centos-8 + - name: secondary1 + label: centos-8 + - name: secondary2 + label: centos-8 + - name: secondary3 + label: centos-8 + - name: secondary4 + label: centos-8 + - name: secondary5 + label: centos-8 + groups: + - name: switch + nodes: + - primary + - name: peers + nodes: + - secondary1 + - secondary2 + - secondary3 + - secondary4 + - secondary5 diff --git a/zuul.d/project.yaml b/zuul.d/project.yaml index 92f380afa8..9b90e5561d 100644 --- a/zuul.d/project.yaml +++ b/zuul.d/project.yaml @@ -48,6 +48,7 @@ - kolla-ansible-ubuntu-source-ovn - kolla-ansible-centos8-source-prometheus-efk - kolla-ansible-ubuntu-source-prometheus-efk + - kolla-ansible-centos8-source-monasca check-arm64: jobs: - kolla-ansible-debian-source-aarch64