diff options
author | Lusheng Ji <lji@research.att.com> | 2018-04-04 17:25:06 -0400 |
---|---|---|
committer | Lusheng Ji <lji@research.att.com> | 2018-04-04 21:31:42 +0000 |
commit | 8533616f90d28b89be5bb3598cb87e98ca51fe2e (patch) | |
tree | 6371be392884d09250c9a6c1c926d87a47ba0f36 | |
parent | 45942672408b16428c1b05ce12fbb460d7560368 (diff) |
Imporve dcae2 init scripts
Issue-ID: DCAEGEN2-206
Change-Id: I7e60806369eef5a816f6c5c686f1061debc833ee
Signed-off-by: Lusheng Ji <lji@research.att.com>
-rwxr-xr-x | boot/dcae2_install.sh | 3 | ||||
-rwxr-xr-x | boot/dcae2_vm_init.sh | 54 |
2 files changed, 55 insertions, 2 deletions
diff --git a/boot/dcae2_install.sh b/boot/dcae2_install.sh index b59f06f2..3446b6c2 100755 --- a/boot/dcae2_install.sh +++ b/boot/dcae2_install.sh @@ -139,7 +139,8 @@ if [ "$DEPLOYMENT_PROFILE" == "R2MVP" ]; then RELEASE_TAG='R2' rm -rf /opt/app/inputs-templates mkdir -p /opt/app/inputs-templates - wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose.yaml + wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose-1.yaml + wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose-2.yaml pip install --upgrade jinja2 wget https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/scripts/detemplate-bpinputs.py && \ diff --git a/boot/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh index 581c0bf1..ac6713d0 100755 --- a/boot/dcae2_vm_init.sh +++ b/boot/dcae2_vm_init.sh @@ -685,6 +685,58 @@ fi if [ "$DEPLOYMENT_PROFILE" == "R2MVP" ]; then cd /opt/app/config - /opt/docker/docker-compose up -d + /opt/docker/docker-compose -f docker-compose-1.yaml up -d + echo "Waiting for Consul to come up ready" + while ! nc -z localhost 8500; do sleep 1; done + echo "Waiting for DB to come up ready" + while ! nc -z localhost 5432; do sleep 1; done + echo "Waiting for CBS to come up ready" + while ! nc -z localhost 10000; do sleep 1; done + echo "All dependencies are up, proceed to the next phase" + sleep 5 + + NAME='config_binding_service' + PORT='10000' + ID=$(sudo docker ps |grep "$NAME" |cut -b1-12) + while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done + REG='{"ID": "'"$NAME"'0", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}' + curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register + + sleep 5 + echo "Now bring up DCAE service components" + /opt/docker/docker-compose -f docker-compose-2.yaml up -d + + + NAME='ves' + PORT='8080' + echo "Registering for $NAME:$PORT" + ID=$(sudo docker ps |grep "$NAME" |cut -b1-12) + while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done + REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}' + curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register + + NAME='tca' + PORT='11011' + echo "Registering for $NAME:$PORT" + ID=$(sudo docker ps |grep "$NAME" |cut -b1-12) + while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done + REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}' + curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register + + NAME='hr' + PORT='9101' + echo "Registering for $NAME:$PORT" + ID=$(sudo docker ps |grep "$NAME" |cut -b1-12) + while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done + REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}' + curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register + + NAME='he' + PORT='9102' + echo "Registering for $NAME:$PORT" + ID=$(sudo docker ps |grep "$NAME" |cut -b1-12) + while [ -z "$ID" ]; do echo "Waiting for $NAME container to be deployed"; sleep 1; ID=$(sudo docker ps |grep "$NAME" |cut -b1-12); done + REG='{"ID": "'"$NAME"'", "Name": "'"$NAME"'", "Address": "'"$NAME"'", "Port": '"$PORT"'}' + curl -v -X PUT -H "Content-Type: application/json" --data "${REG}" http://localhost:8500/v1/agent/service/register fi |