From 87f8d249cbbc0834b01f314289c0e12d328dcb48 Mon Sep 17 00:00:00 2001 From: Venkata Harish K Kajur Date: Tue, 3 Oct 2017 22:19:12 +0000 Subject: Change the docker startup to wait before container is finished to ensure that during when script finishes at least the resources traversal and haproxy is up as they need to be connected to hbase Issue-ID: AAI-411 Change-Id: I8f383582c8d69a669e14b084df028c53e62d2bd5 Signed-off-by: Venkata Harish K Kajur --- deploy_vm1.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/deploy_vm1.sh b/deploy_vm1.sh index 01e8447..278cfd3 100755 --- a/deploy_vm1.sh +++ b/deploy_vm1.sh @@ -68,7 +68,7 @@ function wait_for_container() { CONTAINER_NAME="$1"; START_TEXT="$2"; - TIMEOUT=160 + TIMEOUT=360 # wait for the real startup AMOUNT_STARTUP=$(docker logs ${CONTAINER_NAME} 2>&1 | grep "$START_TEXT" | wc -l) @@ -135,8 +135,14 @@ fi; chown -R $USER_ID:$USER_ID $RESOURCE_LOGS $TRAVERSAL_LOGS; +RESOURCES_CONTAINER_NAME=$($DOCKER_COMPOSE_CMD up -d aai-resources.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | grep -v 'volume' | grep -v 'network' | awk '{ print $2; }' | head -1); +wait_for_container $RESOURCES_CONTAINER_NAME '0.0.0.0:8447'; + +GRAPH_CONTAINER_NAME=$($DOCKER_COMPOSE_CMD up -d aai-traversal.api.simpledemo.openecomp.org 2>&1 | grep 'Creating' | awk '{ print $2; }' | head -1); +wait_for_container $GRAPH_CONTAINER_NAME '0.0.0.0:8446'; + # Deploy haproxy and traversal and resources -$DOCKER_COMPOSE_CMD up -d aai.api.simpledemo.openecomp.org aai-resources.api.simpledemo.openecomp.org aai-traversal.api.simpledemo.openecomp.org +$DOCKER_COMPOSE_CMD up -d aai.api.simpledemo.openecomp.org $DOCKER_COMPOSE_CMD up -d sparky-be -- cgit 1.2.3-korg