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 | b184ab1 | 2017-08-30 21:11:47 -0400 | [diff] [blame] | 6 | docker 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 Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 8 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-kafka-cluster.yml kafka |
| 9 | 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] | 10 | echo "Waiting for consul to start" |
| 11 | while true |
| 12 | do |
| 13 | cs=`docker service ls | grep consul_consul | awk '{print $4}'` |
| 14 | if [ "$cs" == "3/3" ]; then |
| 15 | break |
| 16 | fi |
| 17 | done |
Sergio Slobodrian | 6e270c1 | 2017-08-09 23:06:49 -0400 | [diff] [blame] | 18 | |
| 19 | echo "Waiting for consul leader election" |
| 20 | patience=10 |
| 21 | while true |
| 22 | do |
| 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 |
| 35 | done |
| 36 | |
| 37 | |
Sergio Slobodrian | 36cd85f | 2017-08-24 11:01:11 -0400 | [diff] [blame] | 38 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-agg-cluster.yml fluentd |
| 39 | sleep 2 |
| 40 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-fluentd-cluster.yml fluentd |
David K. Bainbridge | 215e024 | 2017-09-05 23:18:24 -0700 | [diff] [blame] | 41 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-onos-swarm.yml onos |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 42 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-voltha-swarm.yml vcore |
Stephane Barbarie | 2940dac | 2017-08-18 14:15:17 -0400 | [diff] [blame] | 43 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-ofagent-swarm.yml ofagent |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 44 | 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] | 45 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-vcli.yml cli |
| 46 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-chameleon-swarm.yml chameleon |
| 47 | docker stack deploy -c ${voltha_base_dir}/compose/docker-compose-netconf-swarm.yml netconf |
Sergio Slobodrian | cab0a39 | 2017-07-13 08:42:10 -0400 | [diff] [blame] | 48 | docker service create -d --name tools --network voltha_net --network kafka_net --publish "4022:22" voltha/tools |
| 49 | |