diff options
Diffstat (limited to 'boot')
-rw-r--r-- | boot/appc_vm_init.sh | 5 | ||||
-rw-r--r-- | boot/bind_zones | 17 | ||||
-rw-r--r-- | boot/cli_install.sh | 58 | ||||
-rw-r--r-- | boot/dcae2_install.sh | 147 | ||||
-rw-r--r-- | boot/dcae2_serv.sh | 116 | ||||
-rw-r--r-- | boot/dcae2_vm_init.sh | 11 | ||||
-rw-r--r-- | boot/dcae_install.sh | 2 | ||||
-rw-r--r-- | boot/dns_install.sh | 3 | ||||
-rw-r--r-- | boot/msb_vm_init.sh | 128 | ||||
-rwxr-xr-x | boot/mvim_vm_init.sh | 26 | ||||
-rw-r--r-- | boot/openo_all_serv.sh | 7 | ||||
-rw-r--r-- | boot/openo_install.sh | 124 | ||||
-rw-r--r-- | boot/openo_serv.sh | 98 | ||||
-rwxr-xr-x | boot/portal_vm_init.sh | 5 | ||||
-rw-r--r-- | boot/robot_install.sh | 3 | ||||
-rw-r--r-- | boot/robot_vm_init.sh | 3 | ||||
-rw-r--r-- | boot/sdnc_vm_init.sh | 13 | ||||
-rw-r--r-- | boot/so_install.sh (renamed from boot/mso_install.sh) | 18 | ||||
-rw-r--r-- | boot/so_serv.sh (renamed from boot/mso_serv.sh) | 2 | ||||
-rw-r--r-- | boot/so_vm_init.sh (renamed from boot/mso_vm_init.sh) | 4 | ||||
-rwxr-xr-x | boot/uui_vm_init.sh | 21 | ||||
-rwxr-xr-x | boot/vfc_vm_init.sh | 54 | ||||
-rwxr-xr-x | boot/vnfsdk_vm_init.sh | 31 |
23 files changed, 867 insertions, 29 deletions
diff --git a/boot/appc_vm_init.sh b/boot/appc_vm_init.sh index 90b09eaf..dce1932e 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 afd662d6..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 @@ -124,3 +126,10 @@ 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/cli_install.sh b/boot/cli_install.sh new file mode 100644 index 00000000..d167a1a5 --- /dev/null +++ b/boot/cli_install.sh @@ -0,0 +1,58 @@ +#!/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 + +#check for java +java -version +if [ $? == 127 ] +then + apt-get install -y openjdk-8-jre +fi + +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/dcae2_install.sh b/boot/dcae2_install.sh new file mode 100644 index 00000000..df1d513c --- /dev/null +++ b/boot/dcae2_install.sh @@ -0,0 +1,147 @@ +#!/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) +EXTERNAL_DNS=$(cat /opt/config/external_dns.txt) +MAC_ADDR=$(cat /opt/config/mac_addr.txt) + +MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) + +if [[ $CLOUD_ENV != "rackspace" ]] +then + # Add host name to /etc/host to avoid warnings in openstack images + 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 + 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 $DCAE_IP_ADDR" >> /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 make openjdk-8-jdk git ntp ntpdate + +# Download scripts from Nexus +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/dcae2_vm_init.sh -o /opt/dcae2_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/dcae2_serv.sh -o /opt/dcae2_serv.sh +chmod +x /opt/dcae2_vm_init.sh +chmod +x /opt/dcae2_serv.sh +mv /opt/dcae2_serv.sh /etc/init.d +update-rc.d dcae_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 + +# Build a configuration file for the DCAE Controller. +chmod 777 /opt/config/priv_key +mkdir /opt/app + +UBUNTU_1604_IMAGE=$(cat /opt/config/ubuntu_1604_image.txt) +CENTOS_7_IMAGE=$(cat /opt/config/centos_7_image.txt) +FLAVOR_MEDIUM=$(cat /opt/config/flavor_medium.txt) +SECURITY_GROUP=$(cat /opt/config/security_group.txt) +PUBLIC_NET_ID=$(cat /opt/config/public_net_id.txt) +OPENSTACK_PRIVATE_NETWORK=$(cat /opt/config/openstack_private_network_name.txt) +OPENSTACK_USER=$(cat /opt/config/openstack_user.txt) +OPENSTACK_PASSWORD=$(cat /opt/config/openstack_password.txt) +OPENSTACK_TENANT_ID=$(cat /opt/config/tenant_id.txt) +KEYSTONE_URL=$(cat /opt/config/keystone_url.txt)"/v2.0" +OPENSTACK_REGION=$(cat /opt/config/openstack_region.txt) +OPENSTACK_KEYNAME=$(cat /opt/config/key_name.txt)"_"$(cat /opt/config/rand_str.txt) +ZONE=$(cat /opt/config/dcae_zone.txt) + +cat > /opt/app/inputs.yaml << EOF_CONFIG +centos7image_id: '$CENTOS_7_IMAGE' +ubuntu1604image_id: '$UBUNTU_1604_IMAGE' +flavor_id: '$FLAVOR_MEDIUM' +security_group: '$SECURITY_GROUP' +public_net: '$PUBLIC_NET_ID' +private_net: '$OPENSTACK_PRIVATE_NETWORK' +openstack: + username: '$OPENSTACK_USER' + password: '$OPENSTACK_PASSWORD' + tenant_name: '$OPENSTACK_TENANT_ID' + auth_url: '$KEYSTONE_URL' + region: '$OPENSTACK_REGION' +keypair: '$OPENSTACK_KEYNAME' +key_filename: '/opt/dcae/key' +location_prefix: '$ZONE' +location_domain: 'onapdevlab.onap.org' +codesource_url: 'https://nexus.onap.org/service/local/repositories/raw/content' +codesource_version: 'org.onap.dcaegen2.deployments/releases/scripts' +EOF_CONFIG + +# 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 + +# Run docker containers +cd /opt +./dcae2_vm_init.sh diff --git a/boot/dcae2_serv.sh b/boot/dcae2_serv.sh new file mode 100644 index 00000000..bfd2ad18 --- /dev/null +++ b/boot/dcae2_serv.sh @@ -0,0 +1,116 @@ + +############################################################################# +# +# Copyright © 2017 AT&T Intellectual Property. All rights reserved. +# +# 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. +# +############################################################################# + +#!/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="./dcae2_vm_init.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/dcae2_vm_init.sh b/boot/dcae2_vm_init.sh new file mode 100644 index 00000000..b9da6844 --- /dev/null +++ b/boot/dcae2_vm_init.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +NEXUS_USER=$(cat /opt/config/nexus_username.txt) +NEXUS_PASSWORD=$(cat /opt/config/nexus_password.txt) +NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) +DOCKER_VERSION=$(cat /opt/config/docker_version.txt) +ZONE=$(cat /opt/config/dcae_zone.txt) + +docker login -u $NEXUS_USER -p $NEXUS_PASSWORD $NEXUS_DOCKER_REPO +docker pull $NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION +docker run -v /opt/config/priv_key:/opt/app/installer/config/key -v /opt/app/inputs.yaml:/opt/app/installer/config/inputs.yaml -e "LOCATION=$ZONE" $NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION
\ No newline at end of file diff --git a/boot/dcae_install.sh b/boot/dcae_install.sh index 09a9e33d..eac9a69c 100644 --- a/boot/dcae_install.sh +++ b/boot/dcae_install.sh @@ -19,7 +19,7 @@ OPENSTACK_PASSWORD=$(cat /opt/config/openstack_password.txt) OPENSTACK_KEYNAME=$(cat /opt/config/key_name.txt)"_"$(cat /opt/config/rand_str.txt)"_dcae" OPENSTACK_PUBKEY=$(cat /opt/config/pub_key.txt) OPENSTACK_AUTH_METHOD=$(cat /opt/config/openstack_auth_method.txt) -KEYSTONE_URL=$(cat /opt/config/keystone_url.txt) +KEYSTONE_URL=$(cat /opt/config/keystone_url.txt)"/v2.0" OPENSTACK_TENANT_ID=$(cat /opt/config/tenant_id.txt) OPENSTACK_TENANT_NAME=OPEN-ECOMP OPENSTACK_REGION=$(cat /opt/config/openstack_region.txt) diff --git a/boot/dns_install.sh b/boot/dns_install.sh index 39f1ea0b..27ea2233 100644 --- a/boot/dns_install.sh +++ b/boot/dns_install.sh @@ -71,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 @@ -81,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/msb_vm_init.sh b/boot/msb_vm_init.sh new file mode 100644 index 00000000..d615a2d4 --- /dev/null +++ b/boot/msb_vm_init.sh @@ -0,0 +1,128 @@ +#!/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) +NEXUS_REPO=$(cat /opt/config/nexus_repo.txt) +ARTIFACTS_VERSION=$(cat /opt/config/artifacts_version.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 +export ONAP_HOST_URL=http://$OPENO_IP:80 +export CLI_PRODUCT_VERSION=onap-1.1 +onap -v + +#aai +onap microservice-create --service-name aai-cloudInfrastructure --service-version v11 --service-url /aai/v11/cloud-infrastructure $AAI_IP1 8443 + +onap microservice-create --service-name aai-cloudInfrastructure-deprecated --service-version v11 --service-url /aai/v11/cloud-infrastructure $AAI_IP1 8443 + +onap microservice-create --service-name aai-business --service-version v11 --service-url /aai/v11/business $AAI_IP1 8443 + +onap microservice-create --service-name aai-business-deprecated --service-version v11 --service-url /aai/v11/business $AAI_IP1 8443 + +onap microservice-create --service-name aai-search --service-version v11 --service-url /aai/v11/search $AAI_IP1 8443 + +onap microservice-create --service-name aai-search-deprecated --service-version v11 --service-url /aai/v11/search $AAI_IP1 8443 + +onap microservice-create --service-name aai-actions --service-version v11 --service-url /aai/v11/actions $AAI_IP1 8443 + +onap microservice-create --service-name aai-actions-deprecated --service-version v11 --service-url /aai/v11/actions $AAI_IP1 8443 + +onap microservice-create --service-name aai-service-design-and-creation --service-version v11 --service-url /aai/v11/service-design-and-creation $AAI_IP1 8443 + +onap microservice-create --service-name aai-service-design-and-creation-deprecated --service-version v11 --service-url /aai/v11/service-design-and-creation $AAI_IP1 8443 + +onap microservice-create --service-name aai-network --service-version v11 --service-url /aai/v11/network $AAI_IP1 8443 + +onap microservice-create --service-name aai-network-deprecated --service-version v11 --service-url /aai/v11/network $AAI_IP1 8443 + +#so +onap microservice-create --service-name so --service-version v1 --service-url /ecomp/mso/infra $SO_IP 8080 + +onap microservice-create --service-name so-deprecated --service-version v1 --service-url /ecomp/mso/infra $SO_IP 8080 + +#Dmaap message router +#curl -X POST -H "Content-Type: application/json" '{"serviceName": "message-router", "version": "v1", "url": "/","protocol": "REST", "nodes": [ {"ip": "'$DMAAP_IP'","port": "3904"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services" + +#policy +onap microservice-create --service-name policy-pdp --service-version v1 --service-url /ecomp/mso/infra $POLICY_IP 8081 + +onap microservice-create --service-name policy-pdp-deprecated --service-version v1 --service-url /ecomp/mso/infra $POLICY_IP 8081 + +#portal +onap microservice-create --service-name portal --service-version v2 --service-url / $PORTAL_IP 8989 + +#sdc +onap microservice-create --service-name sdc --service-version v1 --service-url /sdc/v1 $SDC_IP 8080 + +onap microservice-create --service-name sdc-deprecated --service-version v1 --service-url /sdc/v1 $SDC_IP 8080 + +#sdnc +onap microservice-create --service-name sdnc --service-version v1 --service-url /sdc/v1 $SDNC_IP 8282 + +onap microservice-create --service-name sdnc-deprecated --service-version v1 --service-url /restconf $SDNC_IP 8282 + +#multi-vim +onap microservice-create --service-name multicloud-titanium_cloud --service-version v0 --service-url /api/multicloud-titanium_cloud/v0 $OPENO_IP 9005 + +#VF-C +onap microservice-create --service-name nslcm --service-version v1 --service-url /api/nslcm/v1 $OPENO_IP 8403 + +onap microservice-create --service-name ztevmanagerdriver --service-version v1 --service-url /api/ztevmanagerdriver/v1 $OPENO_IP 8410 + +onap microservice-create --service-name ztesdncdriver --service-version v1 --service-url /api/ztesdncdriver/v1 $OPENO_IP 8411 + +onap microservice-create --service-name resmgr --service-version v1 --service-url /api/resmgr/v1 $OPENO_IP 8480 + +onap microservice-create --service-name gvnfmdriver --service-version v1 --service-url /api/gvnfmdriver/v1 $OPENO_IP 8484 + +onap microservice-create --service-name huaweivnfmdriver --service-version v1 --service-url /api/huaweivnfmdriver/v1 $OPENO_IP 8482 + +onap microservice-create --service-name nokiavnfmdriver --service-version v1 --service-url /api/nokiavnfmdriver/v1 $OPENO_IP 8485 + +onap microservice-create --service-name jujuvnfmdriver --service-version v1 --service-url /api/jujuvnfmdriver/v1 $OPENO_IP 8483 + +onap microservice-create --service-name vnflcm --service-version v1 --service-url /api/vnflcm/v1 $OPENO_IP 8801 + +onap microservice-create --service-name vnfres --service-version v1 --service-url /api/vnfres/v1 $OPENO_IP 8802 + +onap microservice-create --service-name vnfmgr --service-version v1 --service-url /api/vnfmgr/v1 $OPENO_IP 8803 + +onap microservice-create --service-name activiti --service-version v1 --service-url /api/activiti/v1 $OPENO_IP 8804 + +onap microservice-create --service-name activiti --service-version v1 --service-url /api/workflow/v1 $OPENO_IP 8805 + +onap microservice-create --service-name catalog --service-version v1 --service-url /api/catalog/v1 $OPENO_IP 8806 + +onap microservice-create --service-name emsdriver --service-version v1 --service-url /api/emsdriver/v1 $OPENO_IP 8206 + +#UUI +onap microservice-create --service-name usecaseui --service-version v1 --service-url /api/usecaseui/server/v1 $OPENO_IP 8901 + +onap microservice-create --service-name usecaseui-gui --service-version v1 --service-url /iui/usecaseui $OPENO_IP 8900 + +#Print the registered services +onap microservice-list --long 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..24f84fd5 --- /dev/null +++ b/boot/openo_install.sh @@ -0,0 +1,124 @@ +#!/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 +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/cli_install.sh -o /opt/cli_install.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 +chmod +x /opt/cli_install.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 + +source ./cli_install.sh + +# 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/portal_vm_init.sh b/boot/portal_vm_init.sh index 5b201e09..c58f22f0 100755 --- a/boot/portal_vm_init.sh +++ b/boot/portal_vm_init.sh @@ -10,6 +10,7 @@ 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/docker_version.txt) +CLI_DOCKER_VERSION=$(cat /opt/config/cli_docker_version.txt) # Refresh configuration and scripts cd /opt/portal @@ -30,14 +31,14 @@ 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 +docker pull $NEXUS_DOCKER_REPO/onap/cli:$CLI_DOCKER_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 tag $NEXUS_DOCKER_REPO/onap/cli:$CLI_DOCKER_VERSION onap/cli:$PORTAL_TAG # docker-compose is not in /usr/bin /opt/docker/docker-compose down diff --git a/boot/robot_install.sh b/boot/robot_install.sh index 3447a01f..70cf4b14 100644 --- a/boot/robot_install.sh +++ b/boot/robot_install.sh @@ -9,6 +9,9 @@ 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) +# Short-term fix to get around MSO to SO name change +cp /opt/config/so_ip_addr.txt /opt/config/mso_ip_addr.txt + # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] then diff --git a/boot/robot_vm_init.sh b/boot/robot_vm_init.sh index 4a4181ea..c119dde8 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/sdnc_vm_init.sh b/boot/sdnc_vm_init.sh index bc5b0369..5e48a96f 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) @@ -13,13 +14,13 @@ git pull cd /opt/sdnc/installation/src/main/yaml docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -docker pull $NEXUS_DOCKER_REPO/openecomp/sdnc-image:$DOCKER_IMAGE_VERSION -docker tag $NEXUS_DOCKER_REPO/openecomp/sdnc-image:$DOCKER_IMAGE_VERSION openecomp/sdnc-image:latest +docker pull $NEXUS_DOCKER_REPO/onap/sdnc-image:$DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/sdnc-image:$DOCKER_IMAGE_VERSION onap/sdnc-image:latest -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/onap/admportal-sdnc-image:$DOCKER_IMAGE_VERSION +docker tag $NEXUS_DOCKER_REPO/onap/admportal-sdnc-image:$DOCKER_IMAGE_VERSION onap/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 bb36dcbd..d9a8a646 100644 --- a/boot/mso_install.sh +++ b/boot/so_install.sh @@ -55,12 +55,12 @@ apt-get update 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 @@ -95,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" ]] @@ -111,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/mso_serv.sh b/boot/so_serv.sh index 00ee4170..d324447f 100644 --- a/boot/mso_serv.sh +++ b/boot/so_serv.sh @@ -10,7 +10,7 @@ ### END INIT INFO dir="/opt" -cmd="./mso_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..1d47e306 --- /dev/null +++ b/boot/vfc_vm_init.sh @@ -0,0 +1,54 @@ +#!/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 pull $NEXUS_DOCKER_REPO/onap/vfc/nfvo/svnfm/nokia:$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 +docker rm -f vfc_svnfm_nokia + +# 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 +docker run -i -t -d --name vfc_svnfm_nokia -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/vfc/nfvo/svnfm/nokia:$DOCKER_IMAGE_VERSION
\ No newline at end of file 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 + |