From 725d4c1e54451530a0fc264b447564075fd94cdf Mon Sep 17 00:00:00 2001 From: Kien Nguyen Date: Mon, 16 Oct 2017 15:03:16 +0700 Subject: [PATCH] Add native Zuulv3 jobs Do step 2: Reworking Legacy Jobs to be v3 Native Depends-On: https://review.openstack.org/#/c/545724/ Change-Id: Ic86e9c13d3837728bf596779f940ce405ca15cd2 Implements: blueprint migrate-to-zuulv3 --- .zuul.yaml | 90 +++++++++++-------- .../zun-devstack-base-multinode/post.yaml | 15 ---- .../zun-devstack-base-multinode/run.yaml | 82 ----------------- playbooks/zun-devstack-base/post.yaml | 15 ---- playbooks/zun-devstack-base/run.yaml | 90 ------------------- playbooks/zun-tempest-base/post.yaml | 13 +++ ...zuul-v3-native-gates-a46ef4c168f9362e.yaml | 5 ++ zun/tests/contrib/gate_hook.sh | 50 ----------- zun/tests/contrib/post_test_hook.sh | 23 ----- 9 files changed, 71 insertions(+), 312 deletions(-) delete mode 100644 playbooks/zun-devstack-base-multinode/post.yaml delete mode 100644 playbooks/zun-devstack-base-multinode/run.yaml delete mode 100644 playbooks/zun-devstack-base/post.yaml delete mode 100644 playbooks/zun-devstack-base/run.yaml create mode 100644 playbooks/zun-tempest-base/post.yaml create mode 100644 releasenotes/notes/zuul-v3-native-gates-a46ef4c168f9362e.yaml delete mode 100755 zun/tests/contrib/gate_hook.sh delete mode 100755 zun/tests/contrib/post_test_hook.sh diff --git a/.zuul.yaml b/.zuul.yaml index ba2eb7d8d..00a20a12a 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -1,63 +1,79 @@ - job: - name: zun-devstack-base - parent: legacy-dsvm-base + name: zun-tempest-base + parent: devstack-tempest + description: Zun Devstack tempest base job timeout: 4200 + required-projects: + - openstack-dev/devstack + - openstack/devstack-plugin-container + - openstack/kuryr-libnetwork + - openstack/zun + - openstack/zun-tempest-plugin + - openstack/python-zunclient irrelevant-files: - ^.*\.rst$ - ^doc/.*$ vars: - database: sql - use_python3: 0 - required-projects: - - openstack-dev/devstack - - openstack-infra/devstack-gate - - openstack/devstack-plugin-container - - openstack/kuryr-libnetwork - - openstack/zun - - openstack/python-zunclient - - openstack/zun-tempest-plugin - run: playbooks/zun-devstack-base/run.yaml - post-run: playbooks/zun-devstack-base/post.yaml + tox_envlist: 'all-plugin' + tempest_test_regex: 'zun_tempest_plugin.tests.tempest.api' + devstack_localrc: + ZUN_USE_UWSGI: True + KURYR_CONFIG_DIR: /etc/kuryr-libnetwork + ZUN_DRIVER: docker + ZUN_DB_TYPE: sql + devstack_services: + tempest: True + devstack_plugins: + zun: https://git.openstack.org/openstack/zun + kuryr-libnetwork: https://git.openstack.org/openstack/kuryr-libnetwork + devstack-plugin-container: https://git.openstack.org/openstack/devstack-plugin-container + zun-tempest-plugin: https://git.openstack.org/openstack/zun-tempest-plugin + post-run: playbooks/zun-tempest-base/post.yaml - job: - name: zun-devstack-base-multinode - parent: legacy-dsvm-base-multinode + name: zun-tempest-base-multinode + parent: zun-tempest-base + description: Zun Devstack tempest multinode base job + nodeset: openstack-two-node timeout: 7800 - irrelevant-files: - - ^.*\.rst$ - - ^doc/.*$ - required-projects: - - openstack-dev/devstack - - openstack-infra/devstack-gate - - openstack/devstack-plugin-container - - openstack/kuryr-libnetwork - - openstack/zun - - openstack/python-zunclient - - openstack/zun-tempest-plugin - nodeset: legacy-ubuntu-xenial-2-node - run: playbooks/zun-devstack-base-multinode/run.yaml - post-run: playbooks/zun-devstack-base-multinode/post.yaml - + vars: + devstack_localrc: + KURYR_PROCESS_EXTERNAL_CONNECTIVITY: False + KURYR_CAPABILITY_SCOPE: global + group-vars: + peers: + devstack_localrc: + KURYR_CAPABILITY_SCOPE: global + KURYR_PROCESS_EXTERNAL_CONNECTIVITY: False + KURYR_CONFIG_DIR: /etc/kuryr-libnetwork - job: name: zun-tempest-docker-sql - parent: zun-devstack-base + parent: zun-tempest-base - job: name: zun-tempest-py35-docker-sql - parent: zun-devstack-base + parent: zun-tempest-base vars: - use_python3: 1 + devstack_localrc: + USE_PYTHON3: True + devstack_services: + s-account: false + s-object: false + s-container: false + s-proxy: false - job: name: zun-tempest-multinode-docker-sql - parent: zun-devstack-base-multinode + parent: zun-tempest-base-multinode voting: false - job: name: zun-tempest-docker-etcd - parent: zun-devstack-base + parent: zun-tempest-base vars: - database: etcd + devstack_localrc: + ZUN_DB_TYPE: etcd + KURYR_ETCD_PORT: 2379 - project: check: diff --git a/playbooks/zun-devstack-base-multinode/post.yaml b/playbooks/zun-devstack-base-multinode/post.yaml deleted file mode 100644 index e07f5510a..000000000 --- a/playbooks/zun-devstack-base-multinode/post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- 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/zun-devstack-base-multinode/run.yaml b/playbooks/zun-devstack-base-multinode/run.yaml deleted file mode 100644 index 032ca0247..000000000 --- a/playbooks/zun-devstack-base-multinode/run.yaml +++ /dev/null @@ -1,82 +0,0 @@ -- hosts: primary - name: Zun devstack base multinode - tasks: - - - name: Ensure 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 zun git://git.openstack.org/openstack/zun - LIBS_FROM_GIT="python-zunclient" - KURYR_CAPABILITY_SCOPE=global - KURYR_PROCESS_EXTERNAL_CONNECTIVITY=False - - EOF - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - - export PYTHONUNBUFFERED=true - export DEVSTACK_GATE_TEMPEST=1 - export DEVSTACK_GATE_NEUTRON=1 - - # Enable tempest for tempest plugin - export ENABLED_SERVICES=tempest - - export PROJECTS="openstack/zun $PROJECTS" - export PROJECTS="openstack/kuryr-libnetwork $PROJECTS" - export PROJECTS="openstack/python-zunclient $PROJECTS" - export PROJECTS="openstack/devstack-plugin-container $PROJECTS" - export PROJECTS="openstack/zun-tempest-plugin $PROJECTS" - - # Keep localrc to be able to set some vars in post_test_hook - export KEEP_LOCALRC=1 - export DEVSTACK_GATE_TOPOLOGY="multinode" - - function gate_hook { - cd /opt/stack/new/zun/ - ./zun/tests/contrib/gate_hook.sh docker sql - } - export -f gate_hook - - function post_test_hook { - source $BASE/new/devstack/accrc/admin/admin - cd /opt/stack/new/zun/ - ./zun/tests/contrib/post_test_hook.sh docker - } - - 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 }}' diff --git a/playbooks/zun-devstack-base/post.yaml b/playbooks/zun-devstack-base/post.yaml deleted file mode 100644 index e07f5510a..000000000 --- a/playbooks/zun-devstack-base/post.yaml +++ /dev/null @@ -1,15 +0,0 @@ -- 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/zun-devstack-base/run.yaml b/playbooks/zun-devstack-base/run.yaml deleted file mode 100644 index c7e983eac..000000000 --- a/playbooks/zun-devstack-base/run.yaml +++ /dev/null @@ -1,90 +0,0 @@ -- hosts: all - name: Zun devstack base - tasks: - - - name: Ensure 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 zun git://git.openstack.org/openstack/zun - LIBS_FROM_GIT="python-zunclient" - KURYR_PROCESS_EXTERNAL_CONNECTIVITY=False - - EOF - executable: /bin/bash - chdir: '{{ ansible_user_dir }}/workspace' - environment: '{{ zuul | zuul_legacy_vars }}' - - - shell: - cmd: | - set -e - set -x - - export PYTHONUNBUFFERED=true - export DEVSTACK_GATE_TEMPEST=0 - export DEVSTACK_GATE_NEUTRON=1 - - # Enable tempest for tempest plugin - export ENABLED_SERVICES=tempest - - export PROJECTS="openstack/zun $PROJECTS" - export PROJECTS="openstack/kuryr-libnetwork $PROJECTS" - export PROJECTS="openstack/python-zunclient $PROJECTS" - export PROJECTS="openstack/devstack-plugin-container $PROJECTS" - export PROJECTS="openstack/zun-tempest-plugin $PROJECTS" - - # Keep localrc to be able to set some vars in post_test_hook - export KEEP_LOCALRC=1 - - if [ "{{ use_python3 }}" -eq 1 ] ; then - export DEVSTACK_GATE_USE_PYTHON3=True - # Swift does not work so skip s-* for python3x for now - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-account" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-container" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-object" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"disable_service s-proxy" - else - export DEVSTACK_GATE_USE_PYTHON3=False - fi - - function gate_hook { - cd /opt/stack/new/zun/ - ./zun/tests/contrib/gate_hook.sh docker "{{ database }}" - } - export -f gate_hook - - function post_test_hook { - source $BASE/new/devstack/accrc/admin/admin - cd /opt/stack/new/zun/ - ./zun/tests/contrib/post_test_hook.sh docker - } - 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 }}' diff --git a/playbooks/zun-tempest-base/post.yaml b/playbooks/zun-tempest-base/post.yaml new file mode 100644 index 000000000..3e2ff9293 --- /dev/null +++ b/playbooks/zun-tempest-base/post.yaml @@ -0,0 +1,13 @@ +- hosts: all + tasks: + - name: Ensure {{ ansible_user_dir }}/logs exists + become: True + file: + path: "{{ ansible_user_dir }}/logs" + state: directory + owner: "{{ ansible_user }}" + - name: Copy over docker systemd unit journals + shell: + cmd: | + sudo journalctl -o short-precise --unit docker | sudo tee {{ ansible_user_dir }}/logs/docker.txt > /dev/null + executable: /bin/bash diff --git a/releasenotes/notes/zuul-v3-native-gates-a46ef4c168f9362e.yaml b/releasenotes/notes/zuul-v3-native-gates-a46ef4c168f9362e.yaml new file mode 100644 index 000000000..64a7f11a2 --- /dev/null +++ b/releasenotes/notes/zuul-v3-native-gates-a46ef4c168f9362e.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Migrate all upstream gates to Zuulv3 native format. + diff --git a/zun/tests/contrib/gate_hook.sh b/zun/tests/contrib/gate_hook.sh deleted file mode 100755 index 17a0aecd9..000000000 --- a/zun/tests/contrib/gate_hook.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash -x -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# This script is executed inside gate_hook function in devstack gate. - - -# Keep all devstack settings here instead of project-config for easy -# maintain if we want to change devstack config settings in future. - -driver=$1 -db=$2 - -export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin kuryr-libnetwork https://git.openstack.org/openstack/kuryr-libnetwork" -export DEVSTACK_LOCAL_CONFIG+=$'\n'"enable_plugin devstack-plugin-container https://git.openstack.org/openstack/devstack-plugin-container" -export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_USE_UWSGI=True" -export DEVSTACK_LOCAL_CONFIG+=$'\n'"KURYR_CONFIG_DIR=/etc/kuryr-libnetwork" -export DEVSTACK_GATE_TEMPEST=1 -export DEVSTACK_GATE_TEMPEST_ALL_PLUGINS=1 -export DEVSTACK_GATE_TEMPEST_REGEX="zun_tempest_plugin.tests.tempest.api" - -if [ "$driver" = "docker" ]; then - export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DRIVER=docker" -fi - -if [ "$db" = "etcd" ]; then - export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DB_TYPE=etcd" - export DEVSTACK_LOCAL_CONFIG+=$'\n'"KURYR_ETCD_PORT=2379" -elif [ "$db" = "sql" ]; then - export DEVSTACK_LOCAL_CONFIG+=$'\n'"ZUN_DB_TYPE=sql" -fi - -$BASE/new/devstack-gate/devstack-vm-gate.sh -gate_retval=$? - -# Copy over docker systemd unit journals. -mkdir -p $WORKSPACE/logs -sudo journalctl -o short-precise --unit docker | sudo tee $WORKSPACE/logs/docker.txt > /dev/null - -exit $gate_retval diff --git a/zun/tests/contrib/post_test_hook.sh b/zun/tests/contrib/post_test_hook.sh deleted file mode 100755 index 4a8761196..000000000 --- a/zun/tests/contrib/post_test_hook.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -x -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -# This script is executed inside post_test_hook function in devstack gate. - -# Save trace setting -XTRACE=$(set +o | grep xtrace) -set -o xtrace - -# NOTE(hongbin): reserve for future post test processing - -$XTRACE