From 227bb19115eaab4f689cb570f0a5574cd5e318bb Mon Sep 17 00:00:00 2001 From: Mark Beierl Date: Wed, 23 Nov 2016 16:59:18 -0500 Subject: Daily Job Creation of a daily job script that runs under Jenkins and kicks off a series of tests using the freshly cloned workspace. Change-Id: Ibc63c1df954578ad78604321ea410c8fd8c63c41 JIRA: STORPERF-87 Signed-off-by: Mark Beierl --- ci/daily.sh | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 88 insertions(+), 14 deletions(-) (limited to 'ci/daily.sh') diff --git a/ci/daily.sh b/ci/daily.sh index 0cc5977..bdfe746 100755 --- a/ci/daily.sh +++ b/ci/daily.sh @@ -8,29 +8,103 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## -if [ -f ~/jenkins-os.rc ] +if [ -z $WORKSPACE ] then - . ~/jenkins-os.rc + cd `dirname $0`/.. + WORKSPACE=`pwd` fi -if [ -z $WORKSPACE ] +# This is set by Jenkins, but if we are running manually, just use the +# current hostname. +if [ -z "$NODE_NAME" ] then - WORKSPACE=`pwd` + NODE_NAME=`hostname` +fi +export POD_NAME=$NODE_NAME + +if [ -d $WORKSPACE/ci/job ] +then + sudo rm -rf $WORKSPACE/ci/job +fi +sudo find $WORKSPACE/ -name '*.db' -exec rm -fv {} \; + +$WORKSPACE/ci/generate-admin-rc.sh +$WORKSPACE/ci/generate-environment.sh + +. $WORKSPACE/ci/job/environment.rc +for env in `cat $WORKSPACE/ci/job/admin.rc` +do + export $env +done + +echo "Checking for an existing stack" +STACK_ID=`heat stack-list | grep StorPerfAgentGroup | awk '{print $2}'` +if [ ! -z $STACK_ID ] +then + heat stack-delete -y StorPerfAgentGroup fi -function stage_base_os_in_glance { +while [ ! -z $STACK_ID ] +do + STACK_ID=`heat stack-list | grep StorPerfAgentGroup | awk '{print $2}'` +done + +echo "TEST_DB_URL=http://testresults.opnfv.org/test/api/v1" >> $WORKSPACE/ci/job/admin.rc +echo "INSTALLER_TYPE=${INSTALLER}" >> $WORKSPACE/ci/job/admin.rc +$WORKSPACE/ci/launch_docker_container.sh + +echo "Waiting for StorPerf to become active" +while [ $(curl -X GET 'http://127.0.0.1:5000/api/v1.0/configurations' > /dev/null 2>&1;echo $?) -ne 0 ] +do + sleep 1 +done + +echo Creating 1:1 stack +$WORKSPACE/ci/create_stack.sh $CINDER_NODES 10 + +export QUEUE_DEPTH=8 +export BLOCK_SIZE=16384 +export WORKLOAD=ws +export SCENARIO_NAME="${CINDER_BACKEND}_${WORKLOAD}" +WARM_UP=`$WORKSPACE/ci/start_job.sh | awk '/job_id/ {print $2}' | sed 's/"//g'` + +WARM_UP_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$WARM_UP&type=status" \ + | awk '/Status/ {print $2}' | sed 's/"//g'` +while [ "$WARM_UP_STATUS" != "Completed" ] +do + sleep 10 + WARM_UP_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$WARM_UP&type=status" \ + | awk '/Status/ {print $2}' | sed 's/"//g'` +done + - export OS_IMAGE_API_VERSION=1 +for WORKLOAD in ws wr rs rr rw +do + for BLOCK_SIZE in 2048 8192 16384 + do + for QUEUE_DEPTH in 1 2 8 + do + export QUEUE_DEPTH + export BLOCK_SIZE + export WORKLOAD + export SCENARIO_NAME="${CINDER_BACKEND}_${WORKLOAD}" - glance image-list | grep "$1" - if [ $? -eq 1 ] - then - curl -s -o $WORKSPACE/$1.qcow2 https://cloud-images.ubuntu.com/releases/15.10/release/ubuntu-15.10-server-cloudimg-amd64-disk1.img - glance image-create --name="$1" --disk-format=qcow2 --container-format=bare < $WORKSPACE/$1.qcow2 - fi + JOB=`$WORKSPACE/ci/start_job.sh \ + | awk '/job_id/ {print $2}' | sed 's/"//g'` + JOB_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ + | awk '/Status/ {print $2}' | sed 's/"//g'` + while [ "$JOB_STATUS" != "Completed" ] + do + sleep 10 + JOB_STATUS=`curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=status" \ + | awk '/Status/ {print $2}' | sed 's/"//g'` + done + done + done +done -} -stage_base_os_in_glance ubuntu-server +echo "Deleting stack for cleanup" +curl -X DELETE --header 'Accept: application/json' 'http://127.0.0.1:5000/api/v1.0/configurations' exit 0 -- cgit 1.2.3-korg