Several bundled updates
- The latest envoy docker containter was broken, made changes to request
a sepcific commit version of the container known to work.
- A minor change to the proxy configuration file where the same name was
used for 2 virtual_hosts.
- An update to CreateInstaller.sh for use in multi-user mode which tries
to guess a the cord_home rather than having the user set it.
- A change to the swarm start script to wait for consul to establish the
master before starting the remainder of the dependent containers.
Change-Id: I475dc4bc86189d784a21dc676e07b8b6b87f1bc3
diff --git a/install/CreateInstaller.sh b/install/CreateInstaller.sh
index 9ca37d7..c438f23 100755
--- a/install/CreateInstaller.sh
+++ b/install/CreateInstaller.sh
@@ -294,6 +294,8 @@
echo "voltha_containers:" >> ansible/group_vars/all
cat image-list.cfg >> ansible/group_vars/all
rm -f image-list.cfg
+ echo -e "${lBlue}Gussing at the cord home directory for ${yellow}`whoami`${NC}"
+ sed -i -e "/cord_home:/s#.*#cord_home: `pwd | sed -e 's~/incubator/voltha/install~~'`#" ansible/group_vars/all
else
echo -e "${lBlue}Set up the docker image list from ${lCyan}containers.cfg${NC}"
sed -i -e '/voltha_containers:/,$d' ansible/group_vars/all
diff --git a/install/voltha-swarm-start.sh b/install/voltha-swarm-start.sh
index d43bb26..ad5bdd0 100755
--- a/install/voltha-swarm-start.sh
+++ b/install/voltha-swarm-start.sh
@@ -1,6 +1,7 @@
#!/bin/bash
voltha_base_dir="/cord/incubator/voltha"
+hostName=`hostname`
docker network create --driver overlay --subnet=172.29.19.0/24 --opt encrypted=true voltha_net
docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-kafka-cluster.yml kafka
@@ -13,7 +14,26 @@
break
fi
done
-sleep 10
+
+echo "Waiting for consul leader election"
+patience=10
+while true
+do
+ leader=`curl -v http://${hostName}:8500/v1/status/leader 2>/dev/null | sed -e 's/"//g'`
+ if [ ! -z "$leader" ] ; then
+ echo "Leader elected is on ${leader}"
+ break
+ fi
+ sleep 10
+ patience=`expr $patience - 1`
+ if [ $patience -eq 0 ]; then
+ echo "Consul leader election taking too long... aborting"
+ ./voltha-swarm-stop.sh
+ exit 1
+ fi
+done
+
+
docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml vcore
docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-envoy-swarm.yml voltha
docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli