Simplify and streamline zuul v3 jobs

This is a first iteration to refactor zuul v3 jobs for ARA.
It gets rid of the code duplication and streamlines the jobs
and their layouts.

- Use a single playbook for post.yaml
- Use a single playbook for run.yaml (add in variables)
- Use the bindep role for installing bindep.txt
- Move outside of /workspace/, we don't need that place anymore
- Add integration test coverage for debian
- Add integration test coverage for opensuse (non-voting, pending
  an encoding issue in the nodepool image build)
- Move non-voting declarations to the layout (it's clearer that way)
- Document the testing matrix

Change-Id: I9e894f6eaa4763ddf93f989d2214488d70a0dbde
This commit is contained in:
David Moreau-Simard 2017-11-05 11:45:00 -05:00
parent 74a86858c7
commit b85ff4bd3f
No known key found for this signature in database
GPG Key ID: 33A07694CBB71ECC
19 changed files with 98 additions and 511 deletions

View File

@ -93,8 +93,8 @@ preferred client to come chat with us !
.. _irc.freenode.net: https://webchat.freenode.net/
Contributing, issues and bugs
=============================
Contributing, testing, issues and bugs
======================================
Contributions to ARA are definitely welcome and much appreciated !
@ -111,6 +111,21 @@ contributing !
* Bugs, issues and feature tracking are available on **StoryBoard**:
https://storyboard.openstack.org/#!/project/843
Each commit to ARA is reviewed and also rigorously tested to prevent
regressions. Here's our current testing coverage:
+------------------+--------+--------+----------+--------+--------+
| - | Fedora | CentOS | OpenSUSE | Debian | Ubuntu |
+==================+========+========+==========+========+========+
| Ansible 2.2.3.0 | | | | X | |
+------------------+--------+--------+----------+--------+--------+
| Ansible 2.3.2.0 | | X | | | |
+------------------+--------+--------+----------+--------+--------+
| Ansible "latest" | X | | X | | X |
+------------------+--------+--------+----------+--------+--------+
| Ansible "devel" | X | | | | X |
+------------------+--------+--------+----------+--------+--------+
You might also be interested in reading the project manifesto_ in order to have
a good understanding of the project's core values and philosophy.

View File

@ -7,7 +7,7 @@ openssl-devel [platform:rpm]
python-devel [platform:redhat !platform:fedora]
python2-devel [platform:fedora]
python3-devel [platform:fedora]
libselinux-python [platform:rpm]
libselinux-python [platform:rpm !platform:suse]
libxml2-devel [platform:rpm]
libxslt-devel [platform:rpm]
libffi-dev [platform:dpkg]

View File

@ -1,52 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py27-2.2.3.0-centos-7 from old job
gate-ara-integration-py27-2.2.3.0-centos-7
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py27 --ansible 2.2.3.0
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -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

View File

@ -1,52 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py27-devel-centos-7 from old job
gate-ara-integration-py27-devel-centos-7-nv
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py27 --ansible devel
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -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

View File

@ -1,52 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py27-latest-centos-7 from old job
gate-ara-integration-py27-latest-centos-7
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py27 --ansible latest
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -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

View File

@ -1,52 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py35-devel-fedora-26 from old job
gate-ara-integration-py35-devel-fedora-26-nv
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py35 --ansible devel
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -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

View File

@ -1,51 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py35-devel from old job gate-ara-integration-py35-devel-ubuntu-xenial-nv
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py35 --ansible devel
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -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

View File

@ -1,52 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py35-latest-fedora-26 from old job
gate-ara-integration-py35-latest-fedora-26
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py35 --ansible latest
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -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

View File

@ -1,51 +0,0 @@
- hosts: all
name: Autoconverted job legacy-ara-integration-py35-latest from old job gate-ara-integration-py35-latest-ubuntu-xenial
tasks:
- name: Ensure legacy workspace directory
file:
path: '{{ ansible_user_dir }}/workspace'
state: directory
- shell:
cmd: |
set -e
set -x
CLONEMAP=`mktemp`
function cleanup {
# In cases where zuul-cloner is aborted during a git
# clone operation, git will remove the git work tree in
# its cleanup. The work tree in these jobs is the
# workspace directory, which means that subsequent
# jenkins post-build actions can not run because the
# workspace has been removed.
# To reduce the likelihood of this having an impact,
# recreate the workspace directory if needed
mkdir -p $WORKSPACE
rm -f $CLONEMAP
}
trap cleanup EXIT
cat > $CLONEMAP << EOF
clonemap:
- name: $ZUUL_PROJECT
dest: .
EOF
/usr/zuul-env/bin/zuul-cloner -m $CLONEMAP --cache-dir /opt/git \
git://git.openstack.org $ZUUL_PROJECT
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: /usr/local/jenkins/slave_scripts/install-distro-packages.sh
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'
- shell:
cmd: |
set -e
set -x
./run_tests.sh --python py35 --ansible latest
executable: /bin/bash
chdir: '{{ ansible_user_dir }}/workspace'
environment: '{{ zuul | zuul_legacy_vars }}'

View File

@ -1,9 +1,8 @@
- hosts: primary
- hosts: all
tasks:
- name: Copy files from {{ ansible_user_dir }}/workspace/ on node
- name: Copy files from {{ ansible_user_dir }} on node
synchronize:
src: '{{ ansible_user_dir }}/workspace/'
src: '{{ ansible_user_dir }}/'
dest: '{{ zuul.executor.log_root }}'
mode: pull
copy_links: true

16
playbooks/run.yaml Normal file
View File

@ -0,0 +1,16 @@
- hosts: all
name: Run ARA integration tests
tasks:
- include_role:
name: bindep
- name: Run integration tests
shell:
cmd: |
set -e
set -x
./run_tests.sh --python {{ python_test_version }} --ansible {{ ansible_test_version }}
executable: /bin/bash
chdir: '{{ zuul.project.src_dir }}'
environment:
WORKSPACE: "{{ ansible_user_dir }}"

View File

@ -1,56 +1,62 @@
- job:
name: ara-integration-py27-2.2.3.0-centos-7
name: ara-integration-base
parent: base
run: playbooks/ara-integration-py27-2.2.3.0-centos-7/run.yaml
post-run: playbooks/ara-integration-py27-2.2.3.0-centos-7/post.yaml
timeout: 1200
run: playbooks/run.yaml
post-run: playbooks/post.yaml
timeout: 900
- job:
name: ara-integration-debian-py27-2.2.3.0
parent: ara-integration-base
vars:
python_test_version: py27
ansible_test_version: 2.2.3.0
nodeset: debian-jessie
- job:
name: ara-integration-centos-py27-2.3.2.0
parent: ara-integration-base
vars:
python_test_version: py27
ansible_test_version: 2.3.2.0
nodeset: centos-7
- job:
name: ara-integration-py27-devel-centos-7
parent: base
voting: false
run: playbooks/ara-integration-py27-devel-centos-7/run.yaml
post-run: playbooks/ara-integration-py27-devel-centos-7/post.yaml
timeout: 1200
nodeset: centos-7
name: ara-integration-opensuse-py27-latest
parent: ara-integration-base
vars:
python_test_version: py27
ansible_test_version: latest
nodeset: opensuse-423
- job:
name: ara-integration-py27-latest-centos-7
parent: base
run: playbooks/ara-integration-py27-latest-centos-7/run.yaml
post-run: playbooks/ara-integration-py27-latest-centos-7/post.yaml
timeout: 1200
nodeset: centos-7
name: ara-integration-ubuntu-py35-2.3.2.0
parent: ara-integration-base
vars:
python_test_version: py35
ansible_test_version: 2.3.2.0
nodeset: ubuntu-xenial
- job:
name: ara-integration-py35-devel
parent: base
voting: false
run: playbooks/ara-integration-py35-devel/run.yaml
post-run: playbooks/ara-integration-py35-devel/post.yaml
timeout: 1200
name: ara-integration-ubuntu-py35-devel
parent: ara-integration-base
vars:
python_test_version: py35
ansible_test_version: devel
nodeset: ubuntu-xenial
- job:
name: ara-integration-py35-devel-fedora-26
parent: base
voting: false
run: playbooks/ara-integration-py35-devel-fedora-26/run.yaml
post-run: playbooks/ara-integration-py35-devel-fedora-26/post.yaml
timeout: 1200
name: ara-integration-fedora-py35-latest
parent: ara-integration-base
vars:
python_test_version: py35
ansible_test_version: latest
nodeset: fedora-26
- job:
name: ara-integration-py35-latest
parent: base
run: playbooks/ara-integration-py35-latest/run.yaml
post-run: playbooks/ara-integration-py35-latest/post.yaml
timeout: 1200
- job:
name: ara-integration-py35-latest-fedora-26
parent: base
run: playbooks/ara-integration-py35-latest-fedora-26/run.yaml
post-run: playbooks/ara-integration-py35-latest-fedora-26/post.yaml
timeout: 1200
name: ara-integration-fedora-py35-devel
parent: ara-integration-base
vars:
python_test_version: py35
ansible_test_version: devel
nodeset: fedora-26

View File

@ -2,16 +2,19 @@
name: openstack/ara
check:
jobs:
- ara-integration-py27-2.2.3.0-centos-7
- ara-integration-py27-latest-centos-7
- ara-integration-py27-devel-centos-7
- ara-integration-py35-latest
- ara-integration-py35-devel
- ara-integration-py35-latest-fedora-26
- ara-integration-py35-devel-fedora-26
- ara-integration-debian-py27-2.2.3.0
- ara-integration-centos-py27-2.3.2.0
- ara-integration-opensuse-py27-latest:
voting: false
- ara-integration-ubuntu-py35-2.3.2.0
- ara-integration-ubuntu-py35-devel:
voting: false
- ara-integration-fedora-py35-latest
- ara-integration-fedora-py35-devel:
voting: false
gate:
jobs:
- ara-integration-py27-2.2.3.0-centos-7
- ara-integration-py27-latest-centos-7
- ara-integration-py35-latest
- ara-integration-py35-latest-fedora-26
- ara-integration-debian-py27-2.2.3.0
- ara-integration-centos-py27-2.3.2.0
- ara-integration-ubuntu-py35-2.3.2.0
- ara-integration-fedora-py35-latest