Skip to content

Commit

Permalink
Add third-party CI on tripleo-common to test container builds
Browse files Browse the repository at this point in the history
This adds a job that will run DLRN-rpmbuild on new tripleo-common
reviews and then run a container build with the new package to ensure
that new images or overrides do not break container builds.

This doesn't test the containers themselves but at least we'll know
if they can build, we'll eventually add further testing coverage.

Additionally, for the sake of simplicty, we'll also be building
all container images on ansible-role-rdo-kolla-build code reviews
which is not so much of a problem now that builds are relatively
fast.

Change-Id: Ib80dfb10573255321f20132d76e42c53d58c6c0a
  • Loading branch information
David Moreau-Simard authored and Gerrit Code Review committed Jul 31, 2017
1 parent 8139098 commit 2c2301f
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 44 deletions.
121 changes: 81 additions & 40 deletions jobs/rdoinfra.yaml
Expand Up @@ -64,60 +64,101 @@
- zuul
node: rdo-centos-7

- builder:
name: checkout-rdo-kolla-build
builders:
shell: |
if [[ "${ZUUL_PROJECT}" != "rdo-infra/ansible-role-rdo-kolla-build" ]]; then
mkdir -p $WORKSPACE/rdo-infra/ansible-role-rdo-kolla-build
git clone https://github.com/rdo-infra/ansible-role-rdo-kolla-build
fi
- builder:
name: rdo-kolla-build-images
builders:
shell: |
mkdir -p $WORKSPACE/roles
ln -s $WORKSPACE/rdo-infra/ansible-role-rdo-kolla-build $WORKSPACE/roles/kolla-build
sudo yum -y install libselinux-python
# Need to inherit system-site-packages for libselinux-python and python-yum
virtualenv --system-site-packages $WORKSPACE/ansible
source $WORKSPACE/ansible/bin/activate
pip install ansible==2.3.1.0 ara
export ara_location=$(python -c "import os,ara; print(os.path.dirname(ara.__file__))")
export ANSIBLE_CALLBACK_PLUGINS=$ara_location/plugins/callbacks
export ANSIBLE_ACTION_PLUGINS=$ara_location/plugins/actions
export ANSIBLE_LIBRARY=$ara_location/plugins/modules
export ANSIBLE_ROLES_PATH=$WORKSPACE/roles
export ARA_DATABASE="sqlite:///$WORKSPACE/ara.sqlite"
cat << EOF > ${WORKSPACE}/playbook.yml
---
- name: Build Kolla images
hosts: localhost
become: yes
become_user: root
roles:
- kolla-build
EOF
ansible-playbook -i localhost $WORKSPACE/playbook.yml --tags "setup,build"
- job:
name: gate-rdo-kolla-build-containers
name: 'rdo-kolla-build-integration'
defaults: global
builders:
- prepare-workspace
- rdo-log-setup
- shell: |
set -e
mkdir $WORKSPACE/roles
ln -s $WORKSPACE/$ZUUL_PROJECT/ $WORKSPACE/roles/kolla-build
sudo yum -y install libselinux-python
# Need to inherit system-site-packages for libselinux-python and python-yum
virtualenv --system-site-packages $WORKSPACE/ansible
source $WORKSPACE/ansible/bin/activate
pip install ansible==2.3.1.0 ara
export ara_location=$(python -c "import os,ara; print(os.path.dirname(ara.__file__))")
export ANSIBLE_CALLBACK_PLUGINS=$ara_location/plugins/callbacks
export ANSIBLE_ACTION_PLUGINS=$ara_location/plugins/actions
export ANSIBLE_LIBRARY=$ara_location/plugins/modules
export ANSIBLE_ROLES_PATH=$WORKSPACE/roles
- dlrn-gate-repository
- checkout-rdo-kolla-build
- rdo-kolla-build-images
triggers:
- zuul
publishers:
- postbuildscript:
builders:
- shell: |
mkdir $WORKSPACE/logs
cp -a /tmp/kolla $WORKSPACE/logs/
export ARA_DATABASE="sqlite:///$WORKSPACE/ara.sqlite"
sudo -E $WORKSPACE/ansible/bin/ara generate html $WORKSPACE/logs/ara
export ARA_DATABASE="sqlite:///$WORKSPACE/ara.sqlite"
# Ensure permissions allow artifact uploading
sudo chown -R "$(id -u).$(id -g)" $WORKSPACE/logs
script-only-if-succeeded: False
script-only-if-failed: False
- rdo-rsync-logs
node: rdo-centos-7
wrappers:
- timestamps
- credentials-binding:
- file:
credential-id: 4b4632bd-f44b-446d-a8ca-b57eabef0a7c
variable: LOG_SSH_KEY

cat << EOF > ${WORKSPACE}/playbook.yml
---
- name: Build Kolla images
hosts: localhost
become: yes
become_user: root
vars:
kolla_rdo_images:
- openstack-base
- keystone
kolla_force_build: true
tasks:
- include_role:
name: "kolla-build"
EOF
ansible-playbook -i localhost $WORKSPACE/playbook.yml --tags "setup,build"
- job:
name: gate-rdo-kolla-build-containers
defaults: global
builders:
- prepare-workspace
- rdo-log-setup
- checkout-rdo-kolla-build
- rdo-kolla-build-images
triggers:
- zuul
publishers:
- postbuildscript:
builders:
- shell: |
mkdir $WORKSPACE/logs
cp -a /tmp/kolla $WORKSPACE/logs/
export ARA_DATABASE="sqlite:///$WORKSPACE/ara.sqlite"
sudo -E $WORKSPACE/ansible/bin/ara generate html $WORKSPACE/logs/ara
mkdir $WORKSPACE/logs
cp -a /tmp/kolla $WORKSPACE/logs/
export ARA_DATABASE="sqlite:///$WORKSPACE/ara.sqlite"
sudo -E $WORKSPACE/ansible/bin/ara generate html $WORKSPACE/logs/ara
# Ensure permissions allow artifact uploading
sudo chown -R "$(id -u).$(id -g)" $WORKSPACE/logs
# Ensure permissions allow artifact uploading
sudo chown -R "$(id -u).$(id -g)" $WORKSPACE/logs
script-only-if-succeeded: False
script-only-if-failed: False
- rdo-rsync-logs
Expand Down
4 changes: 0 additions & 4 deletions zuul/projects.yaml
Expand Up @@ -1428,10 +1428,6 @@ projects:
template:
- name: package-distgit-check-jobs

- name: openstack/tripleo-common
template:
- name: package-check-jobs

- name: openstack/tripleo-common-distgit
template:
- name: package-distgit-check-jobs
Expand Down
7 changes: 7 additions & 0 deletions zuul/upstream.yaml
Expand Up @@ -149,6 +149,13 @@ pipelines:
subject: '[Zuul] Job failed in openstack-post pipeline: {change.project}'

projects:
- name: openstack/tripleo-common
template:
- name: package-check-jobs
openstack-check:
- DLRN-rpmbuild:
- rdo-kolla-build-integration

- name: openstack/python-openstackclient
openstack-check-verified:
- DLRN-rpmbuild
Expand Down

0 comments on commit 2c2301f

Please sign in to comment.