aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap/vagrant-onap/lib
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/vagrant-onap/lib')
-rwxr-xr-xbootstrap/vagrant-onap/lib/_composed_functions46
-rwxr-xr-xbootstrap/vagrant-onap/lib/_onap_functions87
-rwxr-xr-xbootstrap/vagrant-onap/lib/aai46
-rwxr-xr-xbootstrap/vagrant-onap/lib/appc31
-rwxr-xr-xbootstrap/vagrant-onap/lib/asserts36
-rwxr-xr-xbootstrap/vagrant-onap/lib/commons17
-rwxr-xr-xbootstrap/vagrant-onap/lib/dcae40
-rw-r--r--bootstrap/vagrant-onap/lib/files/settings.template281
-rwxr-xr-xbootstrap/vagrant-onap/lib/functions204
-rwxr-xr-xbootstrap/vagrant-onap/lib/mr15
-rwxr-xr-xbootstrap/vagrant-onap/lib/mso51
-rwxr-xr-xbootstrap/vagrant-onap/lib/policy49
-rwxr-xr-xbootstrap/vagrant-onap/lib/portal46
-rwxr-xr-xbootstrap/vagrant-onap/lib/robot2
-rwxr-xr-xbootstrap/vagrant-onap/lib/sdc40
-rwxr-xr-xbootstrap/vagrant-onap/lib/sdnc74
-rwxr-xr-xbootstrap/vagrant-onap/lib/vfc58
-rwxr-xr-xbootstrap/vagrant-onap/lib/vid41
18 files changed, 990 insertions, 174 deletions
diff --git a/bootstrap/vagrant-onap/lib/_composed_functions b/bootstrap/vagrant-onap/lib/_composed_functions
new file mode 100755
index 000000000..f46499766
--- /dev/null
+++ b/bootstrap/vagrant-onap/lib/_composed_functions
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+# compile_src() - Function that compiles the java source code thru maven
+function compile_src {
+ local src_folder=$1
+ pushd $src_folder
+ if [ -f pom.xml ]; then
+ install_maven
+ mvn clean install -U -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none
+ fi
+ popd
+}
+
+# build_docker_image() - Build Docker container image from source code
+function build_docker_image {
+ local src_folder=$1
+ local profile=$2
+ install_maven
+ install_docker
+ pushd $src_folder
+
+ # Cleanup external repo
+ sed -i 's|${docker.push.registry}/||g' pom.xml
+ local mvn_docker="mvn clean package docker:build"
+ if [ $profile ]; then
+ mvn_docker+=" -P $profile"
+ fi
+ if [ $http_proxy ]; then
+ if ! grep -ql "docker.buildArg.http_proxy" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.http_proxy=$http_proxy"
+ fi
+ if ! grep -ql "docker.buildArg.HTTP_PROXY" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.HTTP_PROXY=$http_proxy"
+ fi
+ fi
+ if [ $https_proxy ]; then
+ if ! grep -ql "docker.buildArg.https_proxy" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.https_proxy=$https_proxy"
+ fi
+ if ! grep -ql "docker.buildArg.HTTPS_PROXY" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.HTTPS_PROXY=$https_proxy"
+ fi
+ fi
+ eval $mvn_docker
+ popd
+}
diff --git a/bootstrap/vagrant-onap/lib/_onap_functions b/bootstrap/vagrant-onap/lib/_onap_functions
new file mode 100755
index 000000000..0d421552f
--- /dev/null
+++ b/bootstrap/vagrant-onap/lib/_onap_functions
@@ -0,0 +1,87 @@
+#!/bin/bash
+
+# create_configuration_files() - Store credentials in files
+function create_configuration_files {
+ mkdir -p /opt/config
+ echo $nexus_docker_repo > /opt/config/nexus_docker_repo.txt
+ echo $nexus_username > /opt/config/nexus_username.txt
+ echo $nexus_password > /opt/config/nexus_password.txt
+ echo $openstack_username > /opt/config/openstack_username.txt
+ echo $openstack_tenant_id > /opt/config/tenant_id.txt
+ echo $dmaap_topic > /opt/config/dmaap_topic.txt
+ echo $docker_version > /opt/config/docker_version.txt
+}
+
+# TODO(electrocucaracha): Determine how to use this behind a proxy
+# docker_openecomp_login() - Login to OpenECOMP Docker Hub
+function docker_openecomp_login {
+ install_docker
+ docker login -u $nexus_username -p $nexus_password $nexus_docker_repo
+}
+
+# pull_openecomp_image() - Pull Docker container image from a Docker Registry Hub
+function pull_openecomp_image {
+ local image=$1
+ local tag=$2
+ docker_openecomp_login
+ pull_docker_image $nexus_docker_repo/openecomp/${image}:$docker_version $tag
+ docker logout
+}
+
+# configure_bind()- Configure bind utils
+function configure_bind {
+ _install_bind
+ mkdir /etc/bind/zones
+
+ curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/db_simpledemo_openecomp_org -o /etc/bind/zones/db.simpledemo.openecomp.org
+ curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/named.conf.options -o /etc/bind/named.conf.options
+ curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/named.conf.local -o /etc/bind/named.conf.local
+
+ modprobe ip_gre
+ sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
+ service bind9 restart
+}
+
+# _configure_maven() - This function creates a maven configuration file in case that doesn't exist
+function _configure_maven {
+ local proxies_start=" <!--"
+ local proxies=" \|"
+ local proxies_end=" \|-->"
+ local mvn_http=""
+ local mvn_https=""
+
+ if [ $http_proxy ] | [ $https_proxy ]; then
+ proxies_start=" "
+ proxies=" "
+ proxies_end=" "
+ if [ $http_proxy ]; then
+ proxy_domain=`echo $http_proxy | awk -F/ '{print $3}' | awk -F: '{print $1}'`
+ proxy_port=`echo $http_proxy | awk -F/ '{print $3}' | awk -F: '{print $2}'`
+ mvn_http="<proxy>\n <id>http</id>\n <active>true</active>\n <protocol>http</protocol>\n <host>$proxy_domain</host>\n <port>$proxy_port</port>\n <nonProxyHosts>${no_proxy}</nonProxyHosts>\n </proxy>"
+ fi
+ if [ $https_proxy ]; then
+ proxy_domain=`echo $https_proxy | awk -F/ '{print $3}' | awk -F: '{print $1}'`
+ proxy_port=`echo $https_proxy | awk -F/ '{print $3}' | awk -F: '{print $2}'`
+ mvn_https="<proxy>\n <id>https</id>\n <active>true</active>\n <protocol>https</protocol>\n <host>$proxy_domain</host>\n <port>$proxy_port</port>\n <nonProxyHosts>${no_proxy}</nonProxyHosts>\n </proxy>"
+ fi
+ fi
+
+ if [ ! -f $mvn_conf_file ]; then
+ cp /var/onap/files/settings.template $mvn_conf_file
+ sed -e "
+ s|%PROXIES_START%|$proxies_start|g;
+ s|%PROXIES%|$proxies|g;
+ s|%HTTP_PROXY%|$mvn_http|g;
+ s|%HTTPS_PROXY%|$mvn_https|g;
+ s|%PROXIES_END%|$proxies_end|g
+ " -i $mvn_conf_file
+ fi
+}
+
+# configure_service() - Download and configure a specific service in upstart
+function configure_service {
+ local service_script=$1
+ curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/$service_script -o /etc/init.d/$service_script
+ chmod +x /etc/init.d/$service_script
+ update-rc.d $service_script defaults
+}
diff --git a/bootstrap/vagrant-onap/lib/aai b/bootstrap/vagrant-onap/lib/aai
index 1cb9e37e9..d048c2b8c 100755
--- a/bootstrap/vagrant-onap/lib/aai
+++ b/bootstrap/vagrant-onap/lib/aai
@@ -3,13 +3,31 @@
set -o xtrace
source /var/onap/functions
+source /var/onap/asserts
hbase_version=1.2.3
+# clone_all_aai_repos() - Function that clones AAI source repo.
+function clone_all_aai_repos {
+ local src_folder=/opt/aai
+
+ for dirc in aai-common aai-config aai-data aai-service data-router logging-service model-loader resources rest-client router-core search-data-service sparky-be sparky-fe test-config traversal; do
+ clone_repo aai/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_aai_repos() - Function that compiles AAI source repo.
+function compile_all_aai_repos {
+ local src_folder=/opt/aai
+
+ for dirc in aai-common aai-config aai-data aai-service data-router logging-service model-loader resources rest-client router-core search-data-service sparky-be sparky-fe test-config traversal; do
+ compile_src $src_folder/$dirc
+ done
+}
+
# pull_hbase_image() - Pull HBase container image from a Docker Registry Hub
function pull_hbase_image {
- is_package_installed docker-ce || install_docker
- docker login -u $nexus_username -p $nexus_password $nexus_docker_repo
+ docker_openecomp_login
docker pull $nexus_docker_repo/aaidocker/aai-hbase-${hbase_version}
}
@@ -22,6 +40,7 @@ function install_hbase {
# install_ajsc() - Install ASJC Java service container
function install_ajsc_aai {
+ local src_folder=/opt/aai/aai-service
cat <<EOL > /etc/ajsc-aai.conf
AAI_REPO_PATH=r/aai
AAI_CHEF_ENV=simpledemo
@@ -29,7 +48,15 @@ AAI_CHEF_LOC=/var/chef/aai-data/environments
docker_gitbranch=master
EOL
docker rm -f aai-service
- pull_openecomp_image ajsc-aai
+ if [[ "$build_image" == "True" ]]; then
+ clone_repo aai/aai-service $src_folder
+ build_docker_image $src_folder/ajsc-aai
+ else
+ pull_openecomp_image ajsc-aai
+ fi
+
+ asserts_image openecomp/ajsc-aai
+
docker run --env-file /etc/ajsc-aai.conf --name=aai-service --net=host -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt -it -d $nexus_docker_repo/openecomp/ajsc-aai:$docker_version
}
@@ -50,15 +77,19 @@ APP_SERVER_KEYSTORE_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o
APP_SERVER_AUTH_PASSWORD=${APP_PASSWORD:-OBF:1qvu1v2h1sov1sar1wfw1j7j1wg21saj1sov1v1x1qxw}
EOL
+ ARGS=""
+
docker rm -f model-loader-service
if [[ "$build_image" == "True" ]]; then
clone_repo aai/model-loader $src_folder
build_docker_image $src_folder
- docker run --env-file /etc/model-loader.conf model-loader
+ ARGS+="--env-file /etc/model-loader.conf model-loader"
else
pull_openecomp_image model-loader
- docker run --name=model-loader-service -it -d --env-file /etc/model-loader.conf $nexus_docker_repo/openecomp/model-loader:$docker_version
+ ARGS+="--name=model-loader-service -it -d --env-file /etc/model-loader.conf $nexus_docker_repo/openecomp/model-loader:$docker_version"
fi
+ asserts_image openecomp/model-loader
+ docker run ${ARGS}
}
# wait_for_sdc() - Function that determines if SDC is up and running
@@ -81,6 +112,11 @@ function init_aai {
mkdir -p /opt/openecomp/aai/logs
mkdir -p /opt/openecomp/aai/data
+ clone_all_aai_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_aai_repos
+ fi
+
install_hbase
# Wait 3 minutes before instantiating the A&AI container
diff --git a/bootstrap/vagrant-onap/lib/appc b/bootstrap/vagrant-onap/lib/appc
index ffec841f4..8ad73561f 100755
--- a/bootstrap/vagrant-onap/lib/appc
+++ b/bootstrap/vagrant-onap/lib/appc
@@ -3,19 +3,44 @@
set -o xtrace
source /var/onap/sdnc
+source /var/onap/asserts
+
+# clone_all_appc_repos() - Function that clones APPC source repo.
+function clone_all_appc_repos {
+ local src_folder=/opt/appc
+
+ clone_repo appc $src_folder
+ clone_repo appc/deployment $src_folder/deployment
+}
+
+# compile_all_appc_repos() - Function that compiles APPC source repo.
+function compile_all_appc_repos {
+ local src_folder=/opt/appc
+
+ compile_src $src_folder
+ compile_src $src_folder/deployment
+}
# install_appc() - Function that clones and installs the APPC services from source code
function install_appc {
+ install_package unzip
local src_folder=/opt/appc
- clone_repo appc/deployment $src_folder
+
+ clone_all_appc_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_appc_repos
+ fi
+
if [[ "$build_image" == "True" ]]; then
- build_sdnc_images
+ clone_repo sdnc/oam /opt/sdnc/oam
+ build_sdnc_images /opt/sdnc/oam
build_docker_image $src_folder/deployment/installation/appc docker
+ asserts_image openecomp/appc-image
else
pull_openecomp_image appc-image openecomp/appc-image:latest
pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
fi
- pushd $src_folder
+ pushd $src_folder/deployment
install_docker_compose
/opt/docker/docker-compose up -d
popd
diff --git a/bootstrap/vagrant-onap/lib/asserts b/bootstrap/vagrant-onap/lib/asserts
index 0e455382a..d02cb5da8 100755
--- a/bootstrap/vagrant-onap/lib/asserts
+++ b/bootstrap/vagrant-onap/lib/asserts
@@ -2,10 +2,40 @@
set -o xtrace
+source /var/onap/commons
+
# asserts_image() - Function that verifies if a specific image was created
function asserts_image {
- if [[ "$(docker images -q $1 2> /dev/null)" == "" ]]; then
- echo "There is no $1 image"
- exit 1
+ local image=$1
+ local error_msg=${2:-"There is no $image image"}
+
+ if [[ "$(docker images -q $image 2> /dev/null)" == "" ]]; then
+ raise_error $error_msg
+ fi
+}
+
+# asserts_installed_package() - Function that verifies if a specific package was installed.
+function asserts_installed_package {
+ local package=$1
+ local error_msg=${2:-"$package wasn't installed"}
+
+ if ! is_package_installed $package; then
+ raise_error $error_msg
fi
}
+
+# asserts_file_exist() - Function that verifies if a specific file exists
+function asserts_file_exist {
+ local file=$1
+ local error_msg=${2:-"$file doesn't exist"}
+
+ if [ ! -f $file ]; then
+ raise_error $error_msg
+ fi
+}
+
+# raise_error() - Function that prints and exits the execution
+function raise_error {
+ echo $@
+ exit 1
+}
diff --git a/bootstrap/vagrant-onap/lib/commons b/bootstrap/vagrant-onap/lib/commons
index 783dc0b36..019eeb5c2 100755
--- a/bootstrap/vagrant-onap/lib/commons
+++ b/bootstrap/vagrant-onap/lib/commons
@@ -7,7 +7,20 @@ function update_repos {
if [ -f /var/onap/files/sources.list ]; then
cp /var/onap/files/sources.list /etc/apt/sources.list
fi
- apt-get update -y
+ if [ -f /var/onap/files/proxyrc ]; then
+ source /var/onap/files/proxyrc
+ cp /var/onap/files/proxyrc /etc/profile.d/proxy.sh
+
+ if [ -f /etc/apt/apt.conf ]; then
+ echo "Acquire::http::Proxy \"${http_proxy}\";" >> /etc/apt/apt.conf
+ echo "Acquire::https::Proxy \"${https_proxy}\";" >> /etc/apt/apt.conf
+ fi
+ if [ -d /etc/apt/apt.conf.d ] & [ ! -f /etc/apt/apt.conf.d/70proxy.conf ]; then
+ echo "Acquire::http::Proxy \"${http_proxy}\";" >> /etc/apt/apt.conf.d/70proxy.conf
+ echo "Acquire::https::Proxy \"${https_proxy}\";" >> /etc/apt/apt.conf.d/70proxy.conf
+ fi
+ fi
+ apt-get update -qq -y
}
# is_package_installed() - Function to tell if a package is installed
@@ -23,6 +36,6 @@ function install_package {
local package=$1
if ! is_package_installed $package; then
update_repos
- apt-get install -y $package
+ apt-get install -y -qq $package
fi
}
diff --git a/bootstrap/vagrant-onap/lib/dcae b/bootstrap/vagrant-onap/lib/dcae
index 0f6e27507..05527bc1d 100755
--- a/bootstrap/vagrant-onap/lib/dcae
+++ b/bootstrap/vagrant-onap/lib/dcae
@@ -57,16 +57,40 @@ function compile_docker_image {
popd
}
+# clone_all_dcae_repos() - Function that clones DCAE source repo.
+function clone_all_dcae_repos {
+ local src_folder=/opt/dcae
+ clone_repo dcae $src_folder
+
+ for dirc in apod apod/analytics apod/buildtools apod/buildtools collectors collectors/ves controller controller/analytics dcae-inventory \
+ demo demo/startup demo/startup/aaf demo/startup/controller demo/startup/message-router dmaapbc operation operation/utils pgaas utils utils/buildtools; do
+ clone_repo dcae/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_dcae_repos() - Function that compiles DCAE source repo.
+function compile_all_dcae_repos {
+ local src_folder=/opt/dcae
+
+ for dirc in apod apod/analytics apod/buildtools apod/buildtools collectors collectors/ves controller controller/analytics dcae-inventory \
+ demo demo/startup demo/startup/aaf demo/startup/controller demo/startup/message-router dmaapbc operation operation/utils pgaas utils utils/buildtools; do
+ compile_src $src_folder/$dirc
+ done
+}
+
+
# install_dcae() - Function that clones and installs the DCAE controller services from source code
function install_dcae {
- export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
- local src_folder=/opt/dcae-startup-vm-controller
- clone_repo dcae/demo/startup/controller $src_folder
- pushd $src_folder
install_docker_compose
+
+ clone_all_dcae_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_dcae_repos
+ fi
+
if [[ "$build_image" == "True" ]]; then
install_docker
- src_folder=/opt/dcae
+ local src_folder=/opt/dcae
compile_docker_image dcae/dmaapb $src_folder/dmaapbc openecomp/dcae-dmaapbc
compile_docker_image dcae/orch-dispatcher $src_folder/orch-dispatcher dcae/orch-dispatcher
@@ -84,16 +108,18 @@ function install_dcae {
asserts_image dcae-inventory
dcae_image=`docker images | grep dcae-controller | awk '{print $1 ":" $2}'`
+ pushd $src_folder/demo/startup/controller
sed -i "s|DOCKER-REGISTRY/openecomp/dcae-controller:DCAE-VERSION|$dcae_image|g" docker-compose.yml
sed -i "s|MTU|$MTU|g" docker-compose.yml
/opt/docker/docker-compose up -d
+ popd
else
+ pushd /opt/dcae/demo/startup/controller
bash init.sh
install_package make
make up
+ popd
fi
-
- popd
}
# init_dcae() - Function that initialize DCAE Controller services
diff --git a/bootstrap/vagrant-onap/lib/files/settings.template b/bootstrap/vagrant-onap/lib/files/settings.template
new file mode 100644
index 000000000..3b974c949
--- /dev/null
+++ b/bootstrap/vagrant-onap/lib/files/settings.template
@@ -0,0 +1,281 @@
+<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
+
+ <!-- offline
+ | Determines whether maven should attempt to connect to the network when executing a build.
+ | This will have an effect on artifact downloads, artifact deployment, and others.
+ |
+ | Default: false
+ <offline>false</offline>
+ -->
+ <!-- proxies
+ | This is a list of proxies which can be used on this machine to connect to the network.
+ | Unless otherwise specified (by system property or command-line switch), the first proxy
+ | specification in this list marked as active will be used.
+ |-->
+%PROXIES_START% <proxies>
+%PROXIES% %HTTP_PROXY%
+%PROXIES% %HTTPS_PROXY%
+%PROXIES_END% </proxies>
+ <!-- mirrors
+ | This is a list of mirrors to be used in downloading artifacts from remote repositories.
+ |
+ | It works like this: a POM may declare a repository to use in resolving certain artifacts.
+ | However, this repository may have problems with heavy traffic at times, so people have mirrored
+ | it to several places.
+ |
+ | That repository definition will have a unique id, so we can create a mirror reference for that
+ | repository, to be used as an alternate download site. The mirror site will be the preferred
+ | server for that repository.
+ |-->
+
+ <!-- profiles
+ | This is a list of profiles which can be activated in a variety of ways, and which can modify
+ | the build process. Profiles provided in the settings.xml are intended to provide local machine-
+ | specific paths and repository locations which allow the build to work in the local environment.
+ |
+ | For example, if you have an integration testing plugin - like cactus - that needs to know where
+ | your Tomcat instance is installed, you can provide a variable here such that the variable is
+ | dereferenced during the build process to configure the cactus plugin.
+ |
+ | As noted above, profiles can be activated in a variety of ways. One way - the activeProfiles
+ | section of this document (settings.xml) - will be discussed later. Another way essentially
+ | relies on the detection of a system property, either matching a particular value for the property,
+ | or merely testing its existence. Profiles can also be activated by JDK version prefix, where a
+ | value of '1.4' might activate a profile when the build is executed on a JDK version of '1.4.2_07'.
+ | Finally, the list of active profiles can be specified directly from the command line.
+ |
+ | NOTE: For profiles defined in the settings.xml, you are restricted to specifying only artifact
+ | repositories, plugin repositories, and free-form properties to be used as configuration
+ | variables for plugins in the POM.
+ |
+ |-->
+
+
+
+
+
+ <profiles>
+ <profile>
+
+ <id>10_nexus</id>
+ <!--Enable snapshots for the built in central repo to direct -->
+ <!--all requests to nexus via the mirror -->
+ <repositories>
+ <repository>
+ <id>10_nexus</id>
+ <url>http://repo.maven.apache.org/maven2/</url>
+ <releases><enabled>true</enabled></releases>
+ <snapshots><enabled>true</enabled></snapshots>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>10_nexus</id>
+ <url>http://repo.maven.apache.org/maven2/</url>
+ <releases><enabled>true</enabled></releases>
+ <snapshots><enabled>true</enabled></snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+
+ </profile>
+ <profile>
+ <id>20_openecomp-public</id>
+ <repositories>
+ <repository>
+ <id>20_openecomp-public</id>
+ <name>20_openecomp-public</name>
+ <url>https://nexus.onap.org/content/repositories/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>20_openecomp-public</id>
+ <name>20_openecomp-public</name>
+ <url>https://nexus.onap.org/content/repositories/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ <profile>
+ <id>30_openecomp-staging</id>
+ <repositories>
+ <repository>
+ <id>30_openecomp-staging</id>
+ <name>30_openecomp-staging</name>
+ <url>https://nexus.onap.org/content/repositories/staging/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>30_openecomp-staging</id>
+ <name>30_openecomp-staging</name>
+ <url>https://nexus.onap.org/content/repositories/staging/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ <profile>
+ <id>40_openecomp-release</id>
+ <repositories>
+ <repository>
+ <id>40_openecomp-release</id>
+ <name>40_openecomp-release</name>
+ <url>https://nexus.onap.org/content/repositories/releases/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>40_openecomp-release</id>
+ <name>40_openecomp-release</name>
+ <url>https://nexus.onap.org/content/repositories/releases/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+
+ <profile>
+ <id>50_openecomp-snapshots</id>
+ <repositories>
+ <repository>
+ <id>50_openecomp-snapshot</id>
+ <name>50_openecomp-snapshot</name>
+ <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>50_openecomp-snapshot</id>
+ <name>50_openecomp-snapshot</name>
+ <url>https://nexus.onap.org/content/repositories/snapshots/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ <profile>
+ <id>60_opendaylight-release</id>
+ <repositories>
+ <repository>
+ <id>60_opendaylight-mirror</id>
+ <name>60_opendaylight-mirror</name>
+ <url>https://nexus.opendaylight.org/content/repositories/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>60_opendaylight-mirror</id>
+ <name>60_opendaylight-mirror</name>
+ <url>https://nexus.opendaylight.org/content/repositories/public/</url>
+ <releases>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+
+ <profile>
+ <id>70_opendaylight-snapshots</id>
+ <repositories>
+ <repository>
+ <id>70_opendaylight-snapshot</id>
+ <name>70_opendaylight-snapshot</name>
+ <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>70_opendaylight-snapshot</id>
+ <name>70_opendaylight-snapshot</name>
+ <url>https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
+ </profile>
+ </profiles>
+
+ <activeProfiles>
+ <activeProfile>10_nexus</activeProfile>
+ <activeProfile>20_openecomp-public</activeProfile>
+ <activeProfile>30_openecomp-staging</activeProfile>
+ <activeProfile>40_openecomp-release</activeProfile>
+ <activeProfile>50_openecomp-snapshots</activeProfile>
+ <activeProfile>60_opendaylight-release</activeProfile>
+ <activeProfile>70_opendaylight-snapshots</activeProfile>
+
+ </activeProfiles>
+
+</settings>
diff --git a/bootstrap/vagrant-onap/lib/functions b/bootstrap/vagrant-onap/lib/functions
index fddd49a2a..b0c6e978d 100755
--- a/bootstrap/vagrant-onap/lib/functions
+++ b/bootstrap/vagrant-onap/lib/functions
@@ -3,6 +3,16 @@
set -o xtrace
source /var/onap/commons
+source /var/onap/_composed_functions
+source /var/onap/_onap_functions
+
+mvn_conf_file=/root/.m2/settings.xml
+git_src_folder=/opt
+
+# export_env_vars() - Export environment variables
+function export_env_vars {
+ export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' |sort -n | head -1)
+}
# configure_dns() - DNS/GW IP address configuration
function configure_dns {
@@ -10,35 +20,11 @@ function configure_dns {
resolvconf -u
}
-# create_configuration_files() - Store credentials in files
-function create_configuration_files {
- mkdir -p /opt/config
- echo $nexus_docker_repo > /opt/config/nexus_docker_repo.txt
- echo $nexus_username > /opt/config/nexus_username.txt
- echo $nexus_password > /opt/config/nexus_password.txt
- echo $openstack_username > /opt/config/openstack_username.txt
- echo $openstack_tenant_id > /opt/config/tenant_id.txt
- echo $dmaap_topic > /opt/config/dmaap_topic.txt
- echo $docker_version > /opt/config/docker_version.txt
-}
-
-# pull_openecomp_image() - Pull Docker container image from a Docker Registry Hub
-function pull_openecomp_image {
- install_docker
- local image=$1
- local tag=$2
- docker login -u $nexus_username -p $nexus_password $nexus_docker_repo
- docker pull $nexus_docker_repo/openecomp/${image}:$docker_version
- if [ ${tag} ]; then
- docker tag $nexus_docker_repo/openecomp/${image}:$docker_version $tag
- fi
-}
-
-# git_timed() - git can sometimes get itself infinitely stuck with transient network
+# _git_timed() - git can sometimes get itself infinitely stuck with transient network
# errors or other issues with the remote end. This wraps git in a
# timeout/retry loop and is intended to watch over non-local git
# processes that might hang.
-function git_timed {
+function _git_timed {
local count=0
local timeout=0
@@ -62,12 +48,12 @@ function git_timed {
function clone_repo {
local repo_url=https://git.onap.org/
local repo=$1
- local dest_folder=$2
- if [ ! -d $2 ]; then
- git_timed clone -b $gerrit_branch --single-branch ${repo_url}${repo} $dest_folder
+ local dest_folder=${2:-$git_src_folder/$repo}
+ if [ ! -d $dest_folder ]; then
+ _git_timed clone -b $gerrit_branch --single-branch ${repo_url}${repo} $dest_folder
else
pushd $dest_folder
- git_timed pull
+ _git_timed pull
popd
fi
}
@@ -79,26 +65,12 @@ function install_dev_tools {
install_package curl
}
-# install_bind() - Install bind utils
-function install_bind {
+# _install_bind() - Install bind utils
+function _install_bind {
install_package bind9
install_package bind9utils
}
-# configure_bind()- Configure bind utils
-function configure_bind {
- install_bind
- mkdir /etc/bind/zones
-
- curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/db_simpledemo_openecomp_org -o /etc/bind/zones/db.simpledemo.openecomp.org
- curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/named.conf.options -o /etc/bind/named.conf.options
- curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/named.conf.local -o /etc/bind/named.conf.local
-
- modprobe ip_gre
- sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
- service bind9 restart
-}
-
# install_java() - Install java binaries
function install_java {
install_package software-properties-common
@@ -108,7 +80,7 @@ function install_java {
# install_maven() - Install maven binaries
function install_maven {
- if is_package_installed maven; then
+ if is_package_installed maven3; then
return
fi
if ! is_package_installed openjdk-8-jdk; then
@@ -120,10 +92,12 @@ function install_maven {
# Force Maven3 to use jdk8
apt-get purge openjdk-7-jdk -y
+
+ _configure_maven
}
-# configure_docker_proxy() - Configures proxy in Docker from ENV
-function configure_docker_proxy {
+# _configure_docker_proxy() - Configures proxy in Docker from ENV
+function _configure_docker_proxy {
if [ $http_proxy ]; then
echo "export http_proxy=$http_proxy" >> /etc/default/docker
fi
@@ -132,41 +106,24 @@ function configure_docker_proxy {
fi
}
-# build_docker_image() - Build Docker container image from source code
-function build_docker_image {
- local src_folder=$1
- local profile=$2
- install_maven
- install_docker
- pushd $src_folder
-
- # Cleanup external repo
- sed -i 's|${docker.push.registry}/||g' pom.xml
- local mvn_docker="mvn clean package docker:build"
- if [ $profile ]; then
- mvn_docker+=" -P $profile"
- fi
- if [ $http_proxy ]; then
- mvn_docker+=" -Ddocker.buildArg.http_proxy=$http_proxy"
- mvn_docker+=" -Ddocker.buildArg.HTTP_PROXY=$http_proxy"
- fi
- if [ $https_proxy ]; then
- mvn_docker+=" -Ddocker.buildArg.https_proxy=$https_proxy"
- mvn_docker+=" -Ddocker.buildArg.HTTPS_PROXY=$https_proxy"
+# install_nodejs() - Download and install NodeJS
+function install_nodejs {
+ if is_package_installed nodejs; then
+ return
fi
- eval $mvn_docker
- popd
+ curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
+ install_package nodejs
+
+ # Update NPM to latest version
+ npm install npm -g
}
-# compile_src() - Function that compiles the java source code thru maven
-function compile_src {
- local src_folder=$1
- pushd $src_folder
- if [ -f pom.xml ]; then
- install_maven
- mvn clean install -DskipTests=true -Dmaven.test.skip=true -Dadditionalparam=-Xdoclint:none
- fi
- popd
+# install_python() - Install Python 2.7 and other tools necessary for development.
+function install_python {
+ install_package python2.7
+ install_package python-dev
+ curl -sL https://bootstrap.pypa.io/get-pip.py | python
+ pip install tox
}
# install_docker() - Download and install docker-engine
@@ -181,8 +138,20 @@ function install_docker {
$(lsb_release -cs) \
stable"
install_package docker-ce
- configure_docker_proxy
+ _configure_docker_proxy
service docker restart
+ sleep 10
+}
+
+# pull_docker_image() - Pull Docker container image from the Public Docker Registry Hub
+function pull_docker_image {
+ install_docker
+ local image=$1
+ local tag=$2
+ docker pull ${image}
+ if [ ${tag} ]; then
+ docker tag ${image} $tag
+ fi
}
# install_docker_compose() - Download and install docker-engine
@@ -195,10 +164,69 @@ function install_docker_compose {
fi
}
-# configure_service() - Download and configure a specific service in upstart
-function configure_service {
- local service_script=$1
- curl -k $nexus_repo/org.openecomp.demo/boot/$artifacts_version/$service_script -o /etc/init.d/$service_script
- chmod +x /etc/init.d/$service_script
- update-rc.d $service_script defaults
+# _install_ODL() - Download and Install OpenDayLight SDN controller
+function _install_ODL {
+ if [ ! -d /opt/opendaylight/current ]; then
+ mkdir -p /opt/opendaylight/
+ wget "https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/"$odl_version"/distribution-karaf-"$odl_version".tar.gz" -P /opt/
+ tar xvf "/opt/distribution-karaf-"$odl_version".tar.gz" -C /opt/
+ mv "/opt/distribution-karaf-"$odl_version /opt/opendaylight/current
+ rm -rf "/opt/distribution-karaf-"$odl_version".tar.gz"
+ fi
+}
+
+# start_ODL() - Start OpenDayLight SDN controller
+function start_ODL {
+ _install_ODL
+ if [ -d /opt/opendaylight ]; then
+ export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
+ /opt/opendaylight/current/bin/start
+ sleep 180
+ /opt/opendaylight/current/bin/client feature:install odl-dlux-all
+ fi
+}
+
+# compile_src() - Function that compiles the java source code thru maven
+function compile_src {
+ local src_folder=$1
+ pushd $src_folder
+ if [ -f pom.xml ]; then
+ install_maven
+ mvn clean install -U -DskipTests=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dadditionalparam=-Xdoclint:none
+ fi
+ popd
+}
+
+# build_docker_image() - Build Docker container image from source code
+function build_docker_image {
+ local src_folder=$1
+ local profile=$2
+ install_maven
+ install_docker
+ pushd $src_folder
+
+ # Cleanup external repo
+ sed -i 's|${docker.push.registry}/||g' pom.xml
+ local mvn_docker="mvn clean package docker:build"
+ if [ $profile ]; then
+ mvn_docker+=" -P $profile"
+ fi
+ if [ $http_proxy ]; then
+ if ! grep -ql "docker.buildArg.http_proxy" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.http_proxy=$http_proxy"
+ fi
+ if ! grep -ql "docker.buildArg.HTTP_PROXY" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.HTTP_PROXY=$http_proxy"
+ fi
+ fi
+ if [ $https_proxy ]; then
+ if ! grep -ql "docker.buildArg.https_proxy" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.https_proxy=$https_proxy"
+ fi
+ if ! grep -ql "docker.buildArg.HTTPS_PROXY" pom.xml ; then
+ mvn_docker+=" -Ddocker.buildArg.HTTPS_PROXY=$https_proxy"
+ fi
+ fi
+ eval $mvn_docker
+ popd
}
diff --git a/bootstrap/vagrant-onap/lib/mr b/bootstrap/vagrant-onap/lib/mr
index 8b92bc9c8..869994d2d 100755
--- a/bootstrap/vagrant-onap/lib/mr
+++ b/bootstrap/vagrant-onap/lib/mr
@@ -2,17 +2,24 @@
set -o xtrace
+source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=$git_src_folder/dcae/message-router
+
# install_message_router() - Downloads and configure message router source code
-function install_message_router {
- local src_folder=/opt/dcae/message-router
+function _install_message_router {
clone_repo dcae/demo/startup/message-router $src_folder
pushd $src_folder
- is_package_installed docker-ce || install_docker
+ pull_docker_image attos/dmaap
+ pull_docker_image wurstmeister/zookeeper
+ install_docker_compose
bash deploy.sh
+ asserts_image dockerfiles_kafka
popd
}
# init_mr() - Function that initialize Message Router services
function init_mr {
- install_message_router
+ _install_message_router
}
diff --git a/bootstrap/vagrant-onap/lib/mso b/bootstrap/vagrant-onap/lib/mso
index 0cffbf0d4..b8d432622 100755
--- a/bootstrap/vagrant-onap/lib/mso
+++ b/bootstrap/vagrant-onap/lib/mso
@@ -3,21 +3,43 @@
set -o xtrace
source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=$git_src_folder/mso
+mso_repos=("chef-repo" "docker-config" "libs" "mso-config")
+
+# clone_all_mso_repos() - Function that clones MSO source repo.
+function clone_all_mso_repos {
+ clone_repo mso $src_folder
+
+ for dirc in ${mso_repos[@]}; do
+ clone_repo mso/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_mso_repos() - Function that compiles MSO source repo.
+function compile_all_mso_repos {
+ compile_src $src_folder
+
+ for dirc in ${mso_repos[@]}; do
+ compile_src $src_folder/$dirc
+ done
+}
# install_mso() - Installation of mso images
function install_mso {
- local src_folder=/opt/mso
if [[ "$build_image" == "True" ]]; then
- clone_repo mso $src_folder
export GIT_NO_PROJECT=/opt/
- build_docker_image $src_folder/packages/docker
+ compile_src $src_folder
+ build_docker_image $src_folder/packages/docker docker
+ for image in mso mso-arquillian wildfly ubuntu-update jacoco; do
+ asserts_image openecomp/$image
+ done
fi
}
# install_mso_docker_config() - Download and install MSO Docker configuration project
function install_mso_docker_config {
- local src_folder=/opt/mso/docker-config
- clone_repo mso/docker-config $src_folder
MSO_ENCRYPTION_KEY=$(cat /opt/mso/docker-config/encryption.key)
echo -n "$openstack_api_key" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
@@ -67,18 +89,27 @@ EOF
export MSO_CONFIG_UPDATES
export MSO_DOCKER_IMAGE_VERSION=$docker_version
- # Deploy the environment
- pushd $src_folder
- chmod +x deploy.sh
is_package_installed docker-ce || install_docker
install_docker_compose
- # This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb)
- ./deploy.sh $nexus_docker_repo $nexus_username $nexus_password $nexus_docker_repo $nexus_username $nexus_password
+ # Deploy the environment
+ pushd $src_folder/docker-config
+ chmod +x deploy.sh
+ if [[ "$build_image" == "True" ]]; then
+ bash deploy.sh
+ else
+ # This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb)
+ bash deploy.sh $nexus_docker_repo $nexus_username $nexus_password $nexus_docker_repo $nexus_username $nexus_password
+ fi
popd
}
# init_mso() - Function that initialize MSO services
function init_mso {
+ clone_all_mso_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_mso_repos
+ fi
+
install_mso
install_mso_docker_config
}
diff --git a/bootstrap/vagrant-onap/lib/policy b/bootstrap/vagrant-onap/lib/policy
index 270022d94..71854048e 100755
--- a/bootstrap/vagrant-onap/lib/policy
+++ b/bootstrap/vagrant-onap/lib/policy
@@ -2,11 +2,52 @@
set -o xtrace
+source /var/onap/functions
+source /var/onap/asserts
+
+# clone_all_policy_repos() - Function that clones Policy source repo.
+function clone_all_policy_repos {
+ local src_folder=/opt/policy
+
+ for dirc in api common docker drools-applications drools-pdp engine gui pap pdp; do
+ clone_repo policy/$dirc $src_folder/$dirc
+ done
+}
+
+# # compile_all_policy_repos() - Function that compiles Policy source repo.
+function compile_all_policy_repos {
+ local src_folder=/opt/policy
+
+ for dirc in api common docker drools-applications drools-pdp engine gui pap pdp; do
+ compile_src $src_folder/$dirc
+ done
+}
+
# install_policy() - Function that clones and installs the Policy services from source code
function install_policy {
local src_folder=/opt/policy
- clone_repo policy/docker $src_folder
- pushd $src_folder
+
+ clone_all_policy_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_policy_repos
+ fi
+
+ if [[ "$build_image" == "True" ]]; then
+ compile_src $src_folder/docker
+ install_docker
+ pushd $src_folder/docker
+ bash docker_verify.sh
+ for image in os nexus db base drools pe; do
+ asserts_image onap/policy/policy-$image
+ done
+ popd
+ else
+ pull_onap_image policy/policy-db onap/policy/policy-db:latest
+ pull_onap_image policy/policy-pe onap/policy/policy-pe:latest
+ pull_onap_image policy/policy-drools onap/policy/policy-drools:latest
+ pull_onap_image policy/policy-nexus onap/policy/policy-nexus:latest
+ fi
+ pushd $src_folder/docker
chmod +x config/drools/drools-tweaks.sh
IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
echo $IP_ADDRESS > config/pe/ip_addr.txt
@@ -17,9 +58,5 @@ function install_policy {
# init_policy() - Function that initialize Policy services
function init_policy {
- pull_onap_image policy/policy-db onap/policy/policy-db:latest
- pull_onap_image policy/policy-pe onap/policy/policy-pe:latest
- pull_onap_image policy/policy-drools onap/policy/policy-drools:latest
- pull_onap_image policy/policy-nexus onap/policy/policy-nexus:latest
install_policy
}
diff --git a/bootstrap/vagrant-onap/lib/portal b/bootstrap/vagrant-onap/lib/portal
index bd9559313..6c8e7d0a9 100755
--- a/bootstrap/vagrant-onap/lib/portal
+++ b/bootstrap/vagrant-onap/lib/portal
@@ -3,6 +3,7 @@
set -o xtrace
source /var/onap/functions
+source /var/onap/asserts
# install_mariadb() - Pull and create a MariaDB container
function install_mariadb {
@@ -15,42 +16,51 @@ function install_mariadb {
function install_portal {
local src_folder=/opt/portal
clone_repo portal $src_folder
+ clone_repo portal/sdk $src_folder/sdk
install_docker
docker rm -f ecompdb_portal
docker rm -f 1610-1
+ pushd $src_folder/deliveries
if [[ "$build_image" == "True" ]]; then
- # Build locally
install_maven
clone_repo ecompsdkos $src_folder/ecompsdkos
clone_repo "ui/dmaapbc" $src_folder/dmaapbc
- pushd $src_folder/deliveries
chmod +x *.sh
+ export MVN=$(which mvn)
+ export GLOBAL_SETTINGS_FILE=/usr/share/maven3/conf/settings.xml
+ export SETTINGS_FILE=$HOME/.m2/settings.xml
bash run.sh
- popd
+ compile_src $src_folder/ecomp-portal-widget-ms
+ build_docker_image $src_folder/ecomp-portal-widget-ms
else
pull_openecomp_image portaldb ecompdb:portal
pull_openecomp_image portalapps ep:1610-1
- chmod +x $src_folder/deliveries/new_start.sh
- chmod +x $src_folder/deliveries/new_stop.sh
- chmod +x $src_folder/deliveries/dbstart.sh
- mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
- install_package unzip
- unzip -o $src_folder/deliveries/etc.zip -d /PROJECT/OpenSource/UbuntuEP/
+ fi
+ for image in ecompdb:portal ep:1610-1; do
+ asserts_image $image
+ done
+
+ chmod +x new_start.sh
+ chmod +x new_stop.sh
+ chmod +x dbstart.sh
+ mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
+ install_package unzip
+ unzip -o etc.zip -d /PROJECT/OpenSource/UbuntuEP/
- bash $src_folder/deliveries/dbstart.sh
- bash $src_folder/deliveries/new_start.sh
+ bash dbstart.sh
+ bash new_start.sh
- sleep 180
+ sleep 180
- if [ ! -e /opt/config/boot.txt ]; then
- IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
- install_package mysql-client
- mysql -u root -p'Aa123456' -h $IP_ADDRESS < $src_folder/deliveries/Apps_Users_OnBoarding_Script.sql
- echo "yes" > /opt/config/boot.txt
- fi
+ if [ ! -e /opt/config/boot.txt ]; then
+ IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
+ install_package mysql-client
+ mysql -u root -p'Aa123456' -h $IP_ADDRESS < Apps_Users_OnBoarding_Script.sql
+ echo "yes" > /opt/config/boot.txt
fi
+ popd
}
# init_portal() - Function that initialize Portal services
diff --git a/bootstrap/vagrant-onap/lib/robot b/bootstrap/vagrant-onap/lib/robot
index 75a361f4d..4102680ef 100755
--- a/bootstrap/vagrant-onap/lib/robot
+++ b/bootstrap/vagrant-onap/lib/robot
@@ -6,7 +6,7 @@ set -o xtrace
function install_testsuite_properties {
mkdir -p /opt/eteshare/config
- local $src_folder=/opt/testsuite/properties
+ local src_folder=/opt/testsuite/properties
clone_repo testsuite/properties $src_folder
cp $src_folder/integration_* /opt/eteshare/config
cp $src_folder/vm_config2robot.sh /opt/eteshare/config
diff --git a/bootstrap/vagrant-onap/lib/sdc b/bootstrap/vagrant-onap/lib/sdc
index 15787b064..626d9d731 100755
--- a/bootstrap/vagrant-onap/lib/sdc
+++ b/bootstrap/vagrant-onap/lib/sdc
@@ -2,6 +2,11 @@
set -o xtrace
+source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=$git_src_folder/sdc
+
# mount_external_partition() - Create partition and mount the external volume
function mount_external_partition {
cat <<EOL > /tmp/asdc_ext_volume_partitions.txt
@@ -41,6 +46,25 @@ alias health='/data/scripts/docker_health.sh'
EOL
}
+# clone_all_sdc_repos() - Function that clones SDC source repo.
+function clone_all_sdc_repos {
+ clone_repo sdc $src_folder
+
+ for dirc in sdc-os-chef jtosca sdc-distribution-client sdc-titan-cassandra sdc-tosca sdc_common ; do
+ clone_repo sdc/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_sdc_repos() - Function that compiles SDC source repo.
+function compile_all_sdc_repos {
+ local src_folder=/opt/sdc
+ clone_repo sdc $src_folder
+
+ for dirc in jtosca sdc-distribution-client sdc-titan-cassandra sdc-tosca sdc_common ; do
+ compile_src $src_folder/$dirc
+ done
+}
+
# install_sdc() - Function that pull templates and executes
function install_sdc {
IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2)
@@ -48,11 +72,18 @@ function install_sdc {
local MR_IP_ADDR='10.0.11.1'
local RELEASE=$docker_version
NEXUS_DOCKER_PORT=$(echo $nexus_docker_repo | cut -d':' -f2)
- local src_folder=/opt/sdc
- clone_repo sdc $src_folder
+
+ clone_all_sdc_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_sdc_repos
+ fi
+
if [[ "$build_image" == "True" ]]; then
compile_src $src_folder
- build_docker_image $src_folder/sdc-os-chef
+ build_docker_image $src_folder/sdc-os-chef docker
+ for image in backend frontend elasticsearch kibana cassandra sanity; do
+ asserts_image openecomp/sdc-$image
+ done
fi
cp $src_folder/sdc-os-chef/environments/Template.json /data/environments
cp $src_folder/sdc-os-chef/scripts/docker_run.sh /data/scripts
@@ -65,8 +96,7 @@ function install_sdc {
sed -i "s/\"ueb_url_list\":.*/\"ueb_url_list\": \""$MR_IP_ADDR","$MR_IP_ADDR"\",/g" /data/environments/$ENV_NAME.json
sed -i "s/\"fqdn\":.*/\"fqdn\": [\""$MR_IP_ADDR"\", \""$MR_IP_ADDR"\"]/g" /data/environments/$ENV_NAME.json
- is_package_installed docker-ce || install_docker
- docker login -u $nexus_username -p $nexus_password $nexus_docker_repo
+ docker_openecomp_login
bash /data/scripts/docker_run.sh -e $ENV_NAME -r $RELEASE -p $NEXUS_DOCKER_PORT
}
diff --git a/bootstrap/vagrant-onap/lib/sdnc b/bootstrap/vagrant-onap/lib/sdnc
index b3c64f90e..6765f1444 100755
--- a/bootstrap/vagrant-onap/lib/sdnc
+++ b/bootstrap/vagrant-onap/lib/sdnc
@@ -2,31 +2,67 @@
set -o xtrace
-# build_sdnc_images() - Builds SDNC images from source code
-function build_sdnc_images {
- local src_folder=/opt/sdnc/oam
- clone_repo sdnc/oam $src_folder
- build_docker_image $src_folder/installation/ubuntu
+source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=$git_src_folder/openecomp/sdnc
+sdnc_repos=("core" "adaptors" "northbound" "plugins" "oam")
+
+# clone_all_sdnc_repos() - Function that clones SDNC source repo.
+function clone_all_sdnc_repos {
+ for dirc in ${sdnc_repos[@]}; do
+ clone_repo sdnc/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_sdnc_repos() - Function that compiles SDNC source repo.
+function compile_all_sdnc_repos {
+ for dirc in ${sdnc_repos[@]}; do
+ if [[ "$dirc" == "core" ]]; then
+ compile_src $src_folder/core/rootpom
+ fi
+ compile_src $src_folder/$dirc
+ done
+}
+
+# _build_sdnc_images() - Builds SDNC images from source code
+function _build_sdnc_images {
+ local folder=$1
+
+ build_docker_image $folder/installation/ubuntu
+ asserts_image openecomp/ubuntu-sdnc-image
+
/var/lib/dpkg/info/ca-certificates-java.postinst configure
- build_docker_image $src_folder/installation/sdnc
- build_docker_image $src_folder/installation/admportal
- build_docker_image $src_folder/installation/dgbuilder
+ build_docker_image $folder/installation/sdnc
+ asserts_image openecomp/sdnc-image
+
+ build_docker_image $folder/installation/admportal
+ asserts_image openecomp/admportal-sdnc-image
+
+ build_docker_image $folder/installation/dgbuilder
+ asserts_image openecomp/dgbuilder-sdnc-image
}
-# install_sdnc() - Download and install SDNC services from source code
-function install_sdnc {
- install_package unzip
- local src_folder=/opt/sdnc/oam
- export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
- clone_repo sdnc/oam $src_folder
+# get_sdnc_images() - Build or retrieve necessary images
+function get_sdnc_images {
if [[ "$build_image" == "True" ]]; then
- build_sdnc_images
+ # The OAM code depends on all the SDNC repos which should be downloaded and compiled first
+ if [[ "$compile_repo" == "False" ]]; then
+ compile_all_sdnc_repos
+ fi
+ _build_sdnc_images $src_folder/oam
else
pull_openecomp_image sdnc-image openecomp/sdnc-image:latest
pull_openecomp_image admportal-sdnc-image openecomp/admportal-sdnc-image:latest
pull_openecomp_image dgbuilder-sdnc-image openecomp/dgbuilder-sdnc-image:latest
fi
- pushd $src_folder/installation/src/main/yaml
+}
+
+# install_sdnc() - Download and install SDNC services from source code
+function install_sdnc {
+ install_package unzip
+ clone_repo sdnc/oam $src_folder/oam
+ pushd $src_folder/oam/installation/src/main/yaml
install_docker_compose
/opt/docker/docker-compose up -d
popd
@@ -34,5 +70,11 @@ function install_sdnc {
# init_sdnc() - Function that initialize SDNC services
function init_sdnc {
+ start_ODL
+ clone_all_sdnc_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_sdnc_repos
+ fi
+ get_sdnc_images
install_sdnc
}
diff --git a/bootstrap/vagrant-onap/lib/vfc b/bootstrap/vagrant-onap/lib/vfc
new file mode 100755
index 000000000..44e433d35
--- /dev/null
+++ b/bootstrap/vagrant-onap/lib/vfc
@@ -0,0 +1,58 @@
+#!/bin/bash
+
+set -o xtrace
+
+source /var/onap/functions
+rc_folder=$git_src_folder/vfc
+
+vfc_repos=("gvnfm/vnflcm" "gvnfm/vnfmgr" "gvnfm/vnfres" "nfvo/catalog" "nfvo/driver/ems" "nfvo/driver/sfc" \
+ "nfvo/driver/vnfm/gvnfm" "nfvo/driver/vnfm/svnfm" "nfvo/lcm" "nfvo/resmanagement" "nfvo/wfengine")
+
+# clone_all_vfc_repos() - Function that clones VF-C source repo.
+function clone_all_vfc_repos {
+ for dirc in ${vfc_repos[@]}; do
+ clone_repo vfc/$dirc $src_folder/$dirc
+ done
+}
+
+# compile_all_vfc_repos() - Function that compiles VF-C source repo.
+function compile_all_vfc_repos {
+ pushd $src_folder/gvnfm/vnflcm/lcm
+ tox -e py27
+ popd
+
+ # TODO(sshank): Add compile for other vfc_repos. (Both Java and Python based.)
+ # Python based:
+ # gvnfm/vnflcm/lcm
+ # gvnfm/vnfmgr/mgr
+ # gvnfm/vnfres/res
+ # nfvo/driver/vnfm/gvnfm/gvnfmadapter
+ # nfvo/driver/vnfm/svnfm/zte/vmanager
+ # nfvo/lcm
+
+ # Java based:
+ # nfvo/catalog
+ # nfvo/driver/ems/ems/sems/boco/ems-driver
+ # nfvo/driver/sfc/zte/sfc-driver
+ # nfvo/driver/vnfm/gvnfm/juju/juju-vnfmadapter
+ # nfvo/driver/vnfm/svnfm/huawei/vnfmadapter
+ # nfvo/resmanagement
+ # nfvo/wfengine
+}
+
+# install_vfc() - Download and install vfc service from source code
+function install_vfc {
+ clone_all_vfc_repos
+ if [[ "$compile_repo" == "False" ]]; then
+ compile_all_vfc_repos
+ fi
+
+ # TODO(sshank): Add further installation steps if necessary.
+}
+
+# init_vfc() - Function that initialize VF-C services
+function init_vfc {
+ install_python
+ install_package libmysqlclient-dev
+ install_vfc
+}
diff --git a/bootstrap/vagrant-onap/lib/vid b/bootstrap/vagrant-onap/lib/vid
index 25d2c68f6..902c45540 100755
--- a/bootstrap/vagrant-onap/lib/vid
+++ b/bootstrap/vagrant-onap/lib/vid
@@ -2,25 +2,54 @@
set -o xtrace
+source /var/onap/functions
+source /var/onap/asserts
+
+src_folder=/opt/vid
+
# pull_mariadb_image() - Pull MariaDB container image from a Docker Registry Hub
function pull_mariadb_image {
- is_package_installed docker-ce || install_docker
- docker login -u $nexus_username -p $nexus_password $nexus_docker_repo
+ docker_openecomp_login
docker pull $nexus_docker_repo/library/mariadb:10
}
+# clone_all_vid_repos() - Function that clones VID source code.
+function clone_all_vid_repos {
+ clone_repo vid $src_folder
+ clone_repo vid/asdcclient $src_folder/asdcclient
+}
+
+# compile_all_vid_repos() - Function that compiles VID source repo.
+function compile_all_vid_repos {
+ compile_src $src_folder
+ compile_src $src_folder/asdcclient
+}
+
# install_vid() - Download and configure Vid source code
function install_vid {
- local src_folder=/opt/vid
- clone_repo vid $src_folder
- pull_openecomp_image vid
+ local vid_image=openecomp/vid
+
+ clone_all_vid_repos
+ if [[ "$compile_repo" == "True" ]]; then
+ compile_all_vid_repos
+ fi
+
+ if [[ "$build_image" == "True" ]]; then
+ compile_src $src_folder
+ build_docker_image $src_folder/deliveries
+ asserts_image $vid_image
+ vid_image=`docker images | grep vid | grep latest| awk '{print $1 ":" $2}'`
+ else
+ pull_openecomp_image vid
+ vid_image=$nexus_docker_repo/$vid_image:$docker_version
+ fi
pull_mariadb_image
docker rm -f vid-mariadb
docker rm -f vid-server
docker run --name vid-mariadb -e MYSQL_DATABASE=vid_openecomp -e MYSQL_USER=vidadmin -e MYSQL_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U -e MYSQL_ROOT_PASSWORD=LF+tp_1WqgSY -v /opt/vid/lf_config/vid-my.cnf:/etc/mysql/my.cnf -v /opt/vid/lf_config/vid-pre-init.sql:/docker-entrypoint-initdb.d/vid-pre-init.sql -v /var/lib/mysql -d mariadb:10
- docker run -e VID_MYSQL_DBNAME=vid_openecomp -e VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U --name vid-server -p 8080:8080 --link vid-mariadb:vid-mariadb-docker-instance -d $nexus_docker_repo/openecomp/vid:$docker_version
+ docker run -e VID_MYSQL_DBNAME=vid_openecomp -e VID_MYSQL_PASS=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U --name vid-server -p 8080:8080 --link vid-mariadb:vid-mariadb-docker-instance -d $vid_image
}
# init_vid() - Function that initialize Vid services