blob: d0b5b50e69ad20d38e5611e3984721c55eee092f [file] [log] [blame]
Andy Bavierfacd0be2018-05-24 15:56:31 -07001#!/bin/bash
2#
3# Copyright 2017-present Open Networking Foundation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17set -xe
18
19# This script assumes the following repos exist
20# ~/cord/automation-tools
21
22# Location of 'cord' directory for checkouts on the local system
23CORDDIR="${CORDDIR:-${HOME}/cord}"
24
25[ ! -d "$CORDDIR" ] && mkdir -p "$CORDDIR"
26[ ! -d "$CORDDIR"/automation-tools ] && cd "$CORDDIR" && git clone https://gerrit.opencord.org/automation-tools
27[ ! -d "$CORDDIR"/helm-charts ] && cd "$CORDDIR" && git clone https://gerrit.opencord.org/helm-charts
28
29
30# Install K8S, Helm, Openstack
31"$CORDDIR"/automation-tools/openstack-helm/openstack-helm-dev-setup.sh
32
33
Andy Bavierfacd0be2018-05-24 15:56:31 -070034# Add keys for VTN
35[ ! -e ~/.ssh/id_rsa ] && ssh-keygen -f ~/.ssh/id_rsa -t rsa -N ""
36cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
37cp ~/.ssh/id_rsa "$CORDDIR"/helm-charts/xos-profiles/base-openstack/files/node_key
38
39# Add dummy fabric interface
Andy Bavier99588852018-06-05 12:59:51 -070040if ! ifconfig fabric &>> /dev/null
41then
42 sudo modprobe dummy
43 sudo ip link set name fabric dev dummy0
44 sudo ifconfig fabric up
45fi
Andy Bavierfacd0be2018-05-24 15:56:31 -070046
47# Install charts for M-CORD
48cd "$CORDDIR"/helm-charts
49helm dep update ./xos-core
50helm upgrade --install xos-core ./xos-core
51~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
52
53helm dep update ./xos-profiles/base-openstack
54helm upgrade --install base-openstack ./xos-profiles/base-openstack \
55 --set computeNodes.master.name="$( hostname )" \
56 --set vtn-service.sshUser="$( whoami )"
57~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
58
59helm upgrade --install onos-cord ./onos
60~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
61
62helm dep update ./xos-profiles/mcord
63helm upgrade --install mcord ./xos-profiles/mcord \
64 --set global.proxySshUser="$( whoami )"
65~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
66
67
Andy Bavier99588852018-06-05 12:59:51 -070068# Firewall VNC ports for security (CloudLab)
69if [ -d /mnt/extra ]
70then
71 sudo ufw default allow incoming
72 sudo ufw default allow outgoing
73 sudo ufw default allow routed
74 sudo ufw deny proto tcp from any to any port 5900:5950 comment 'vnc'
75 sudo ufw --force enable
76fi
Andy Bavierfacd0be2018-05-24 15:56:31 -070077
78echo "M-CORD has been successfully installed"