From 30564a39ed6dad060bd59ff247d63cb54ded8e25 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 23 Sep 2015 12:29:14 -0400 Subject: [PATCH] Move RobotFramework dependencies to csit job Dependencies: - Jenkins Robot Framework plugin 1.6.1 https://issues.jenkins-ci.org/browse/JENKINS-29178 Changes: - Remove java, git, and perl-XML-XPATH install command as it's already covered by the baseline image. - Only install the minimal amount of packages to get python virtualenv going. - Use virtualenv to setup robotframework at the job level. (Further improvement to this could be to use a JJB variable to allow projects to define which python modules they need in their project file) This work is needed to make maintenance of python modules simplier and move them out of the vagrant / spinup scripts and directly into the job itself. This work is necessary to allow us to upgrade to CentOS7 for our robotframework slave. Change-Id: Ib167e5ba2989269df177ec070811c83618c25cb6 Signed-off-by: Thanh Ha --- ...w-integration-deploy-controller-run-test.sh | 3 +++ ...e-raw-integration-install-robotframework.sh | 18 ++++++++++++++++++ ...e-raw-integration-start-cluster-run-test.sh | 3 +++ jjb/integration/integration-macros.yaml | 12 ++++++++++++ jjb/integration/integration-templates.yaml | 10 +++++++++- .../integration-robotframework/bootstrap.sh | 11 ++++------- 6 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 jjb/integration/include-raw-integration-install-robotframework.sh diff --git a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh index d87598ad5a..7895ef2df3 100644 --- a/jjb/integration/include-raw-integration-deploy-controller-run-test.sh +++ b/jjb/integration/include-raw-integration-deploy-controller-run-test.sh @@ -1,3 +1,6 @@ +# Activate robotframework virtualenv +source $WORKSPACE/venv-robotframework/bin/activate + CONTROLLERMEM="2048m" if [ ${CONTROLLERSCOPE} == 'all' ]; then diff --git a/jjb/integration/include-raw-integration-install-robotframework.sh b/jjb/integration/include-raw-integration-install-robotframework.sh new file mode 100644 index 0000000000..9692cdc331 --- /dev/null +++ b/jjb/integration/include-raw-integration-install-robotframework.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# @License EPL-1.0 +############################################################################## +# Copyright (c) 2015 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## + +virtualenv $WORKSPACE/venv-robotframework +source $WORKSPACE/venv-robotframework/bin/activate +pip install -q docker-py importlib requests scapy +pip install -q robotframework{,-{httplibrary,requests,sshlibrary}} + +# vim: sw=4 ts=4 sts=4 et ft=sh : diff --git a/jjb/integration/include-raw-integration-start-cluster-run-test.sh b/jjb/integration/include-raw-integration-start-cluster-run-test.sh index 6bd0f15af9..0b9a04109b 100644 --- a/jjb/integration/include-raw-integration-start-cluster-run-test.sh +++ b/jjb/integration/include-raw-integration-start-cluster-run-test.sh @@ -1,3 +1,6 @@ +# Activate robotframework virtualenv +source $WORKSPACE/venv-robotframework/bin/activate + echo "#################################################" echo "## Verify Cluster is UP ##" echo "#################################################" diff --git a/jjb/integration/integration-macros.yaml b/jjb/integration/integration-macros.yaml index 4fa342c701..ae737120df 100644 --- a/jjb/integration/integration-macros.yaml +++ b/jjb/integration/integration-macros.yaml @@ -249,6 +249,18 @@ - shell: !include-raw include-raw-integration-get-bundle-url.sh +# Macro: integration-install-robotframework +# Operation: Installs robotframework using pip to a virtualenv +# Used by: {project}-csit-* job templates + +- builder: + name: integration-install-robotframework + builders: + - shell: + !include-raw include-raw-integration-install-robotframework.sh + + + ############## # Publishers # ############## diff --git a/jjb/integration/integration-templates.yaml b/jjb/integration/integration-templates.yaml index 99fdc2dca4..f95b775e8d 100644 --- a/jjb/integration/integration-templates.yaml +++ b/jjb/integration/integration-templates.yaml @@ -1,5 +1,5 @@ # Job templates in this file (please update with every new template): -# +# # Old templates: # {project}-csit-verify-1node-{functionality}-{stream} # {project}-csit-1node-imds-{functionality}-{install}-{stream} @@ -80,6 +80,7 @@ pattern: 'csit/suites/{project}/**' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -151,6 +152,7 @@ result: 'success' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -250,6 +252,7 @@ pattern: 'csit/suites/{project}/**' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -321,6 +324,7 @@ result: 'success' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -414,6 +418,7 @@ - timed: '{schedule}' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -509,6 +514,7 @@ pattern: 'csit/suites/{project}/**' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -581,6 +587,7 @@ result: 'success' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' @@ -676,6 +683,7 @@ - timed: '{schedule}' builders: + - integration-install-robotframework - integration-get-slave-addresses - inject: properties-file: 'slave_addresses.txt' diff --git a/vagrant/integration-robotframework/bootstrap.sh b/vagrant/integration-robotframework/bootstrap.sh index f384118f2c..b5620ea067 100644 --- a/vagrant/integration-robotframework/bootstrap.sh +++ b/vagrant/integration-robotframework/bootstrap.sh @@ -3,15 +3,12 @@ # vim: sw=4 ts=4 sts=4 et tw=72 : yum clean all -# Add the ODL yum repo -yum install -q -y https://nexus.opendaylight.org/content/repositories/opendaylight-yum-epel-6-x86_64/rpm/opendaylight-release/0.1.0-1.el6.noarch/opendaylight-release-0.1.0-1.el6.noarch.rpm yum update -q -y -yum install -q -y java-1.7.0-openjdk-devel git perl-XML-XPath - -# The following are known requirements for our robotframework environments -yum install -q -y python-{devel,importlib,requests,setuptools,virtualenv,docker-py} \ - robotframework{,-{httplibrary,requests,sshlibrary}} scapy +# Install minimal python requirements to get virtualenv going +# Additional python dependencies should be installed via JJB configuration +# inside project jobs using a virtualenv setup. +yum install -q -y python-{devel,setuptools,virtualenv} # Install `udpreplay` to be used for (lispflowmapping) performance tests yum install -q -y libpcap-devel boost-devel -- 2.36.6