From 2c95b01efa53c7e7d4ea7d73fde0da6099938e50 Mon Sep 17 00:00:00 2001 From: mbeierl Date: Thu, 29 Jun 2017 14:16:39 -0400 Subject: 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 --- ci/launch_docker_container.sh | 44 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'ci/launch_docker_container.sh') 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 -- cgit 1.2.3-korg