From 3595108e498a389f795527d90e41952782d34083 Mon Sep 17 00:00:00 2001 From: Alexander Chadin Date: Thu, 5 Oct 2017 16:36:27 +0300 Subject: [PATCH] Migrate to Zuul v3 This patch does step 1 in the docs: Move Legacy Jobs to Projects. Partial-Implements: blueprint migrate-to-zuulv3 Change-Id: I0c0713260c2dfa2ba64a5746c342db01c1bc3d75 --- .zuul.yaml | 39 +++++++++ .../watcher-tempest-base-multinode/post.yaml | 15 ++++ .../watcher-tempest-base-multinode/run.yaml | 67 ++++++++++++++++ .../post.yaml | 80 +++++++++++++++++++ .../watcherclient-tempest-functional/run.yaml | 64 +++++++++++++++ 5 files changed, 265 insertions(+) create mode 100644 .zuul.yaml create mode 100644 playbooks/legacy/watcher-tempest-base-multinode/post.yaml create mode 100644 playbooks/legacy/watcher-tempest-base-multinode/run.yaml create mode 100644 playbooks/legacy/watcherclient-tempest-functional/post.yaml create mode 100644 playbooks/legacy/watcherclient-tempest-functional/run.yaml diff --git a/.zuul.yaml b/.zuul.yaml new file mode 100644 index 000000000..21fa6a826 --- /dev/null +++ b/.zuul.yaml @@ -0,0 +1,39 @@ +- project: + name: openstack/watcher + check: + jobs: + - watcher-tempest-multinode + - legacy-rally-dsvm-watcher-rally + +- 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 + required-projects: + - 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 + +- 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 + timeout: 4200 + required-projects: + - openstack-dev/devstack + - openstack-infra/devstack-gate + - openstack/python-openstackclient + - openstack/python-watcherclient + - openstack/watcher diff --git a/playbooks/legacy/watcher-tempest-base-multinode/post.yaml b/playbooks/legacy/watcher-tempest-base-multinode/post.yaml new file mode 100644 index 000000000..e07f5510a --- /dev/null +++ b/playbooks/legacy/watcher-tempest-base-multinode/post.yaml @@ -0,0 +1,15 @@ +- hosts: primary + tasks: + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=/logs/** + - --include=*/ + - --exclude=* + - --prune-empty-dirs diff --git a/playbooks/legacy/watcher-tempest-base-multinode/run.yaml b/playbooks/legacy/watcher-tempest-base-multinode/run.yaml new file mode 100644 index 000000000..ee55e356d --- /dev/null +++ b/playbooks/legacy/watcher-tempest-base-multinode/run.yaml @@ -0,0 +1,67 @@ +- hosts: primary + name: Legacy Watcher tempest base multinode + tasks: + + - name: Ensure legacy workspace directory + file: + path: '{{ ansible_user_dir }}/workspace' + state: directory + + - shell: + cmd: | + set -e + set -x + cat > clonemap.yaml << EOF + clonemap: + - name: openstack-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + cat << 'EOF' >>"/tmp/dg-local.conf" + [[local|localrc]] + TEMPEST_PLUGINS='/opt/stack/new/watcher-tempest-plugin' + enable_plugin ceilometer git://git.openstack.org/openstack/ceilometer + # Enable watcher devstack plugin. + enable_plugin watcher git://git.openstack.org/openstack/watcher + + EOF + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + + export DEVSTACK_SUBNODE_CONFIG=" " + export PYTHONUNBUFFERED=true + export DEVSTACK_GATE_TEMPEST=1 + export DEVSTACK_GATE_NEUTRON=1 + export DEVSTACK_GATE_TOPOLOGY="multinode" + export PROJECTS="openstack/watcher $PROJECTS" + export PROJECTS="openstack/python-watcherclient $PROJECTS" + export PROJECTS="openstack/watcher-tempest-plugin $PROJECTS" + + export DEVSTACK_GATE_TEMPEST_REGEX="watcher_tempest_plugin" + + export BRANCH_OVERRIDE=default + if [ "$BRANCH_OVERRIDE" != "default" ] ; then + export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE + fi + + cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh + ./safe-devstack-vm-gate-wrap.sh + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' diff --git a/playbooks/legacy/watcherclient-tempest-functional/post.yaml b/playbooks/legacy/watcherclient-tempest-functional/post.yaml new file mode 100644 index 000000000..dac875340 --- /dev/null +++ b/playbooks/legacy/watcherclient-tempest-functional/post.yaml @@ -0,0 +1,80 @@ +- hosts: primary + tasks: + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=**/*nose_results.html + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=**/*testr_results.html.gz + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=/.testrepository/tmp* + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=**/*testrepository.subunit.gz + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}/tox' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=/.tox/*/log/* + - --include=*/ + - --exclude=* + - --prune-empty-dirs + + - name: Copy files from {{ ansible_user_dir }}/workspace/ on node + synchronize: + src: '{{ ansible_user_dir }}/workspace/' + dest: '{{ zuul.executor.log_root }}' + mode: pull + copy_links: true + verify_host: true + rsync_opts: + - --include=/logs/** + - --include=*/ + - --exclude=* + - --prune-empty-dirs diff --git a/playbooks/legacy/watcherclient-tempest-functional/run.yaml b/playbooks/legacy/watcherclient-tempest-functional/run.yaml new file mode 100644 index 000000000..783292481 --- /dev/null +++ b/playbooks/legacy/watcherclient-tempest-functional/run.yaml @@ -0,0 +1,64 @@ +- hosts: all + name: Legacy watcherclient-dsvm-functional + tasks: + + - name: Ensure legacy workspace directory + file: + path: '{{ ansible_user_dir }}/workspace' + state: directory + + - shell: + cmd: | + set -e + set -x + cat > clonemap.yaml << EOF + clonemap: + - name: openstack-infra/devstack-gate + dest: devstack-gate + EOF + /usr/zuul-env/bin/zuul-cloner -m clonemap.yaml --cache-dir /opt/git \ + git://git.openstack.org \ + openstack-infra/devstack-gate + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + cat << 'EOF' >>"/tmp/dg-local.conf" + [[local|localrc]] + enable_plugin watcher git://git.openstack.org/openstack/watcher + + EOF + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}' + + - shell: + cmd: | + set -e + set -x + ENABLED_SERVICES=tempest + ENABLED_SERVICES+=,watcher-api,watcher-decision-engine,watcher-applier + export ENABLED_SERVICES + + export PYTHONUNBUFFERED=true + export BRANCH_OVERRIDE=default + export PROJECTS="openstack/watcher $PROJECTS" + export DEVSTACK_PROJECT_FROM_GIT=python-watcherclient + if [ "$BRANCH_OVERRIDE" != "default" ] ; then + export OVERRIDE_ZUUL_BRANCH=$BRANCH_OVERRIDE + fi + function post_test_hook { + # Configure and run functional tests + $BASE/new/python-watcherclient/watcherclient/tests/functional/hooks/post_test_hook.sh + } + export -f post_test_hook + + cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh + ./safe-devstack-vm-gate-wrap.sh + executable: /bin/bash + chdir: '{{ ansible_user_dir }}/workspace' + environment: '{{ zuul | zuul_legacy_vars }}'