blob: ee9cc49fc6d0420c2c1b4bb6fda02edbf5ef7f03 [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 Slobodrian36cd85f2017-08-24 11:01:11 -040037docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-agg-cluster.yml fluentd
38sleep 2
39docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-cluster.yml fluentd
Sergio Slobodrianbe829272017-07-17 14:45:45 -040040docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml vcore
Stephane Barbarie2940dac2017-08-18 14:15:17 -040041docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-ofagent-swarm.yml ofagent
Sergio Slobodrianbe829272017-07-17 14:45:45 -040042docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-envoy-swarm.yml voltha
Sergio Slobodriancab0a392017-07-13 08:42:10 -040043docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli
44docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon
45docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf
Sergio Slobodriancab0a392017-07-13 08:42:10 -040046docker service create -d --name tools --network voltha_net --network kafka_net --publish "4022:22" voltha/tools
47