blob: ad5bdd08bd8664aab7848318bb1c96643bf075e7 [file] [log] [blame]
Sergio Slobodriancab0a392017-07-13 08:42:10 -04001#!/bin/bash
2
3voltha_base_dir="/cord/incubator/voltha"
Sergio Slobodrian6e270c12017-08-09 23:06:49 -04004hostName=`hostname`
Sergio Slobodriancab0a392017-07-13 08:42:10 -04005
Sergio Slobodrian6570c742017-08-07 23:11:33 -04006docker network create --driver overlay --subnet=172.29.19.0/24 --opt encrypted=true voltha_net
Sergio Slobodriancab0a392017-07-13 08:42:10 -04007docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-kafka-cluster.yml kafka
8docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-consul-cluster.yml consul
Sergio Slobodrian7c5e8852017-07-31 20:17:14 -04009echo "Waiting for consul to start"
10while true
11do
12 cs=`docker service ls | grep consul_consul | awk '{print $4}'`
13 if [ "$cs" == "3/3" ]; then
14 break
15 fi
16done
Sergio Slobodrian6e270c12017-08-09 23:06:49 -040017
18echo "Waiting for consul leader election"
19patience=10
20while true
21do
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
34done
35
36
Sergio Slobodrianbe829272017-07-17 14:45:45 -040037docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml vcore
38docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-envoy-swarm.yml voltha
Sergio Slobodriancab0a392017-07-13 08:42:10 -040039docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli
40docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon
41docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf
sathishgb5d1c182017-07-13 14:20:19 +053042docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-cluster.yml fluentd
Sergio Slobodriancab0a392017-07-13 08:42:10 -040043docker service create -d --name tools --network voltha_net --network kafka_net --publish "4022:22" voltha/tools
44