blob: bef96bfe3c78f6697556fd24018b072a86675bb1 [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
40sudo modprobe dummy
41sudo ip link set name fabric dev dummy0
42sudo ifconfig fabric up
43
44
45# Install charts for M-CORD
46cd "$CORDDIR"/helm-charts
47helm dep update ./xos-core
48helm upgrade --install xos-core ./xos-core
49~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
50
51helm dep update ./xos-profiles/base-openstack
52helm upgrade --install base-openstack ./xos-profiles/base-openstack \
53 --set computeNodes.master.name="$( hostname )" \
54 --set vtn-service.sshUser="$( whoami )"
55~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
56
57helm upgrade --install onos-cord ./onos
58~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
59
60helm dep update ./xos-profiles/mcord
61helm upgrade --install mcord ./xos-profiles/mcord \
62 --set global.proxySshUser="$( whoami )"
63~/openstack-helm/tools/deployment/common/wait-for-pods.sh default
64
65
66# Firewall VNC ports for security
67sudo ufw default allow incoming
68sudo ufw default allow outgoing
69sudo ufw default allow routed
70sudo ufw deny proto tcp from any to any port 5900:5950 comment 'vnc'
71sudo ufw --force enable
72
73
74echo "M-CORD has been successfully installed"