diff options
Diffstat (limited to 'boot')
34 files changed, 600 insertions, 65 deletions
diff --git a/boot/aai_install.sh b/boot/aai_install.sh index a09849e3..9ee49d7f 100644 --- a/boot/aai_install.sh +++ b/boot/aai_install.sh @@ -49,9 +49,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/aai_vm_init.sh -o /opt/aai_vm_init.sh diff --git a/boot/appc_install.sh b/boot/appc_install.sh index 7dfbd395..b241efe7 100644 --- a/boot/appc_install.sh +++ b/boot/appc_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/appc_vm_init.sh -o /opt/appc_vm_init.sh diff --git a/boot/appc_vm_init.sh b/boot/appc_vm_init.sh index 90b09eaf..3baaf37b 100644 --- a/boot/appc_vm_init.sh +++ b/boot/appc_vm_init.sh @@ -5,6 +5,7 @@ NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) export NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) DMAAP_TOPIC=$(cat /opt/config/dmaap_topic.txt) DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) +DGBUILDER_IMAGE_VERSION=$(cat /opt/config/dgbuilder_version.txt) export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) cd /opt/appc @@ -18,7 +19,7 @@ docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO docker pull $NEXUS_DOCKER_REPO/openecomp/appc-image:$DOCKER_IMAGE_VERSION docker tag $NEXUS_DOCKER_REPO/openecomp/appc-image:$DOCKER_IMAGE_VERSION openecomp/appc-image:latest -docker pull $NEXUS_DOCKER_REPO/openecomp/dgbuilder-sdnc-image:$DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/openecomp/dgbuilder-sdnc-image:$DOCKER_IMAGE_VERSION openecomp/dgbuilder-sdnc-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$DGBUILDER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image/$DGBUILDER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:latest /opt/docker/docker-compose up -d diff --git a/boot/bind_zones b/boot/bind_zones index 83b9f873..0c8a114b 100644 --- a/boot/bind_zones +++ b/boot/bind_zones @@ -41,9 +41,9 @@ c1.vm1.dcae.simpledemo.openecomp.org. IN A dcae_ip_addr c2.vm1.dcae.simpledemo.openecomp.org. IN A dcae_ip_addr c3.vm1.dcae.simpledemo.openecomp.org IN A dcae_ip_addr -vm1.mso.simpledemo.openecomp.org. IN A mso_ip_addr -c1.vm1.mso.simpledemo.openecomp.org. IN A mso_ip_addr -c1.vm1.mso.simpledemo.openecomp.org. IN A mso_ip_addr +vm1.mso.simpledemo.openecomp.org. IN A so_ip_addr +c1.vm1.mso.simpledemo.openecomp.org. IN A so_ip_addr +c1.vm1.mso.simpledemo.openecomp.org. IN A so_ip_addr vm1.policy.simpledemo.openecomp.org. IN A policy_ip_addr c1.vm1.policy.simpledemo.openecomp.org. IN A policy_ip_addr @@ -77,6 +77,8 @@ c2.vm1.clamp.simpledemo.openecomp.org. IN A clamp_ip_addr vm1.mr.simpledemo.openecomp.org. IN A mr_ip_addr +vm1.openo.simpledemo.openecomp.org. IN A openo_ip_addr + ;CNAMES ;A&AI @@ -96,7 +98,7 @@ sdc.api.simpledemo.openecomp.org. IN CNAME vm1.sdc.simpledemo.openecomp.org. ;DCAE dcae.api.simpledemo.openecomp.org. IN CNAME vm1.dcae.simpledemo.openecomp.org. -;MSO +;SO mso.api.simpledemo.openecomp.org. IN CNAME vm1.mso.simpledemo.openecomp.org. ;Policy @@ -119,8 +121,15 @@ collector.api.simpledemo.openecomp.org. IN A dcae_coll_ip_addr ;dbc.api.simpledemo.openecomp.org. IN CNAME vm1.mr.simpledemo.openecomp.org. ;drprov.api.simpledemo.openecomp.org. IN CNAME vm1.mr.simpledemo.openecomp.org. -CLAMP +;CLAMP clamp.api.simpledemo.openecomp.org. IN CNAME vm1.clamp.simpledemo.openecomp.org. ;AAF ;aaf.api.simpledemo.openecomp.org. IN CNAME vm1.aaf.simpledemo.openecomp.org. + +;OPEN-O +msb.api.simpledemo.openecomp.org. IN CNAME vm1.openo.simpledemo.openecomp.org. +mvim.api.simpledemo.openecomp.org. IN CNAME vm1.openo.simpledemo.openecomp.org. +vnfsdk.api.simpledemo.openecomp.org. IN CNAME vm1.openo.simpledemo.openecomp.org. +vfc.api.simpledemo.openecomp.org. IN CNAME vm1.openo.simpledemo.openecomp.org. +uui.api.simpledemo.openecomp.org. IN CNAME vm1.openo.simpledemo.openecomp.org. diff --git a/boot/clamp_install.sh b/boot/clamp_install.sh index 03af2301..26e8f06f 100644 --- a/boot/clamp_install.sh +++ b/boot/clamp_install.sh @@ -5,7 +5,6 @@ NEXUS_REPO=$(cat /opt/config/nexus_repo.txt) ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt) DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.txt) -OPENSTACK_API_KEY=$(cat /opt/config/openstack_api_key.txt) GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt) MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) CODE_REPO=$(cat /opt/config/remote_repo.txt) @@ -49,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/clamp_vm_init.sh -o /opt/clamp_vm_init.sh diff --git a/boot/clamp_vm_init.sh b/boot/clamp_vm_init.sh index 997e5566..f8b26e30 100644 --- a/boot/clamp_vm_init.sh +++ b/boot/clamp_vm_init.sh @@ -3,10 +3,28 @@ NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) -DMAAP_TOPIC=$(cat /opt/config/dmaap_topic.txt) -OPENSTACK_USERNAME=$(cat /opt/config/openstack_username.txt) -OPENSTACK_APIKEY=$(cat /opt/config/api_key.txt) +DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) # Fetch the latest code/scripts cd /opt/clamp git pull + +# Remove unused folders as only extra/ folder is used for docker compose +rm -rf pom.xml +rm -rf src/ + +# No configuration change here as directly done in the CLAMP repo + +# Pull the clamp docker image from nexus +# Maria db will be pulled automatically from docker.io during docker-compose +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO + +docker pull $NEXUS_DOCKER_REPO/onap/clamp:$DOCKER_IMAGE_VERSION + +cd extra/docker/clamp/ + +# Change the Clamp docker image name in the docker-compose.yml to match the one downloaded +sed -i "/image: onap\/clamp/c\ image: $NEXUS_DOCKER_REPO\/onap\/clamp:$DOCKER_IMAGE_VERSION" docker-compose.yml + +# Start Clamp and MariaDB containers with docker compose and clamp/extra/docker/clamp/docker-compose.yml +/opt/docker/docker-compose up -d diff --git a/boot/cli_install.sh b/boot/cli_install.sh new file mode 100644 index 00000000..57f0edc6 --- /dev/null +++ b/boot/cli_install.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +#******************************************************************************* +# Copyright 2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +#******************************************************************************* + +CLI_LATEST_BINARY="https://nexus.onap.org/service/local/artifact/maven/redirect?r=snapshots&g=org.onap.cli&a=cli-zip&e=zip&v=LATEST" +CLI_INSTALL_DIR=/opt/onap/cli +CLI_ZIP=cli.zip +CLI_BIN=/usr/bin/onap +export ONAP_CLI_HOME=$CLI_INSTALL_DIR + +#create install dir +if [ -d $CLI_INSTALL_DIR ] +then + mv $CLI_INSTALL_DIR $CLI_INSTALL_DIR/../cli_`date +"%m-%d-%y-%H-%M-%S"` + rm $CLI_BIN +fi + +mkdir -p $CLI_INSTALL_DIR +cd $CLI_INSTALL_DIR + +#Download and unzip CLI +apt-get install -y wget unzip openjdk-8-jre +wget -O $CLI_ZIP $CLI_LATEST_BINARY + +unzip $CLI_ZIP +if [ ! -d ./data ]; then mkdir ./data; fi +if [ ! -d ./onap-cli-schema ]; then mkdir ./onap-cli-schema; fi +chmod +x ./bin/onap.sh + +#Make onap available in path +ln ./bin/onap.sh $CLI_BIN + +#Print the version +onap -v + +cd - diff --git a/boot/db_simpledemo_openecomp_org b/boot/db_simpledemo_openecomp_org index 65c8265f..942be995 100644 --- a/boot/db_simpledemo_openecomp_org +++ b/boot/db_simpledemo_openecomp_org @@ -119,7 +119,7 @@ collector.api.simpledemo.openecomp.org. IN A 10.0.4.102 ;dbc.api.simpledemo.openecomp.org. IN CNAME vm1.mr.simpledemo.openecomp.org. ;drprov.api.simpledemo.openecomp.org. IN CNAME vm1.mr.simpledemo.openecomp.org. -CLAMP +;CLAMP clamp.api.simpledemo.openecomp.org. IN CNAME vm1.clamp.simpledemo.openecomp.org. ;AAF diff --git a/boot/dcae_install.sh b/boot/dcae_install.sh index 058725f5..09a9e33d 100644 --- a/boot/dcae_install.sh +++ b/boot/dcae_install.sh @@ -80,9 +80,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget make openjdk-8-jdk git ntp ntpdate +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget make openjdk-8-jdk git ntp ntpdate # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/dcae_vm_init.sh -o /opt/dcae_vm_init.sh diff --git a/boot/dns_install.sh b/boot/dns_install.sh index 48c402c8..27ea2233 100644 --- a/boot/dns_install.sh +++ b/boot/dns_install.sh @@ -50,9 +50,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate make # Download script mkdir /etc/bind/zones @@ -70,7 +71,7 @@ then sed -i "s/appc_ip_addr/"$(cat /opt/config/appc_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/dcae_ip_addr/"$(cat /opt/config/dcae_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/dns_ip_addr/"$(cat /opt/config/dns_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org - sed -i "s/mso_ip_addr/"$(cat /opt/config/mso_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org + sed -i "s/so_ip_addr/"$(cat /opt/config/so_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/mr_ip_addr/"$(cat /opt/config/mr_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/policy_ip_addr/"$(cat /opt/config/policy_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/portal_ip_addr/"$(cat /opt/config/portal_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org @@ -80,6 +81,7 @@ then sed -i "s/vid_ip_addr/"$(cat /opt/config/vid_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/dcae_coll_ip_addr/"$(cat /opt/config/dcae_coll_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org sed -i "s/clamp_ip_addr/"$(cat /opt/config/clamp_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org + sed -i "s/openo_ip_addr/"$(cat /opt/config/openo_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org fi # Configure Bind diff --git a/boot/mr_install.sh b/boot/mr_install.sh index 0f890572..e2168383 100644 --- a/boot/mr_install.sh +++ b/boot/mr_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget make openjdk-8-jdk git ntp ntpdate +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget make openjdk-8-jdk git ntp ntpdate # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/mr_vm_init.sh -o /opt/mr_vm_init.sh diff --git a/boot/msb_vm_init.sh b/boot/msb_vm_init.sh new file mode 100644 index 00000000..cbce0609 --- /dev/null +++ b/boot/msb_vm_init.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) +NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) +NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) +DOCKER_IMAGE_VERSION=$(cat /opt/config/msb_docker.txt) + +source /opt/config/onap_ips.txt + +# start up MSB +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +docker pull $NEXUS_DOCKER_REPO/onap/msb/msb_discovery:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/msb/msb_apigateway:$DOCKER_IMAGE_VERSION + +docker rm -f msb_consul +docker rm -f msb_discovery +docker rm -f msb_apigateway + +docker run -d -p 8500:8500 --name msb_consul consul +CONSUL_IP=`sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' msb_consul` + +docker run -d -p 10081:10081 -e CONSUL_IP=$CONSUL_IP --name msb_discovery $NEXUS_DOCKER_REPO/onap/msb/msb_discovery:$DOCKER_IMAGE_VERSION +DISCOVERY_IP=`sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' msb_discovery` + +docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e "ROUTE_LABELS=visualRange:0|1" --name msb_apigateway $NEXUS_DOCKER_REPO/onap/msb/msb_apigateway:$DOCKER_IMAGE_VERSION + +# Allow the MSB container to come up before registering services +sleep 20 + +# register ONAP services to MSB +#aai +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-cloudInfrastructure", "version": "v11", "url": "/aai/v11/cloud-infrastructure","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-cloudInfrastructure-deprecated", "version": "v11", "url": "/aai/v11/cloud-infrastructure","path": "/aai/v11/cloud-infrastructure","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-business", "version": "v11", "url": "/aai/v11/business","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-business-deprecated", "version": "v11", "url": "/aai/v11/business","path": "/aai/v11/business","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-search", "version": "v11", "url": "/aai/v11/search","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-search-deprecated", "version": "v11", "url": "/aai/v11/search","path": "/aai/v11/search","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-actions", "version": "v11", "url": "/aai/v11/actions","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-actions-deprecated", "version": "v11", "url": "/aai/v11/actions","path": "/aai/v11/actions","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-service-design-and-creation", "version": "v11", "url": "/aai/v11/service-design-and-creation","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-service-design-and-creation-deprecated", "version": "v11", "url": "/aai/v11/service-design-and-creation","path": "/aai/v11/service-design-and-creation","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-network", "version": "v11", "url": "/aai/v11/network","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-network-deprecated", "version": "v11", "url": "/aai/v11/network","path": "/aai/v11/network","protocol": "REST", "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#so +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "so", "version": "v1", "url": "/ecomp/mso/infra","protocol": "REST", "nodes": [ {"ip": "'$SO_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "so-deprecated", "version": "v1", "url": "/ecomp/mso/infra","path": "/ecomp/mso/infra","protocol": "REST", "nodes": [ {"ip": "'$SO_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#Dmaap message router +#curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "message-router", "version": "v1", "url": "/","protocol": "REST", "nodes": [ {"ip": "'$DMAAP_IP'","port": "3904"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#policy +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "policy-pdp", "version": "v1", "url": "/pdp","protocol": "REST", "nodes": [ {"ip": "'$POLICY_IP'","port": "8081"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "policy-pdp-deprecated", "version": "v1", "url": "/pdp","path": "/pdp","protocol": "REST", "nodes": [ {"ip": "'$POLICY_IP'","port": "8081"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#portal +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "portal", "version": "v2", "url": "/","protocol": "REST", "nodes": [ {"ip": "'$PORTAL_IP'","port": "8989"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#sdc +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdc", "version": "v1", "url": "/sdc/v1","protocol": "REST", "nodes": [ {"ip": "'$SDC_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdc-deprecated", "version": "v1", "url": "/sdc/v1","path": "/sdc/v1","protocol": "REST", "nodes": [ {"ip": "'$SDC_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#sdnc +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdnc", "version": "v1", "url": "/","protocol": "REST", "nodes": [ {"ip": "'$SDNC_IP'","port": "8282"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdnc", "version": "v1", "url": "/restconf","path": "/restconf","protocol": "REST", "nodes": [ {"ip": "'$SDNC_IP'","port": "8282"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#multi-vim +curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "multicloud-titanium_cloud", "version": "v0", "url": "/api/multicloud-titanium_cloud/v0","protocol": "REST", "nodes": [ {"ip": "'$OPENO_IP'","port": "9005"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
\ No newline at end of file diff --git a/boot/mvim_vm_init.sh b/boot/mvim_vm_init.sh new file mode 100755 index 00000000..f8776bd4 --- /dev/null +++ b/boot/mvim_vm_init.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# Establish environment variables +NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) +NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) +NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) +DOCKER_IMAGE_VERSION=$(cat /opt/config/mvim_docker.txt) + +source /opt/config/onap_ips.txt + +# Refresh images +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +docker pull $NEXUS_DOCKER_REPO/onap/multicloud/framework:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/multicloud/vio:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/multicloud/openstack-ocata:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/multicloud/openstack-windriver:$DOCKER_IMAGE_VERSION + +docker rm -f multicloud-broker +docker rm -f multicloud-vio +docker rm -f multicloud-ocata +docker rm -f multicloud-windriver + +docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9001:9001 --name multicloud-broker $NEXUS_DOCKER_REPO/onap/multicloud/framework:$DOCKER_IMAGE_VERSION +docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9004:9004 --name multicloud-vio $NEXUS_DOCKER_REPO/onap/multicloud/vio:$DOCKER_IMAGE_VERSION +docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9006:9006 --name multicloud-ocata $NEXUS_DOCKER_REPO/onap/multicloud/openstack-ocata:$DOCKER_IMAGE_VERSION +docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9005:9005 --name multicloud-windriver $NEXUS_DOCKER_REPO/onap/multicloud/openstack-windriver:$DOCKER_IMAGE_VERSION
\ No newline at end of file diff --git a/boot/openo_all_serv.sh b/boot/openo_all_serv.sh new file mode 100644 index 00000000..e451fb1b --- /dev/null +++ b/boot/openo_all_serv.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +bash /opt/msb_vm_init.sh &>/dev/null &disown +bash /opt/vnfsdk_vm_init.sh &>/dev/null &disown +bash /opt/mvim_vm_init.sh &>/dev/null &disown +bash /opt/vfc_vm_init.sh &>/dev/null &disown +bash /opt/uui_vm_init.sh &>/dev/null &disown
\ No newline at end of file diff --git a/boot/openo_install.sh b/boot/openo_install.sh new file mode 100644 index 00000000..0f36497a --- /dev/null +++ b/boot/openo_install.sh @@ -0,0 +1,120 @@ +#!/bin/bash + +# Read configuration files +NEXUS_REPO=$(cat /opt/config/nexus_repo.txt) +ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.txt) +DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) +CLOUD_ENV=$(cat /opt/config/cloud_env.txt) +VNFSDK_BRANCH=$(cat /opt/config/vnfsdk_branch.txt) +MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) +VNFSDK_REPO=$(cat /opt/config/vnfsdk_repo.txt) + +# Add host name to /etc/host to avoid warnings in openstack images +if [[ $CLOUD_ENV != "rackspace" ]] +then + echo 127.0.0.1 $(hostname) >> /etc/hosts + + # Allow remote login as root + mv /root/.ssh/authorized_keys /root/.ssh/authorized_keys.bk + cp /home/ubuntu/.ssh/authorized_keys /root/.ssh +fi + +# Set private IP in /etc/network/interfaces manually in the presence of public interface +# Some VM images don't add the private interface automatically, we have to do it during the component installation +if [[ $CLOUD_ENV == "openstack_nofloat" ]] +then + LOCAL_IP=$(cat /opt/config/local_ip_addr.txt) + CIDR=$(cat /opt/config/oam_network_cidr.txt) + BITMASK=$(echo $CIDR | cut -d"/" -f2) + + # Compute the netmask based on the network cidr + if [[ $BITMASK == "8" ]] + then + NETMASK=255.0.0.0 + elif [[ $BITMASK == "16" ]] + then + NETMASK=255.255.0.0 + elif [[ $BITMASK == "24" ]] + then + NETMASK=255.255.255.0 + fi + + echo "auto eth1" >> /etc/network/interfaces + echo "iface eth1 inet static" >> /etc/network/interfaces + echo " address $LOCAL_IP" >> /etc/network/interfaces + echo " netmask $NETMASK" >> /etc/network/interfaces + echo " mtu $MTU" >> /etc/network/interfaces + ifup eth1 +fi + +# Download dependencies +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +apt-get update +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git unzip mysql-client-core-5.6 ntp ntpdate make + +# Download scripts from Nexus +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/vnfsdk_vm_init.sh -o /opt/vnfsdk_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/msb_vm_init.sh -o /opt/msb_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/mvim_vm_init.sh -o /opt/mvim_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/vfc_vm_init.sh -o /opt/vfc_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/uui_vm_init.sh -o /opt/uui_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/openo_all_serv.sh -o /opt/openo_all_serv.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/openo_serv.sh -o /opt/openo_serv.sh +chmod +x /opt/vnfsdk_vm_init.sh +chmod +x /opt/msb_vm_init.sh +chmod +x /opt/mvim_vm_init.sh +chmod +x /opt/vfc_vm_init.sh +chmod +x /opt/uui_vm_init.sh +chmod +x /opt/openo_all_serv.sh +chmod +x /opt/openo_serv.sh +mv /opt/openo_serv.sh /etc/init.d +update-rc.d openo_serv.sh defaults + +# Download and install docker-engine and docker-compose +echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list +apt-get update +apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual +apt-get install -y --allow-unauthenticated docker-engine + +mkdir /opt/docker +curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose +chmod +x /opt/docker/docker-compose + +# Set the MTU size of docker containers to the minimum MTU size supported by vNICs. OpenStack deployments may need to know the external DNS IP +DNS_FLAG="" +if [ -s /opt/config/dns_ip_addr.txt ] +then + DNS_FLAG=$DNS_FLAG"--dns $(cat /opt/config/dns_ip_addr.txt) " +fi +if [ -s /opt/config/external_dns.txt ] +then + DNS_FLAG=$DNS_FLAG"--dns $(cat /opt/config/external_dns.txt) " +fi +echo "DOCKER_OPTS=\"$DNS_FLAG--mtu=$MTU\"" >> /etc/default/docker + +cp /lib/systemd/system/docker.service /etc/systemd/system +sed -i "/ExecStart/s/$/ --mtu=$MTU/g" /etc/systemd/system/docker.service +service docker restart + +# DNS IP address configuration +echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head +resolvconf -u + +# Clone Gerrit repository and run docker containers +cd /opt +git clone -b $VNFSDK_BRANCH --single-branch $VNFSDK_REPO + +# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes +if [[ $CLOUD_ENV != "rackspace" ]] +then + sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub + grub-mkconfig -o /boot/grub/grub.cfg + sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg + sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules + echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg + echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic + reboot +fi + +./openo_all_serv.sh
\ No newline at end of file diff --git a/boot/openo_serv.sh b/boot/openo_serv.sh new file mode 100644 index 00000000..0afa931e --- /dev/null +++ b/boot/openo_serv.sh @@ -0,0 +1,98 @@ +#!/bin/sh +### BEGIN INIT INFO +# Provides: +# Required-Start: $remote_fs $syslog +# Required-Stop: $remote_fs $syslog +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start daemon at boot time +# Description: Enable service provided by daemon. +### END INIT INFO + +dir="/opt" +cmd="./openo_all_serv.sh" +user="root" + +name=`basename $0` +pid_file="/var/run/$name.pid" +stdout_log="/var/log/$name.log" +stderr_log="/var/log/$name.err" + +get_pid() { + cat "$pid_file" +} + +is_running() { + [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1 +} + +case "$1" in + start) + if is_running; then + echo "Already started" + else + echo "Starting $name" + cd "$dir" + if [ -z "$user" ]; then + sudo $cmd >> "$stdout_log" 2>> "$stderr_log" & + else + sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" & + fi + echo $! > "$pid_file" + if ! is_running; then + echo "Unable to start, see $stdout_log and $stderr_log" + exit 1 + fi + fi + ;; + stop) + if is_running; then + echo -n "Stopping $name.." + kill `get_pid` + for i in {1..10} + do + if ! is_running; then + break + fi + + echo -n "." + sleep 1 + done + echo + + if is_running; then + echo "Not stopped; may still be shutting down or shutdown may have failed" + exit 1 + else + echo "Stopped" + if [ -f "$pid_file" ]; then + rm "$pid_file" + fi + fi + else + echo "Not running" + fi + ;; + restart) + $0 stop + if is_running; then + echo "Unable to stop, will not attempt to start" + exit 1 + fi + $0 start + ;; + status) + if is_running; then + echo "Running" + else + echo "Stopped" + exit 1 + fi + ;; + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac + +exit 0 diff --git a/boot/policy_install.sh b/boot/policy_install.sh index 87aaca40..3f6ea5d1 100644 --- a/boot/policy_install.sh +++ b/boot/policy_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/policy_vm_init.sh -o /opt/policy_vm_init.sh diff --git a/boot/portal_install.sh b/boot/portal_install.sh index 0d54565e..c1b816e0 100644 --- a/boot/portal_install.sh +++ b/boot/portal_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git unzip mysql-client-core-5.6 ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git unzip mysql-client-core-5.6 ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/portal_vm_init.sh -o /opt/portal_vm_init.sh diff --git a/boot/portal_vm_init.sh b/boot/portal_vm_init.sh index a6c1ba48..5b201e09 100755 --- a/boot/portal_vm_init.sh +++ b/boot/portal_vm_init.sh @@ -29,12 +29,17 @@ docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO docker pull $NEXUS_DOCKER_REPO/openecomp/${DB_IMG_NAME}:$DOCKER_IMAGE_VERSION docker pull $NEXUS_DOCKER_REPO/openecomp/${EP_IMG_NAME}:$DOCKER_IMAGE_VERSION docker pull $NEXUS_DOCKER_REPO/openecomp/${WMS_IMG_NAME}:$DOCKER_IMAGE_VERSION +# Add CLI docker image +docker pull $NEXUS_DOCKER_REPO/onap/cli:$DOCKER_IMAGE_VERSION # Tag them as expected by docker-compose file docker tag $NEXUS_DOCKER_REPO/openecomp/${DB_IMG_NAME}:$DOCKER_IMAGE_VERSION $DB_IMG_NAME:$PORTAL_TAG docker tag $NEXUS_DOCKER_REPO/openecomp/${EP_IMG_NAME}:$DOCKER_IMAGE_VERSION $EP_IMG_NAME:$PORTAL_TAG docker tag $NEXUS_DOCKER_REPO/openecomp/${WMS_IMG_NAME}:$DOCKER_IMAGE_VERSION $WMS_IMG_NAME:$PORTAL_TAG +# Add tagging for CLI docker image as expected by docker-compose file +docker tag $NEXUS_DOCKER_REPO/onap/cli:$DOCKER_IMAGE_VERSION onap/cli:$PORTAL_TAG # docker-compose is not in /usr/bin /opt/docker/docker-compose down /opt/docker/docker-compose up -d + diff --git a/boot/robot_install.sh b/boot/robot_install.sh index 81f8e798..3447a01f 100644 --- a/boot/robot_install.sh +++ b/boot/robot_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/robot_vm_init.sh -o /opt/robot_vm_init.sh diff --git a/boot/robot_vm_init.sh b/boot/robot_vm_init.sh index 5b682729..7831348d 100644 --- a/boot/robot_vm_init.sh +++ b/boot/robot_vm_init.sh @@ -22,13 +22,14 @@ cp demo.sh /opt # sed -i "s/10.0.1.1/"$(cat /opt/config/aai1_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.2.1/"$(cat /opt/config/appc_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.4.1/"$(cat /opt/config/dcae_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py -# sed -i "s/10.0.5.1/"$(cat /opt/config/mso_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py +# sed -i "s/10.0.5.1/"$(cat /opt/config/so_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.11.1/"$(cat /opt/config/mr_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.6.1/"$(cat /opt/config/policy_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.9.1/"$(cat /opt/config/portal_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.3.1/"$(cat /opt/config/sdc_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.7.1/"$(cat /opt/config/sdnc_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/10.0.8.1/"$(cat /opt/config/vid_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py +# sed -i "s/10.0.12.1/"$(cat /opt/config/clamp_ip_addr.txt)"/g" /opt/eteshare/config/integration_robot_properties.py # sed -i "s/https:\/\/identity.api.rackspacecloud.com/"$(cat /opt/config/keystone.txt)"/g" /opt/eteshare/config/integration_robot_properties.py #fi diff --git a/boot/asdc_ext_volume_partitions.txt b/boot/sdc_ext_volume_partitions.txt index b00c6ae2..b00c6ae2 100644 --- a/boot/asdc_ext_volume_partitions.txt +++ b/boot/sdc_ext_volume_partitions.txt diff --git a/boot/asdc_install.sh b/boot/sdc_install.sh index 0400194c..2c32266c 100644 --- a/boot/asdc_install.sh +++ b/boot/sdc_install.sh @@ -48,17 +48,18 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/asdc_vm_init.sh -o /opt/asdc_vm_init.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/asdc_serv.sh -o /opt/asdc_serv.sh -chmod +x /opt/asdc_vm_init.sh -chmod +x /opt/asdc_serv.sh -mv /opt/asdc_serv.sh /etc/init.d -update-rc.d asdc_serv.sh defaults +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/sdc_vm_init.sh -o /opt/sdc_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/sdc_serv.sh -o /opt/sdc_serv.sh +chmod +x /opt/sdc_vm_init.sh +chmod +x /opt/sdc_serv.sh +mv /opt/sdc_serv.sh /etc/init.d +update-rc.d sdc_serv.sh defaults # Download and install docker-engine and docker-compose echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list @@ -71,17 +72,17 @@ curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose chmod +x /opt/docker/docker-compose # Create partition and mount the external volume -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/sdc_ext_volume_partitions.txt -o /opt/sdc_ext_volume_partitions.txt if [[ $CLOUD_ENV == "rackspace" ]] then DISK="xvdb" else DISK=$(ls /dev |grep -e '^.*db$') - sed -i "s/xvdb/$DISK/g" /opt/asdc_ext_volume_partitions.txt + sed -i "s/xvdb/$DISK/g" /opt/sdc_ext_volume_partitions.txt fi -sfdisk /dev/$DISK < /opt/asdc_ext_volume_partitions.txt +sfdisk /dev/$DISK < /opt/sdc_ext_volume_partitions.txt mkfs -t ext4 /dev/$DISK"1" mkdir -p /data mount /dev/$DISK"1" /data @@ -139,4 +140,4 @@ then fi # Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted -./asdc_vm_init.sh +./sdc_vm_init.sh diff --git a/boot/mso_serv.sh b/boot/sdc_serv.sh index 00ee4170..b48c8484 100644 --- a/boot/mso_serv.sh +++ b/boot/sdc_serv.sh @@ -10,7 +10,7 @@ ### END INIT INFO dir="/opt" -cmd="./mso_vm_init.sh" +cmd="./sdc_vm_init.sh" user="root" name=`basename $0` diff --git a/boot/asdc_vm_init.sh b/boot/sdc_vm_init.sh index dd15c0a1..dd15c0a1 100644 --- a/boot/asdc_vm_init.sh +++ b/boot/sdc_vm_init.sh diff --git a/boot/sdnc_install.sh b/boot/sdnc_install.sh index 5cf169c7..3b5c5cfa 100644 --- a/boot/sdnc_install.sh +++ b/boot/sdnc_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/sdnc_vm_init.sh -o /opt/sdnc_vm_init.sh diff --git a/boot/sdnc_vm_init.sh b/boot/sdnc_vm_init.sh index bc5b0369..f23f122a 100644 --- a/boot/sdnc_vm_init.sh +++ b/boot/sdnc_vm_init.sh @@ -4,6 +4,7 @@ NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) export NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) +DGBUILDER_IMAGE_VERSION=$(cat /opt/config/dgbuilder_version.txt) export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) export DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) @@ -19,7 +20,7 @@ docker tag $NEXUS_DOCKER_REPO/openecomp/sdnc-image:$DOCKER_IMAGE_VERSION openeco docker pull $NEXUS_DOCKER_REPO/openecomp/admportal-sdnc-image:$DOCKER_IMAGE_VERSION docker tag $NEXUS_DOCKER_REPO/openecomp/admportal-sdnc-image:$DOCKER_IMAGE_VERSION openecomp/admportal-sdnc-image:latest -docker pull $NEXUS_DOCKER_REPO/openecomp/dgbuilder-sdnc-image:$DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/openecomp/dgbuilder-sdnc-image:$DOCKER_IMAGE_VERSION openecomp/dgbuilder-sdnc-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image:$DGBUILDER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/ccsdk-dgbuilder-image/$DGBUILDER_IMAGE_VERSION onap/ccsdk-dgbuilder-image:latest /opt/docker/docker-compose up -d diff --git a/boot/mso_install.sh b/boot/so_install.sh index d9215b8d..d9a8a646 100644 --- a/boot/mso_install.sh +++ b/boot/so_install.sh @@ -49,17 +49,18 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/mso_vm_init.sh -o /opt/mso_vm_init.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/mso_serv.sh -o /opt/mso_serv.sh -chmod +x /opt/mso_vm_init.sh -chmod +x /opt/mso_serv.sh -mv /opt/mso_serv.sh /etc/init.d -update-rc.d mso_serv.sh defaults +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/so_vm_init.sh -o /opt/so_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/so_serv.sh -o /opt/so_serv.sh +chmod +x /opt/so_vm_init.sh +chmod +x /opt/so_serv.sh +mv /opt/so_serv.sh /etc/init.d +update-rc.d so_serv.sh defaults # Download and install docker-engine and docker-compose echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list @@ -94,8 +95,8 @@ resolvconf -u # Clone Gerrit repository cd /opt git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO test_lab -MSO_ENCRYPTION_KEY=$(cat /opt/test_lab/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 +SO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key) +echo -n "$OPENSTACK_API_KEY" | openssl aes-128-ecb -e -K $SO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] @@ -110,4 +111,4 @@ then fi # Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted -./mso_vm_init.sh +./so_vm_init.sh diff --git a/boot/asdc_serv.sh b/boot/so_serv.sh index 7d2539eb..d324447f 100644 --- a/boot/asdc_serv.sh +++ b/boot/so_serv.sh @@ -10,7 +10,7 @@ ### END INIT INFO dir="/opt" -cmd="./asdc_vm_init.sh" +cmd="./so_vm_init.sh" user="root" name=`basename $0` diff --git a/boot/mso_vm_init.sh b/boot/so_vm_init.sh index e39f6b06..d767a149 100644 --- a/boot/mso_vm_init.sh +++ b/boot/so_vm_init.sh @@ -58,7 +58,7 @@ else EOF fi -# Update the MSO configuration file. +# Update the SO configuration file. read -d '' MSO_CONFIG_UPDATES <<-EOF { "default_attributes": @@ -97,5 +97,5 @@ export MSO_CONFIG_UPDATES cd /opt/test_lab git pull chmod +x deploy.sh -#This script takes in input 2 nexus repos (the first one for the MSO image, the second one for mariadb) +#This script takes in input 2 nexus repos (the first one for the SO image, the second one for mariadb) ./deploy.sh $NEXUS_DOCKER_REPO $NEXUS_USERNAME $NEXUS_PASSWD $NEXUS_DOCKER_REPO $NEXUS_USERNAME $NEXUS_PASSWD diff --git a/boot/uui_vm_init.sh b/boot/uui_vm_init.sh new file mode 100755 index 00000000..ebec9e3d --- /dev/null +++ b/boot/uui_vm_init.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Establish environment variables +NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) +NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) +NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) +DOCKER_IMAGE_VERSION=$(cat /opt/config/uui_docker.txt) + +source /opt/config/onap_ips.txt + +# Refresh images +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +docker pull $NEXUS_DOCKER_REPO/onap/uui/ui:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/uui/server:$DOCKER_IMAGE_VERSION + +docker rm -f uui_ui +docker rm -f uui_server + +# Insert docker run instructions here +docker run -i -t -d --name uui_ui -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/uui/ui:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name uui_server -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/uui/server:$DOCKER_IMAGE_VERSION
\ No newline at end of file diff --git a/boot/vfc_vm_init.sh b/boot/vfc_vm_init.sh new file mode 100755 index 00000000..5badc201 --- /dev/null +++ b/boot/vfc_vm_init.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +# Establish environment variables +NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) +NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) +NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) +DOCKER_IMAGE_VERSION=$(cat /opt/config/vfc_docker.txt) + +source /opt/config/onap_ips.txt + +# Refresh images +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +docker pull $NEXUS_DOCKER_REPO/onap/vfc/catalog:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/emsdriver:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/gvnfmdriver:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/jujudriver:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/nfvo/svnfm/huawei:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/nslcm:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/resmanagement:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/vnflcm:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/vnfmgr:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/vnfres:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/ztesdncdriver:$DOCKER_IMAGE_VERSION +docker pull $NEXUS_DOCKER_REPO/onap/vfc/ztevmanagerdriver:$DOCKER_IMAGE_VERSION + +docker rm -f vfc_catalog +docker rm -f vfc_emsdriver +docker rm -f vfc_gvnfmdriver +docker rm -f vfc_jujudriver +docker rm -f vfc_svnfm_huawei +docker rm -f vfc_nslcm +docker rm -f vfc_resmanagement +docker rm -f vfc_vnflcm +docker rm -f vfc_vnfmgr +docker rm -f vfc_vnfres +docker rm -f vfc_ztesdncdriver +docker rm -f vfc_ztevmanagerdriver + +# Insert docker run instructions here +docker run -i -t -d --name vfc_catalog -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/catalog:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_emsdriver -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/emsdriver:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_gvnfmdriver -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/gvnfmdriver:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_jujudriver -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/jujudriver:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_svnfm_huawei -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/nfvo/svnfm/huawei:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_nslcm -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/nslcm:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_resmanagement -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/resmanagement:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_vnflcm -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/vnflcm:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_vnfmgr -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/vnfmgr:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_vnfres -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/vnfres:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_ztesdncdriver -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/ztesdncdriver:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name vfc_ztevmanagerdriver -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/ztevmanagerdriver:$DOCKER_IMAGE_VERSION
\ No newline at end of file diff --git a/boot/vid_install.sh b/boot/vid_install.sh index 1ec8ae62..118995c4 100644 --- a/boot/vid_install.sh +++ b/boot/vid_install.sh @@ -48,9 +48,10 @@ then fi # Download dependencies -add-apt-repository -y ppa:openjdk-r/ppa +echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list +echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >> /etc/apt/sources.list.d/java.list apt-get update -apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make +apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate make # Download scripts from Nexus curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/vid_vm_init.sh -o /opt/vid_vm_init.sh diff --git a/boot/vnfsdk_vm_init.sh b/boot/vnfsdk_vm_init.sh new file mode 100755 index 00000000..fa28285f --- /dev/null +++ b/boot/vnfsdk_vm_init.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# Starts docker containers for VNFSDK VNF repository. +# Version for Amsterdam/R1 uses docker-compose. + +# be verbose +set -x + +# Establish environment variables +NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) +NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) +NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) +export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) +#DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) --> not needed at the moment + +# Refresh configuration and scripts +cd /opt/refrepo +git pull +cd vnfmarket-be/deployment/install + +# Get image names used below from docker-compose environment file +source .env + +# Refresh images +docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO +docker pull $NEXUS_DOCKER_REPO/onap/refrepo:${REFREPO_TAG} +docker pull $NEXUS_DOCKER_REPO/onap/refrepo:${POSTGRES_TAG} + +# docker-compose is not in /usr/bin +/opt/docker/docker-compose down +/opt/docker/docker-compose up -d + |