Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | voltha_base_dir="/cord/incubator/voltha" |
Sergio Slobodrian | 6e270c1 | 2017-08-09 23:06:49 -0400 | [diff] [blame] | 4 | hostName=`hostname` |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 5 | |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 6 | docker network create --driver overlay --subnet=172.29.19.0/24 --opt encrypted=true voltha_net |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 7 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-kafka-cluster.yml kafka |
| 8 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-consul-cluster.yml consul |
Sergio Slobodrian | 7c5e885 | 2017-07-31 20:17:14 -0400 | [diff] [blame] | 9 | echo "Waiting for consul to start" |
| 10 | while true |
| 11 | do |
| 12 | cs=`docker service ls | grep consul_consul | awk '{print $4}'` |
| 13 | if [ "$cs" == "3/3" ]; then |
| 14 | break |
| 15 | fi |
| 16 | done |
Sergio Slobodrian | 6e270c1 | 2017-08-09 23:06:49 -0400 | [diff] [blame] | 17 | |
| 18 | echo "Waiting for consul leader election" |
| 19 | patience=10 |
| 20 | while true |
| 21 | do |
| 22 | leader=`curl -v http://${hostName}:8500/v1/status/leader 2>/dev/null | sed -e 's/"//g'` |
| 23 | if [ ! -z "$leader" ] ; then |
| 24 | echo "Leader elected is on ${leader}" |
| 25 | break |
| 26 | fi |
| 27 | sleep 10 |
| 28 | patience=`expr $patience - 1` |
| 29 | if [ $patience -eq 0 ]; then |
| 30 | echo "Consul leader election taking too long... aborting" |
| 31 | ./voltha-swarm-stop.sh |
| 32 | exit 1 |
| 33 | fi |
| 34 | done |
| 35 | |
| 36 | |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 37 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml vcore |
| 38 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-envoy-swarm.yml voltha |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 39 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli |
| 40 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon |
| 41 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf |
sathishg | b5d1c18 | 2017-07-13 14:20:19 +0530 | [diff] [blame] | 42 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-cluster.yml fluentd |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 43 | docker service create -d --name tools --network voltha_net --network kafka_net --publish "4022:22" voltha/tools |
| 44 | |