aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/cFW/postinstall.sh
diff options
context:
space:
mode:
authorAkhila Kishore <akhila.kishore@intel.com>2019-03-06 06:34:09 -0800
committerAkhila Kishore <akhila.kishore@intel.com>2019-03-22 07:28:00 -0700
commit1fd5b3964a142be6c176dcc886d79a614c04ce70 (patch)
tree90e4c44d0c18ea51e1787627960556c6a1dcbe79 /kud/tests/cFW/postinstall.sh
parent7830bf49fbdcf1b726dc8dc3aca3638fb2195e66 (diff)
Restructuring the repo.
The idea is to restructure the existing repo create a deployment independent of Vagrant or other hosting providers. Renamed KRD to KUbernetes Deploy(Kud) including the ansible scripts Added new path to functional tests. Moved samples pdfs to sites. Minor changes to Readme. Updated aio.sh, moved sample config Corrected other nits. Updated and verified test cases. Addressed comments and changes associated with it. Updated Readme and minor change in Vagrantfile. Validated test cases again. Moved aio.sh into vagrant folder. Added new README for each hosting provider and project on the whole. Updated the installer script with relative path. Updated the name to deployment_infra, moved the cFW sripcts to tests. Updated the gitignore file. Issue-ID: MULTICLOUD-301 Change-Id: Ie48c26b12ab58b604493fba58a9c5b9f8ba10942 Signed-off-by: Akhila Kishore <akhila.kishore@intel.com>
Diffstat (limited to 'kud/tests/cFW/postinstall.sh')
-rwxr-xr-xkud/tests/cFW/postinstall.sh83
1 files changed, 83 insertions, 0 deletions
diff --git a/kud/tests/cFW/postinstall.sh b/kud/tests/cFW/postinstall.sh
new file mode 100755
index 00000000..5a1d5043
--- /dev/null
+++ b/kud/tests/cFW/postinstall.sh
@@ -0,0 +1,83 @@
+#!/bin/bash
+# SPDX-license-identifier: Apache-2.0
+##############################################################################
+# Copyright (c) 2018
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+set -o nounset
+set -o pipefail
+set -o xtrace
+
+# install_docker() - Download and install docker-engine
+function install_docker {
+ local max_concurrent_downloads=${1:-3}
+
+ if $(docker version &>/dev/null); then
+ return
+ fi
+ apt-get install -y software-properties-common linux-image-extra-$(uname -r) linux-image-extra-virtual apt-transport-https ca-certificates curl
+ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
+ add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
+ apt-get update
+ apt-get install -y docker-ce
+
+ mkdir -p /etc/systemd/system/docker.service.d
+ if [ $http_proxy ]; then
+ cat <<EOL > /etc/systemd/system/docker.service.d/http-proxy.conf
+[Service]
+Environment="HTTP_PROXY=$http_proxy"
+EOL
+ fi
+ if [ $https_proxy ]; then
+ cat <<EOL > /etc/systemd/system/docker.service.d/https-proxy.conf
+[Service]
+Environment="HTTPS_PROXY=$https_proxy"
+EOL
+ fi
+ if [ $no_proxy ]; then
+ cat <<EOL > /etc/systemd/system/docker.service.d/no-proxy.conf
+[Service]
+Environment="NO_PROXY=$no_proxy"
+EOL
+ fi
+ systemctl daemon-reload
+ echo "DOCKER_OPTS=\"-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --max-concurrent-downloads $max_concurrent_downloads \"" >> /etc/default/docker
+ usermod -aG docker $USER
+
+ systemctl restart docker
+ sleep 10
+}
+
+# install_docker_compose() - Installs docker compose python module
+function install_docker_compose {
+ if ! which pip; then
+ curl -sL https://bootstrap.pypa.io/get-pip.py | python
+ fi
+ pip install --upgrade pip
+ pip install docker-compose
+}
+
+echo 'vm.nr_hugepages = 1024' >> /etc/sysctl.conf
+sysctl -p
+
+install_docker
+install_docker_compose
+
+cd /vagrant
+# build vpp docker image
+BUILD_ARGS="--no-cache"
+if [ $HTTP_PROXY ]; then
+ BUILD_ARGS+=" --build-arg HTTP_PROXY=${HTTP_PROXY}"
+fi
+if [ $HTTPS_PROXY ]; then
+ BUILD_ARGS+=" --build-arg HTTPS_PROXY=${HTTPS_PROXY}"
+fi
+pushd vpp
+docker build ${BUILD_ARGS} -t electrocucaracha/vpp:latest .
+popd
+
+docker-compose up -d