From 6bb0432ee7d5337517a14f563e9afe6321925304 Mon Sep 17 00:00:00 2001 From: Alexander Chadin Date: Sun, 11 Mar 2018 20:17:18 +0300 Subject: [PATCH] ZuulV3 jobs This patch set removes legacy-* jobs and migrates tempest functional job to ZuulV3 syntax. Change-Id: I87771737cc713eae20b4d6aaaefefc5e40875666 Implements: blueprint migrate-to-zuulv3 --- .zuul.yaml | 147 ++++++++++++++++--- devstack/lib/watcher | 11 +- playbooks/orchestrate-tempest.yaml | 14 ++ playbooks/pre.yaml | 3 + roles/add-hostnames-to-hosts/tasks/main.yaml | 16 ++ 5 files changed, 170 insertions(+), 21 deletions(-) create mode 100644 playbooks/orchestrate-tempest.yaml create mode 100644 playbooks/pre.yaml create mode 100644 roles/add-hostnames-to-hosts/tasks/main.yaml diff --git a/.zuul.yaml b/.zuul.yaml index 6585f142a..6dd11c2f7 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,39 +1,133 @@ - project: check: jobs: - - watcher-tempest-multinode - - legacy-rally-dsvm-watcher-rally-non-vote + - watcher-tempest-zuulv3 + - watcher-tempest-dummy_optim + - watcher-tempest-actuator + - watcher-tempest-basic_optim + - watcher-tempest-workload_balancing + - watcherclient-tempest-functional + - legacy-rally-dsvm-watcher-rally + gate: + jobs: + - watcher-tempest-zuulv3 + - watcher-tempest-dummy_optim + - watcher-tempest-actuator + - watcher-tempest-basic_optim + - watcher-tempest-workload_balancing + - watcherclient-tempest-functional + - legacy-rally-dsvm-watcher-rally - job: - name: legacy-rally-dsvm-watcher-rally-non-vote - parent: legacy-rally-dsvm-watcher-rally + name: watcher-tempest-dummy_optim voting: false + parent: watcher-tempest-zuulv3 + vars: + tempest_test_regex: 'watcher_tempest_plugin.tests.scenario.test_execute_dummy_optim' - job: - name: watcher-tempest-base-multinode - parent: legacy-dsvm-base-multinode - run: playbooks/legacy/watcher-tempest-base-multinode/run.yaml - post-run: playbooks/legacy/watcher-tempest-base-multinode/post.yaml - timeout: 4200 + name: watcher-tempest-actuator + voting: false + parent: watcher-tempest-zuulv3 + vars: + tempest_test_regex: 'watcher_tempest_plugin.tests.scenario.test_execute_actuator' + +- job: + name: watcher-tempest-basic_optim + voting: false + parent: watcher-tempest-zuulv3 + vars: + tempest_test_regex: 'watcher_tempest_plugin.tests.scenario.test_execute_basic_optim' + +- job: + name: watcher-tempest-workload_balancing + voting: false + parent: watcher-tempest-zuulv3 + vars: + tempest_test_regex: 'watcher_tempest_plugin.tests.scenario.test_execute_workload_balancing' + +- job: + name: watcher-tempest-zuulv3 + parent: devstack-tempest + voting: true + timeout: 7200 + nodeset: openstack-two-node + pre-run: playbooks/pre.yaml + run: playbooks/orchestrate-tempest.yaml + roles: + - zuul: openstack/tempest required-projects: + - openstack/ceilometer - openstack-infra/devstack-gate - openstack/python-openstackclient - openstack/python-watcherclient - openstack/watcher - openstack/watcher-tempest-plugin - nodeset: legacy-ubuntu-xenial-2-node - -- job: - name: watcher-tempest-multinode - parent: watcher-tempest-base-multinode - voting: false + - openstack/tempest + group-vars: + subnode: + devstack_local_conf: + post-config: + $NOVA_CONF: + libvirt: + live_migration_uri: 'qemu+ssh://root@%s/system' + devstack_services: + watcher-api: false + watcher-decision-engine: false + watcher-applier: false + # We need to add TLS support for watcher plugin + tls-proxy: false + ceilometer: false + ceilometer-acompute: false + ceilometer-acentral: false + ceilometer-anotification: false + watcher: false + gnocchi-api: false + gnocchi-metricd: false + rabbit: false + mysql: false + vars: + devstack_local_conf: + post-config: + $NOVA_CONF: + libvirt: + live_migration_uri: 'qemu+ssh://root@%s/system' + test-config: + $TEMPEST_CONFIG: + compute: + min_compute_nodes: 2 + compute-feature-enabled: + live_migration: true + block_migration_for_live_migration: true + devstack_localrc: + WATCHER_USE_MOD_WSGI: False + TEMPEST_PLUGINS: '/opt/stack/watcher-tempest-plugin' + tempest_test_regex: 'watcher_tempest_plugin.tests.api' + devstack_plugins: + ceilometer: https://git.openstack.org/openstack/ceilometer + watcher: https://git.openstack.org/openstack/watcher + devstack_services: + tls-proxy: false + watcher-api: true + watcher-decision-engine: true + watcher-applier: true + tempest: true + s-account: false + s-container: false + s-object: false + s-proxy: false + tox_envlist: all + tox_environment: + # Do we really need to set this? It's cargo culted + PYTHONUNBUFFERED: 'true' + zuul_copy_output: + /etc/hosts: logs - job: # This job is used by python-watcherclient repo name: watcherclient-tempest-functional - parent: legacy-dsvm-base - run: playbooks/legacy/watcherclient-tempest-functional/run.yaml - post-run: playbooks/legacy/watcherclient-tempest-functional/post.yaml + parent: devstack-tempest + voting: false timeout: 4200 required-projects: - openstack-dev/devstack @@ -41,3 +135,20 @@ - openstack/python-openstackclient - openstack/python-watcherclient - openstack/watcher + - openstack/tempest + vars: + devstack_localrc: + WATCHER_USE_MOD_WSGI: False + TEMPEST_PLUGINS: '/opt/stack/python-watcherclient' + tempest_test_regex: 'watcherclient.tests.functional' + devstack_plugins: + watcher: https://git.openstack.org/openstack/watcher + devstack_services: + rabbit: true + mysql: true + tls-proxy: false + watcher-api: true + watcher-decision-engine: true + watcher-applier: true + tempest: true + tox_envlist: all diff --git a/devstack/lib/watcher b/devstack/lib/watcher index 09658e5de..69cbb9785 100644 --- a/devstack/lib/watcher +++ b/devstack/lib/watcher @@ -179,7 +179,13 @@ function create_watcher_conf { iniset $WATCHER_CONF database connection $(database_connection_url watcher) iniset $WATCHER_CONF api host "$WATCHER_SERVICE_HOST" - iniset $WATCHER_CONF api port "$WATCHER_SERVICE_PORT" + + if is_service_enabled tls-proxy; then + iniset $WATCHER_CONF api port "$WATCHER_SERVICE_PORT_INT" + # iniset $WATCHER_CONF api enable_ssl_api "True" + else + iniset $WATCHER_CONF api port "$WATCHER_SERVICE_PORT" + fi iniset $WATCHER_CONF oslo_policy policy_file $WATCHER_POLICY_YAML @@ -297,8 +303,7 @@ function start_watcher_api { # Start proxies if enabled if is_service_enabled tls-proxy; then - start_tls_proxy '*' $WATCHER_SERVICE_PORT $WATCHER_SERVICE_HOST $WATCHER_SERVICE_PORT_INT & - start_tls_proxy '*' $EC2_SERVICE_PORT $WATCHER_SERVICE_HOST $WATCHER_SERVICE_PORT_INT & + start_tls_proxy watcher '*' $WATCHER_SERVICE_PORT $WATCHER_SERVICE_HOST $WATCHER_SERVICE_PORT_INT fi } diff --git a/playbooks/orchestrate-tempest.yaml b/playbooks/orchestrate-tempest.yaml new file mode 100644 index 000000000..5f6d82f73 --- /dev/null +++ b/playbooks/orchestrate-tempest.yaml @@ -0,0 +1,14 @@ +- hosts: all + # This is the default strategy, however since orchestrate-devstack requires + # "linear", it is safer to enforce it in case this is running in an + # environment configured with a different default strategy. + strategy: linear + roles: + - orchestrate-devstack + +- hosts: tempest + roles: + - setup-tempest-run-dir + - setup-tempest-data-dir + - acl-devstack-files + - run-tempest \ No newline at end of file diff --git a/playbooks/pre.yaml b/playbooks/pre.yaml new file mode 100644 index 000000000..6367cd4a0 --- /dev/null +++ b/playbooks/pre.yaml @@ -0,0 +1,3 @@ +- hosts: all + roles: + - add-hostnames-to-hosts \ No newline at end of file diff --git a/roles/add-hostnames-to-hosts/tasks/main.yaml b/roles/add-hostnames-to-hosts/tasks/main.yaml new file mode 100644 index 000000000..5756752b2 --- /dev/null +++ b/roles/add-hostnames-to-hosts/tasks/main.yaml @@ -0,0 +1,16 @@ +- name: Set up the list of hostnames and addresses + set_fact: + hostname_addresses: > + {% set hosts = {} -%} + {% for host, vars in hostvars.items() -%} + {% set _ = hosts.update({vars['ansible_hostname']: vars['nodepool']['private_ipv4']}) -%} + {% endfor -%} + {{- hosts -}} +- name: Add inventory hostnames to the hosts file + become: yes + lineinfile: + dest: /etc/hosts + state: present + insertafter: EOF + line: "{{ item.value }} {{ item.key }}" + with_dict: "{{ hostname_addresses }}" \ No newline at end of file