From 6fd82112e8ca0c4b0c3c675fce24836e87e54e94 Mon Sep 17 00:00:00 2001 From: Elizabeth Krumbach Joseph Date: Wed, 2 Oct 2013 15:57:08 -0700 Subject: [PATCH] Add initial files for tripleo in the gate. Add jenkins job builder tripleo script (based on pbr). Add prepare_node_tripleo.sh which will be called by nodepool. Add prepare_tripleo.sh script, based on the devstack script but pulling in just the tripleo repositories with pull-tools tripleo-incubator script. Add tripleo stanza to nodepool itself. Update site.pp with variables for tripleo authentication. Add experimental pipeline to zuul's layout.yaml for this job on tripleo-incubator. Change-Id: I03433d08585ba3a783fe939264d7521cafa83e41 --- manifests/site.pp | 3 ++ .../jenkins_job_builder/config/tripleo.yaml | 34 ++++++++++++++ .../nodepool/scripts/prepare_node_tripleo.sh | 22 +++++++++ .../files/nodepool/scripts/prepare_tripleo.sh | 47 +++++++++++++++++++ .../openstack_project/files/zuul/layout.yaml | 2 + .../openstack_project/manifests/nodepool.pp | 3 ++ .../templates/nodepool/nodepool.yaml.erb | 25 ++++++++++ 7 files changed, 136 insertions(+) create mode 100644 modules/openstack_project/files/jenkins_job_builder/config/tripleo.yaml create mode 100755 modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh create mode 100755 modules/openstack_project/files/nodepool/scripts/prepare_tripleo.sh diff --git a/manifests/site.pp b/manifests/site.pp index 64c29c74bd..872ff5fa2f 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -383,6 +383,9 @@ node 'nodepool.openstack.org' { hpcloud_username => hiera('nodepool_hpcloud_username'), hpcloud_password => hiera('nodepool_hpcloud_password'), hpcloud_project => hiera('nodepool_hpcloud_project'), + tripleo_username => hiera('nodepool_tripleo_username'), + tripleo_password => hiera('nodepool_tripleo_password'), + tripleo_project => hiera('nodepool_tripleo_project'), } } diff --git a/modules/openstack_project/files/jenkins_job_builder/config/tripleo.yaml b/modules/openstack_project/files/jenkins_job_builder/config/tripleo.yaml new file mode 100644 index 0000000000..883c0428b4 --- /dev/null +++ b/modules/openstack_project/files/jenkins_job_builder/config/tripleo.yaml @@ -0,0 +1,34 @@ +- job: + name: 'gate-tripleo-deploy' + node: 'tripleo-precise' + + wrappers: + - timeout: + timeout: 120 + fail: true + - timestamps + + builders: + - devstack-checkout + - shell: | + #!/bin/bash -xe + export PYTHONUNBUFFERED=true + export DEVSTACK_GATE_TEMPEST=0 + export DEVSTACK_GATE_EXERCISES=0 + function gate_hook {{ + bash -xe $BASE/tripleo-incubator/toci_gate_test.sh + }} + export -f gate_hook + cp devstack-gate/devstack-vm-gate-wrap.sh ./safe-devstack-vm-gate-wrap.sh + ./safe-devstack-vm-gate-wrap.sh + - link-logs + + publishers: + - scp: + site: 'static.openstack.org' + files: + - target: 'logs/$LOG_PATH' + source: '**/pip.log' + keep-hierarchy: false + copy-after-failure: true + - console-log diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh b/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh new file mode 100755 index 0000000000..6d74bbe685 --- /dev/null +++ b/modules/openstack_project/files/nodepool/scripts/prepare_node_tripleo.sh @@ -0,0 +1,22 @@ +#!/bin/bash -xe + +# Copyright (C) 2011-2013 OpenStack Foundation +# +# 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. + +HOSTNAME=$1 + +./prepare_node.sh $HOSTNAME +sudo -u jenkins -i /opt/nodepool-scripts/prepare_tripleo.sh $HOSTNAME diff --git a/modules/openstack_project/files/nodepool/scripts/prepare_tripleo.sh b/modules/openstack_project/files/nodepool/scripts/prepare_tripleo.sh new file mode 100755 index 0000000000..37f4bea46d --- /dev/null +++ b/modules/openstack_project/files/nodepool/scripts/prepare_tripleo.sh @@ -0,0 +1,47 @@ +#!/bin/bash -xe + +# Copyright (C) 2011-2013 OpenStack Foundation +# Copyright (C) 2013 Hewlett-Packard Development Company, L.P. +# +# 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. + +mkdir -p ~/cache/files +mkdir -p ~/cache/pip +# Copied from devstack script, seems reasonable to keep and later +# build upon as needed +sudo DEBIAN_FRONTEND=noninteractive apt-get \ + --option "Dpkg::Options::=--force-confold" \ + --assume-yes install build-essential python-dev \ + linux-headers-virtual linux-headers-`uname -r` + +# Might use this later for other cache, keeping for consistancy +# rm -rf ~/workspace-cache +# mkdir -p ~/workspace-cache + +rm -rf ~/tripleo +mkdir -p ~/tripleo + +cd ~/tripleo +git clone https://review.openstack.org/p/openstack/tripleo-incubator +bash tripleo-incubator/scripts/pull-tools + +# We'll want something like this for triplo when we do dependencies +# +#. /etc/lsb-release +#cd /opt/nodepool-scripts/ +#python ./devstack-cache.py $DISTRIB_CODENAME + +sync +sleep 5 diff --git a/modules/openstack_project/files/zuul/layout.yaml b/modules/openstack_project/files/zuul/layout.yaml index 455ca0884e..f42dd44713 100644 --- a/modules/openstack_project/files/zuul/layout.yaml +++ b/modules/openstack_project/files/zuul/layout.yaml @@ -2312,6 +2312,8 @@ projects: - tripleo-incubator-docs release: - tripleo-incubator-docs + experimental: + - gate-tripleo-deploy - name: stackforge/climate check: diff --git a/modules/openstack_project/manifests/nodepool.pp b/modules/openstack_project/manifests/nodepool.pp index 11aeaedb39..aa140ce134 100644 --- a/modules/openstack_project/manifests/nodepool.pp +++ b/modules/openstack_project/manifests/nodepool.pp @@ -15,6 +15,9 @@ class openstack_project::nodepool( $hpcloud_username ='', $hpcloud_password ='', $hpcloud_project ='', + $tripleo_username ='', + $tripleo_password ='', + $tripleo_project ='', ) { class { 'openstack_project::server': sysadmins => $sysadmins, diff --git a/modules/openstack_project/templates/nodepool/nodepool.yaml.erb b/modules/openstack_project/templates/nodepool/nodepool.yaml.erb index 5e153fa9dd..049d1f8943 100644 --- a/modules/openstack_project/templates/nodepool/nodepool.yaml.erb +++ b/modules/openstack_project/templates/nodepool/nodepool.yaml.erb @@ -116,6 +116,23 @@ providers: setup: prepare_node_devstack.sh username: jenkins private-key: /home/nodepool/.ssh/id_rsa + - name: tripleo-test-cloud + region-name: '' + service-type: 'compute' + service-name: 'Compute' + username: '<%= tripleo_username %>' + password: '<%= tripleo_password %>' + project-id: '<%= tripleo_project %>' + auth-url: 'https://poc.tripleo.org:10000/v2.0' + boot-timeout: 120 + max-servers: 2 + images: + - name: tripleo-precise + base-image: 'Ubuntu Precise 12.04 LTS Server 64-bit' + min-ram: 8192 + setup: prepare_node_tripleo.sh + username: jenkins + private-key: /home/nodepool/.ssh/id_rsa targets: - name: jenkins01 @@ -137,6 +154,10 @@ targets: - name: rax-iad - name: rax-dfw - name: rax-ord + - name: tripleo-precise + min-ready: 1 + providers: + - name: tripleo-test-cloud - name: jenkins02 jenkins: url: 'https://jenkins02.openstack.org/' @@ -156,3 +177,7 @@ targets: - name: rax-iad - name: rax-dfw - name: rax-ord + - name: tripleo-precise + min-ready: 1 + providers: + - name: tripleo-test-cloud