blob: beef6439505395428acce3ead235c7ef4f9f82a8 [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 Slobodrianb184ab12017-08-30 21:11:47 -04006docker network create --driver overlay --subnet=172.29.19.0/24 voltha_net
7#docker network create --driver overlay --subnet=172.29.19.0/24 --opt encrypted=true voltha_net
Sergio Slobodriancab0a392017-07-13 08:42:10 -04008docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-kafka-cluster.yml kafka
9docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-consul-cluster.yml consul
Sergio Slobodrian7c5e8852017-07-31 20:17:14 -040010echo "Waiting for consul to start"
11while true
12do
13 cs=`docker service ls | grep consul_consul | awk '{print $4}'`
14 if [ "$cs" == "3/3" ]; then
15 break
16 fi
17done
Sergio Slobodrian6e270c12017-08-09 23:06:49 -040018
19echo "Waiting for consul leader election"
20patience=10
21while true
22do
23 leader=`curl -v http://${hostName}:8500/v1/status/leader 2>/dev/null | sed -e 's/"//g'`
24 if [ ! -z "$leader" ] ; then
25 echo "Leader elected is on ${leader}"
26 break
27 fi
28 sleep 10
29 patience=`expr $patience - 1`
30 if [ $patience -eq 0 ]; then
31 echo "Consul leader election taking too long... aborting"
32 ./voltha-swarm-stop.sh
33 exit 1
34 fi
35done
36
37
Sergio Slobodrian36cd85f2017-08-24 11:01:11 -040038docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-agg-cluster.yml fluentd
39sleep 2
40docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-cluster.yml fluentd
David K. Bainbridge215e0242017-09-05 23:18:24 -070041docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-onos-swarm.yml onos
Sergio Slobodrianbe829272017-07-17 14:45:45 -040042docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml vcore
Stephane Barbarie2940dac2017-08-18 14:15:17 -040043docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-ofagent-swarm.yml ofagent
Sergio Slobodrianbe829272017-07-17 14:45:45 -040044docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-envoy-swarm.yml voltha
Sergio Slobodriancab0a392017-07-13 08:42:10 -040045docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli
46docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon
47docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf
Sergio Slobodriancab0a392017-07-13 08:42:10 -040048docker service create -d --name tools --network voltha_net --network kafka_net --publish "4022:22" voltha/tools
49