diff options
author | mbeierl <mark.beierl@dell.com> | 2017-06-29 14:16:39 -0400 |
---|---|---|
committer | mbeierl <mark.beierl@dell.com> | 2017-06-30 20:45:58 -0400 |
commit | 2c95b01efa53c7e7d4ea7d73fde0da6099938e50 (patch) | |
tree | d8e3a3cbed1d1f7778fd1045fe063dfe29d509e4 /ci | |
parent | 45130c365c235bc4a5a53fd0ddb15f84a1460199 (diff) |
Docker Compose Updates
Adds docker-compose directory with content to start container suite using
nginx as front and and SwaggerUI in its own container.
Updates the documentation to reflect new method of starting StorPerf.
Change-Id: I469676e330dcad6c968b90133df8866b69eb5ea1
JIRA: STORPERF-181
Signed-off-by: mbeierl <mark.beierl@dell.com>
Diffstat (limited to 'ci')
-rwxr-xr-x | ci/create_stack.sh | 1 | ||||
-rwxr-xr-x | ci/daily.sh | 9 | ||||
-rwxr-xr-x | ci/launch_docker_container.sh | 44 | ||||
-rwxr-xr-x | ci/remove_docker_container.sh | 30 | ||||
-rwxr-xr-x | ci/start_job.sh | 2 |
5 files changed, 52 insertions, 34 deletions
diff --git a/ci/create_stack.sh b/ci/create_stack.sh index 68c4874..a0be65c 100755 --- a/ci/create_stack.sh +++ b/ci/create_stack.sh @@ -21,3 +21,4 @@ curl -X POST --header 'Content-Type: application/json' \ --header 'Accept: application/json' -d @body.json \ 'http://127.0.0.1:5000/api/v1.0/configurations' +rm body.json
\ No newline at end of file diff --git a/ci/daily.sh b/ci/daily.sh index c42fe64..26d5fea 100755 --- a/ci/daily.sh +++ b/ci/daily.sh @@ -27,8 +27,6 @@ pip install osc_lib==1.3.0 pip install python-openstackclient==3.7.0 pip install python-heatclient==1.7.0 -sudo find $WORKSPACE/ -name '*.db' -exec rm -fv {} \; - $WORKSPACE/ci/generate-admin-rc.sh echo "TEST_DB_URL=http://testresults.opnfv.org/test/api/v1" >> $WORKSPACE/ci/job/admin.rc $WORKSPACE/ci/generate-environment.sh @@ -42,12 +40,12 @@ done < $WORKSPACE/ci/job/admin.rc export AGENT_COUNT=${AGENT_COUNT:-$CINDER_NODES} export BLOCK_SIZES=${BLOCK_SIZES:-1024,16384} +export STEADY_STATE_SAMPLES=${STEADY_STATE_SAMPLES:-10} export DEADLINE=${DEADLINE:-`expr $STEADY_STATE_SAMPLES \* 3`} export DISK_TYPE=${DISK_TYPE:-unspecified} export QUEUE_DEPTHS=${QUEUE_DEPTHS:-1,4} export POD_NAME=${NODE_NAME:-`hostname`} export SCENARIO_NAME=${DEPLOY_SCENARIO:-none} -export STEADY_STATE_SAMPLES=${STEADY_STATE_SAMPLES:-10} export TEST_CASE=${TEST_CASE:-snia_steady_state} export VERSION=`echo ${BUILD_TAG#*daily-} | cut -d- -f1` export VOLUME_SIZE=${VOLUME_SIZE:-2} @@ -58,13 +56,13 @@ echo Environment env | sort echo ========================================================================== +$WORKSPACE/ci/remove_docker_container.sh $WORKSPACE/ci/delete_stack.sh $WORKSPACE/ci/create_glance_image.sh $WORKSPACE/ci/create_storperf_flavor.sh $WORKSPACE/ci/launch_docker_container.sh $WORKSPACE/ci/create_stack.sh $AGENT_COUNT $VOLUME_SIZE "Ubuntu 16.04 x86_64" $NETWORK - export WORKLOAD=_warm_up,$WORKLOADS export BLOCK_SIZE=$BLOCK_SIZES export QUEUE_DEPTH=$QUEUE_DEPTHS @@ -99,7 +97,8 @@ curl -s -X DELETE --header 'Accept: application/json' 'http://127.0.0.1:5000/api curl -s -X GET "http://127.0.0.1:5000/api/v1.0/jobs?id=$JOB&type=metadata" \ -o $WORKSPACE/ci/job/report.json -docker rm -f storperf +$WORKSPACE/ci/remove_docker_container.sh + sudo rm -rf $WORKSPACE/ci/job/carbon echo ========================================================================== diff --git a/ci/launch_docker_container.sh b/ci/launch_docker_container.sh index ec9c4d8..2dfde93 100755 --- a/ci/launch_docker_container.sh +++ b/ci/launch_docker_container.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x ############################################################################## # Copyright (c) 2016 EMC and others. # @@ -9,42 +9,28 @@ ############################################################################## cd `dirname $0` +ci=`pwd` -storperf_container=`docker ps -a -q -f name=storperf` +cd ${ci}/../docker-compose -if [ ! -z $storperf_container ] -then - echo "Stopping any existing StorPerf container" - docker rm -fv $storperf_container -fi - -if [ ! -f job/admin.rc ] -then - ./generate-admin-rc.sh -fi +export TAG=${DOCKER_TAG:-latest} +export ENV_FILE=${ci}/job/admin.rc +export CARBON_DIR=${ci}/job/carbon/ -if [ ! -d job/carbon ] +if [ ! -d ${ci}/job/carbon ] then - mkdir job/carbon - sudo chown 33:33 job/carbon + mkdir ${ci}/job/carbon + sudo chown 33:33 ${ci}/job/carbon fi -if [ -z $DOCKER_TAG ] -then - DOCKER_TAG=latest -fi - -docker pull opnfv/storperf:$DOCKER_TAG - -docker run -d --env-file `pwd`/job/admin.rc \ - -p 5000:5000 \ - -p 8000:8000 \ - -v `pwd`/job/carbon:/opt/graphite/storage/whisper \ - --name storperf opnfv/storperf -# -v `pwd`/../../storperf:/home/opnfv/repos/storperf \ +docker-compose -f ../docker-compose/docker-compose.yaml up -d 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 ] +curl -X GET 'http://127.0.0.1:5000/api/v1.0/configurations' > test.html 2>&1 +while [ `grep 'agent_count' test.html | wc -l` == "0" ] do sleep 1 + curl -X GET 'http://127.0.0.1:5000/api/v1.0/configurations' > test.html 2>&1 done + +rm -f test.html diff --git a/ci/remove_docker_container.sh b/ci/remove_docker_container.sh new file mode 100755 index 0000000..f424110 --- /dev/null +++ b/ci/remove_docker_container.sh @@ -0,0 +1,30 @@ +#!/bin/bash -x +############################################################################## +# Copyright (c) 2016 EMC and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################## + +cd `dirname $0` +ci=`pwd` + +cd ${ci}/../docker-compose + +export TAG=${DOCKER_TAG:-latest} +export ENV_FILE=${ci}/job/admin.rc +export CARBON_DIR=${ci}/job/carbon/ + +docker-compose down + +for container_name in storperf swagger-ui http-front-end +do + container=`docker ps -a -q -f name=$container_name` + if [ ! -z $container ] + then + echo "Stopping any existing $container_name container" + docker rm -fv $container + fi +done diff --git a/ci/start_job.sh b/ci/start_job.sh index 487e0c6..dde3dca 100755 --- a/ci/start_job.sh +++ b/ci/start_job.sh @@ -32,3 +32,5 @@ cat body.json 1>&2 curl -s -X POST --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ -d @body.json http://127.0.0.1:5000/api/v1.0/jobs + +rm body.json
\ No newline at end of file |