blob: e0ad45e6554a9f2a8507c2436c081463026aa229 [file] [log] [blame]
Jeremy Mordkoff91157a52017-04-26 22:50:43 -04001#!/usr/bin/env bash
Adam Israel61d476d2017-05-19 09:14:33 -04002#
Jeremy Mordkoff91157a52017-04-26 22:50:43 -04003# Copyright 2017 RIFT.IO Inc
garciadeblasa1fc4572017-04-24 19:08:21 +02004#
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.
garciadeblasa1fc4572017-04-24 19:08:21 +020016#
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040017# Author(s): Jeremy Mordkoff
18# Creation Date: 26 April 2017
Adam Israel61d476d2017-05-19 09:14:33 -040019#
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040020#
garciadeblasa1fc4572017-04-24 19:08:21 +020021
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040022# INSTALL.sh
23# install launchpad SO and all of its dependencies
24#
garciadeblasa1fc4572017-04-24 19:08:21 +020025
Mike Marchetti425f8ce2017-06-15 13:02:16 -040026HERE=$(realpath $(dirname $0))
27OSM_JENKINS=$(dirname $HERE)
28. $OSM_JENKINS/common/install_common
29
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040030# Defensive bash programming flags
31set -o errexit # Exit on any error
32trap 'echo ERROR: Command failed: \"$BASH_COMMAND\"' ERR
33set -o nounset # Expanding an unset variable is an error. Variables must be
34 # set before they can be used.
garciadeblasa1fc4572017-04-24 19:08:21 +020035
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040036###############################################################################
37# Set up repo and version
Jeremy Mordkoff537ad952017-12-12 18:39:56 -050038PLATFORM_VERSION=5.2.0.3.73627
garciadeblasa1fc4572017-04-24 19:08:21 +020039
Jeremy Mordkoff537ad952017-12-12 18:39:56 -050040while getopts "V:h" o; do
Mike Marchetti425f8ce2017-06-15 13:02:16 -040041 case "${o}" in
Mike Marchetti425f8ce2017-06-15 13:02:16 -040042 V)
43 PLATFORM_VERSION=${OPTARG}
44 ;;
45 h)
46 usage
47 exit 0
48 ;;
49 *)
50 usage
51 exit 1
52 ;;
53 esac
54done
55
56function usage() {
57 echo
58 echo "NAME:"
59 echo " $0"
60 echo
61 echo "SYNOPSIS:"
62 echo " $0 -h|--help"
Mike Marchetti425f8ce2017-06-15 13:02:16 -040063 echo
64 echo "DESCRIPTION:"
65 echo " Prepare current system to run SO and UI."
66 echo
Mike Marchetti425f8ce2017-06-15 13:02:16 -040067 echo " PLATFORM_VERSION (optional): version of the platform packages to be installed."
68 echo
69}
70
garciadeblasa1fc4572017-04-24 19:08:21 +020071
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040072###############################################################################
73# Main block
garciadeblasa1fc4572017-04-24 19:08:21 +020074
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040075# enable the right repos
Jeremy Mordkoff537ad952017-12-12 18:39:56 -050076echo "### INSTALLING RIFT platform ${PLATFORM_VERSION}"
Jeremy Mordkoff7b0656f2017-10-03 12:29:02 -040077
Jeremy Mordkoff91157a52017-04-26 22:50:43 -040078curl http://repos.riftio.com/public/xenial-riftware-public-key | apt-key add -
Jeremy Mordkoff537ad952017-12-12 18:39:56 -050079echo "deb https://artifactory.riftio.com/debian-OSM xenial main" >/etc/apt/sources.list.d/rift.list
Adam Israel61d476d2017-05-19 09:14:33 -040080
81# Make the Rift repo a higher priority to work around version conflicts.
82cat <<EOF > /etc/apt/preferences.d/rift
83Package: *
Jeremy Mordkoff537ad952017-12-12 18:39:56 -050084Pin: origin artifactory.riftio.com
Adam Israel61d476d2017-05-19 09:14:33 -040085Pin-Priority: 600
86EOF
87
Jeremy Mordkoffa4e08132017-10-03 08:53:05 -040088
89
90#######################
91# temp fix
92# this is normally done by mkcontainer, but the last line is missing
Adam Israel4e602502017-10-05 16:12:53 -040093# we can take this out when we update the RIFT platform
Jeremy Mordkoffa4e08132017-10-03 08:53:05 -040094
95cat <<EOF >>/etc/systemd/user.conf
96DefaultLimitNOFILE=65536
97DefaultLimitMSGQUEUE=8192000
98DefaultLimitNPROC=65536
99DefaultTasksMax=65536
100EOF
101cat <<EOF >>/etc/systemd/system.conf
102DefaultLimitNOFILE=65536
103DefaultLimitMSGQUEUE=8192000
104DefaultLimitNPROC=65536
105DefaultTasksMax=65536
106EOF
107systemctl daemon-reload
108
109##################################
110
111
Jeremy Mordkoff91157a52017-04-26 22:50:43 -0400112apt-get update
Adam Israel61d476d2017-05-19 09:14:33 -0400113
Jeremy Mordkoff91157a52017-04-26 22:50:43 -0400114# and install the tools
Jeremy Mordkoff8dfd9982017-10-02 20:05:11 -0400115apt remove -y tcpdump
Adam Israel61d476d2017-05-19 09:14:33 -0400116apt-get install -y --allow-downgrades rw.tools-container-tools=${PLATFORM_VERSION} rw.tools-scripts=${PLATFORM_VERSION} python
Jeremy Mordkoff369fbb22017-10-02 17:20:25 -0400117/usr/rift/container_tools/mkcontainer --modes MANO-base,rw-platform --rw-version ${PLATFORM_VERSION}
Jeremy Mordkoff91157a52017-04-26 22:50:43 -0400118
Adam Israel61d476d2017-05-19 09:14:33 -0400119# now disable the RIFT OSM repo so that we'll get MANO from
Jeremy Mordkoff91157a52017-04-26 22:50:43 -0400120# the OSM repos
Jeremy Mordkoff2b22e632017-10-02 18:11:23 -0400121rm -f /etc/apt/sources.list.d/rift.list
Mike Marchetti425f8ce2017-06-15 13:02:16 -0400122
garciadeblasa1fc4572017-04-24 19:08:21 +0200123apt-get update
Adam Israel61d476d2017-05-19 09:14:33 -0400124
garciadeblasa1fc4572017-04-24 19:08:21 +0200125apt-get install -y \
Jeremy Mordkofffd18c942017-10-02 14:28:53 -0400126 rw.core.mano-mano \
127 rw.core.mano-rwcal-plugin-aws \
128 rw.core.mano-rwcal-plugin-cloudsim \
129 rw.core.mano-rwcal-plugin-cloudsimproxy \
130 rw.core.mano-rwcal-plugin-openmano-vimconnector \
131 rw.core.mano-rwcal-plugin-openstack \
Adam Israel4e602502017-10-05 16:12:53 -0400132 rw.core.mano-rwcal-plugin-mock
Jeremy Mordkoff1ce95b32017-09-30 16:25:32 -0400133
Adam Israel4e602502017-10-05 16:12:53 -0400134# Install libjuju
Adam Israela7c6c3e2017-10-05 16:50:47 -0400135apt-get install -y python3-pip python3-setuptools
Jeremy Mordkoff1ce95b32017-09-30 16:25:32 -0400136
Adam Israel4e602502017-10-05 16:12:53 -0400137pip3 install juju