blob: 4b408871b4ab630a78875ebf49b30b876a05a0a8 [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
Stephane Barbarie2940dac2017-08-18 14:15:17 -040038docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-ofagent-swarm.yml ofagent
Sergio Slobodrianbe829272017-07-17 14:45:45 -040039docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-envoy-swarm.yml voltha
Sergio Slobodriancab0a392017-07-13 08:42:10 -040040docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli
41docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon
42docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf
sathishgb5d1c182017-07-13 14:20:19 +053043docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-cluster.yml fluentd
Sergio Slobodriancab0a392017-07-13 08:42:10 -040044docker service create -d --name tools --network voltha_net --network kafka_net --publish "4022:22" voltha/tools
45