diff options
Diffstat (limited to 'boot')
-rw-r--r-- | boot/aai2_vm_init.sh | 16 | ||||
-rw-r--r-- | boot/aai_install.sh | 25 | ||||
-rw-r--r-- | boot/aai_vm_init.sh | 45 | ||||
-rw-r--r-- | boot/appc_install.sh | 8 | ||||
-rw-r--r-- | boot/appc_vm_init.sh | 5 | ||||
-rw-r--r-- | boot/bind_zones | 28 | ||||
-rw-r--r-- | boot/clamp_install.sh (renamed from boot/mso_install.sh) | 25 | ||||
-rw-r--r-- | boot/clamp_serv.sh (renamed from boot/asdc_serv.sh) | 2 | ||||
-rw-r--r-- | boot/clamp_vm_init.sh | 30 | ||||
-rw-r--r-- | boot/cli_install.sh | 50 | ||||
-rw-r--r-- | boot/db_openecomp_org | 109 | ||||
-rw-r--r-- | boot/db_simpledemo_openecomp_org | 12 | ||||
-rw-r--r-- | boot/dcae_install.sh | 11 | ||||
-rw-r--r-- | boot/dns_install.sh | 9 | ||||
-rw-r--r-- | boot/mr_install.sh | 8 | ||||
-rw-r--r-- | boot/msb_vm_init.sh | 83 | ||||
-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 | 120 | ||||
-rw-r--r-- | boot/openo_serv.sh | 98 | ||||
-rw-r--r-- | boot/policy_install.sh | 8 | ||||
-rw-r--r-- | boot/portal_install.sh | 9 | ||||
-rwxr-xr-x | boot/portal_vm_init.sh | 84 | ||||
-rw-r--r-- | boot/robot_install.sh | 8 | ||||
-rw-r--r-- | boot/robot_vm_init.sh | 3 | ||||
-rw-r--r-- | boot/sdc_ext_volume_partitions.txt (renamed from boot/asdc_ext_volume_partitions.txt) | 0 | ||||
-rw-r--r-- | boot/sdc_install.sh (renamed from boot/asdc_install.sh) | 28 | ||||
-rw-r--r-- | boot/sdc_serv.sh (renamed from boot/mso_serv.sh) | 2 | ||||
-rw-r--r-- | boot/sdc_vm_init.sh (renamed from boot/asdc_vm_init.sh) | 0 | ||||
-rw-r--r-- | boot/sdnc_install.sh | 8 | ||||
-rw-r--r-- | boot/sdnc_vm_init.sh | 5 | ||||
-rw-r--r-- | boot/so_install.sh (renamed from boot/aai2_install.sh) | 50 | ||||
-rw-r--r-- | boot/so_serv.sh (renamed from boot/aai2_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 | 51 | ||||
-rw-r--r-- | boot/vid_install.sh | 8 | ||||
-rwxr-xr-x | boot/vnfsdk_vm_init.sh | 31 |
38 files changed, 725 insertions, 314 deletions
diff --git a/boot/aai2_vm_init.sh b/boot/aai2_vm_init.sh deleted file mode 100644 index ffe0955f..00000000 --- a/boot/aai2_vm_init.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -AAI_INSTANCE=$(cat /opt/config/aai_instance.txt) - -cd /opt/test-config -git pull - -if [[ $AAI_INSTANCE == "aai_instance_1" ]] -then - ./deploy_vm1.sh -elif [[ $AAI_INSTANCE == "aai_instance_2" ]] -then - ./deploy_vm2.sh -else - echo "Invalid instance. Exiting..." -fi diff --git a/boot/aai_install.sh b/boot/aai_install.sh index d4a04ed4..9ee49d7f 100644 --- a/boot/aai_install.sh +++ b/boot/aai_install.sh @@ -5,7 +5,10 @@ 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) +GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt) +AAI_INSTANCE=$(cat /opt/config/aai_instance.txt) MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) +CODE_REPO=$(cat /opt/config/remote_repo.txt) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -46,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 @@ -89,7 +93,20 @@ echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head resolvconf -u # Run docker containers -mkdir -p /opt/openecomp/aai/logs -mkdir -p /opt/openecomp/aai/data cd /opt +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO + +if [[ $AAI_INSTANCE == "aai_instance_1" ]] +then + mkdir -p /opt/aai/logroot/AAI-RESOURCES + mkdir -p /opt/aai/logroot/AAI-TRAVERSAL + mkdir -p /opt/aai/logroot/AAI-ML + mkdir -p /opt/aai/logroot/AAI-SDB + mkdir -p /opt/aai/logroot/AAI-DRMS + mkdir -p /opt/aai/logroot/AAI-UI + chown -R 999:999 /opt/aai/logroot/AAI-RESOURCES /opt/aai/logroot/AAI-TRAVERSAL + + sleep 300 +fi + ./aai_vm_init.sh
\ No newline at end of file diff --git a/boot/aai_vm_init.sh b/boot/aai_vm_init.sh index 6fcf7b0e..ffe0955f 100644 --- a/boot/aai_vm_init.sh +++ b/boot/aai_vm_init.sh @@ -1,43 +1,16 @@ #!/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) -DMAAP_TOPIC=$(cat /opt/config/dmaap_topic.txt) -DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) +AAI_INSTANCE=$(cat /opt/config/aai_instance.txt) -# Pull HBase container from a public docker hub -docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -docker pull $NEXUS_DOCKER_REPO/aaidocker/aai-hbase-1.2.3 -docker rm -f hbase-1.2.3 -docker run -d --net=host --name="hbase-1.2.3" $NEXUS_DOCKER_REPO/aaidocker/aai-hbase-1.2.3 +cd /opt/test-config +git pull -# Wait 3 minutes before instantiating the A&AI container -sleep 180 - -docker pull $NEXUS_DOCKER_REPO/openecomp/ajsc-aai:$DOCKER_IMAGE_VERSION -docker rm -f aai-service -docker run --name=aai-service --net=host -v /etc/ssl/certs/ca-certificates.crt:/etc/ssl/certs/ca-certificates.crt -it -e AAI_REPO_PATH=r/aai -e AAI_CHEF_ENV=simpledemo -d -e AAI_CHEF_LOC=/var/chef/aai-data/environments -e docker_gitbranch=release-1.0.0 $NEXUS_DOCKER_REPO/openecomp/ajsc-aai:$DOCKER_IMAGE_VERSION - -docker pull $NEXUS_DOCKER_REPO/openecomp/model-loader:$DOCKER_IMAGE_VERSION -docker rm -f model-loader-service - -# Start Model Loader container only if SDC is up and running -# Use the default SDC private IP address if no file exists or the file is empty -if [[ -s "/opt/config/sdc_ip_addr.txt" ]] +if [[ $AAI_INSTANCE == "aai_instance_1" ]] +then + ./deploy_vm1.sh +elif [[ $AAI_INSTANCE == "aai_instance_2" ]] then - SDC_IP_ADDR=$(cat /opt/config/sdc_ip_addr.txt) + ./deploy_vm2.sh else - SDC_IP_ADDR="10.0.3.1" + echo "Invalid instance. Exiting..." fi - -# Run Health Check against SDC and verify that all five components are up -RES=$(curl http://$SDC_IP_ADDR:8181/sdc1/rest/healthCheck | grep -c "OK") -while [[ $RES -lt 5 ]] -do - RES=$(curl http://$SDC_IP_ADDR:8181/sdc1/rest/healthCheck | grep -c "OK") -done - -# At this point, SDC is healthy and Model Loader container can start -docker run --name=model-loader-service -it -d -e DISTR_CLIENT_ASDC_ADDRESS=c2.vm1.sdc.simpledemo.openecomp.org:8443 -e DISTR_CLIENT_ENVIRONMENT_NAME=$DMAAP_TOPIC -e DISTR_CLIENT_USER=aai -e DISTR_CLIENT_PASSWORD=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp -e APP_SERVER_BASE_URL=https://c1.vm1.aai.simpledemo.openecomp.org:8443 -e APP_SERVER_KEYSTORE_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o -e APP_SERVER_AUTH_USER=ModelLoader -e APP_SERVER_AUTH_PASSWORD=OBF:1qvu1v2h1sov1sar1wfw1j7j1wg21saj1sov1v1x1qxw $NEXUS_DOCKER_REPO/openecomp/model-loader:$DOCKER_IMAGE_VERSION - diff --git a/boot/appc_install.sh b/boot/appc_install.sh index c2d4512c..b241efe7 100644 --- a/boot/appc_install.sh +++ b/boot/appc_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -91,5 +93,5 @@ resolvconf -u # Clone Gerrit repository and run docker containers cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/appc/deployment.git appc +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO appc ./appc_vm_init.sh
\ No newline at end of file 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 0893ca64..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 @@ -69,14 +69,22 @@ vm1.portal.simpledemo.openecomp.org. IN A portal_ip_addr c1.vm1.portal.simpledemo.openecomp.org. IN A portal_ip_addr c2.vm1.portal.simpledemo.openecomp.org. IN A portal_ip_addr +vm1.clamp.simpledemo.openecomp.org. IN A clamp_ip_addr +c1.vm1.clamp.simpledemo.openecomp.org. IN A clamp_ip_addr +c2.vm1.clamp.simpledemo.openecomp.org. IN A clamp_ip_addr + ;vm1.aaf.simpledemo.openecomp.org. IN A aaf_ip_addr -vm1.mr.simpledemo.openecomp.org. IN A mr_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 aai.api.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. +aai.ui.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. +aai.searchservice.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. aai.hbase.simpledemo.openecomp.org. IN CNAME vm2.aai.simpledemo.openecomp.org. aai.gremlinserver.simpledemo.openecomp.org. IN CNAME vm2.aai.simpledemo.openecomp.org. aai.elasticsearch.simpledemo.openecomp.org. IN CNAME vm2.aai.simpledemo.openecomp.org. @@ -90,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 @@ -113,5 +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.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/mso_install.sh b/boot/clamp_install.sh index e7d47dfd..26e8f06f 100644 --- a/boot/mso_install.sh +++ b/boot/clamp_install.sh @@ -5,9 +5,9 @@ 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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -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/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/clamp_vm_init.sh -o /opt/clamp_vm_init.sh +curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/clamp_serv.sh -o /opt/clamp_serv.sh +chmod +x /opt/clamp_vm_init.sh +chmod +x /opt/clamp_serv.sh +mv /opt/clamp_serv.sh /etc/init.d +update-rc.d clamp_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 @@ -92,9 +93,7 @@ resolvconf -u # Clone Gerrit repository cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/so/docker-config.git 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 +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] @@ -109,4 +108,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 +./clamp_vm_init.sh diff --git a/boot/asdc_serv.sh b/boot/clamp_serv.sh index 7d2539eb..ed311849 100644 --- a/boot/asdc_serv.sh +++ b/boot/clamp_serv.sh @@ -10,7 +10,7 @@ ### END INIT INFO dir="/opt" -cmd="./asdc_vm_init.sh" +cmd="./clamp_vm_init.sh" user="root" name=`basename $0` diff --git a/boot/clamp_vm_init.sh b/boot/clamp_vm_init.sh new file mode 100644 index 00000000..f8b26e30 --- /dev/null +++ b/boot/clamp_vm_init.sh @@ -0,0 +1,30 @@ +#!/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/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_openecomp_org b/boot/db_openecomp_org deleted file mode 100644 index be42b603..00000000 --- a/boot/db_openecomp_org +++ /dev/null @@ -1,109 +0,0 @@ -; -; BIND data file for local loopback interface -; -$TTL 604800 -@ IN SOA openecomp.org. admin.openecomp.org. ( - 20161202 ; Serial - 604800 ; Refresh - 86400 ; Retry - 2419200 ; Expire - 604800 ) ; Negative Cache TTL -; -; name servers - NS records - IN NS openecomp.org. - -; name servers - A records -openecomp.org. IN A 10.0.0.1 - -; -vm1.aai.simpledemo.openecomp.org. IN A 10.0.1.1 -c1.vm1.aai.simpledemo.openecomp.org. IN A 10.0.1.1 -c2.vm1.aai.simpledemo.openecomp.org. IN A 10.0.1.1 -c3.vm1.aai.simpledemo.openecomp.org. IN A 10.0.1.1 - -vm1.appc.simpledemo.openecomp.org. IN A 10.0.2.1 -c1.vm1.appc.simpledemo.openecomp.org. IN A 10.0.2.1 -c2.vm1.appc.simpledemo.openecomp.org. IN A 10.0.2.1 - -vm1.asdc.simpledemo.openecomp.org. IN A 10.0.3.1 -c1.vm1.asdc.simpledemo.openecomp.org. IN A 10.0.3.1 -c2.vm1.asdc.simpledemo.openecomp.org. IN A 10.0.3.1 -c3.vm1.asdc.simpledemo.openecomp.org. IN A 10.0.3.1 -c4.vm1.asdc.simpledemo.openecomp.org. IN A 10.0.3.1 - -vm1.dcae.simpledemo.openecomp.org. IN A 10.0.4.1 -c1.vm1.dcae.simpledemo.openecomp.org. IN A 10.0.4.1 -c2.vm1.dcae.simpledemo.openecomp.org. IN A 10.0.4.1 -c3.vm1.dcae.simpledemo.openecomp.org IN A 10.0.4.1 - -vm1.mso.simpledemo.openecomp.org. IN A 10.0.5.1 -c1.vm1.mso.simpledemo.openecomp.org. IN A 10.0.5.1 -c1.vm1.mso.simpledemo.openecomp.org. IN A 10.0.5.1 - -vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c1.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c2.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c3.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c4.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c5.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c6.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c7.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 -c8.vm1.policy.simpledemo.openecomp.org. IN A 10.0.6.1 - -vm1.sdnc.simpledemo.openecomp.org. IN A 10.0.7.1 -c1.vm1.sdnc.simpledemo.openecomp.org. IN A 10.0.7.1 -c2.vm1.sdnc.simpledemo.openecomp.org. IN A 10.0.7.1 -c3.vm1.sdnc.simpledemo.openecomp.org. IN A 10.0.7.1 -c4.vm1.sdnc.simpledemo.openecomp.org. IN A 10.0.7.1 - -vm1.vid.simpledemo.openecomp.org. IN A 10.0.8.1 -c1.vm1.vid.simpledemo.openecomp.org. IN A 10.0.8.1 -c2.vm1.vid.simpledemo.openecomp.org. IN A 10.0.8.1 - -vm1.portal.simpledemo.openecomp.org. IN A 10.0.9.1 -c1.vm1.portal.simpledemo.openecomp.org. IN A 10.0.9.1 -c2.vm1.portal.simpledemo.openecomp.org. IN A 10.0.9.1 - -vm1.aaf.simpledemo.openecomp.org. IN A 10.0.12.1 - -vm1.mr.simpledemo.openecomp.org. IN A 10.0.11.1 - -;CNAMES -;A&AI -aai.api.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. -aai.hbase.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. - -;APPC -appc.api.simpledemo.openecomp.org. IN CNAME vm1.appc.simpledemo.openecomp.org. - -;ASDC -asdc.api.simpledemo.openecomp.org. IN CNAME vm1.asdc.simpledemo.openecomp.org. - -;DCAE -dcae.api.simpledemo.openecomp.org. IN CNAME vm1.dcae.simpledemo.openecomp.org. - -;MSO -mso.api.simpledemo.openecomp.org. IN CNAME vm1.mso.simpledemo.openecomp.org. - -;Policy -policy.api.simpledemo.openecomp.org. IN CNAME vm1.policy.simpledemo.openecomp.org. - -;SDNC -sdnc.api.simpledemo.openecomp.org. IN CNAME vm1.sdnc.simpledemo.openecomp.org. - -;VID -vid.api.simpledemo.openecomp.org. IN CNAME vm1.vid.simpledemo.openecomp.org. - -;PORTAL -portal.api.simpledemo.openecomp.org. IN CNAME vm1.portal.simpledemo.openecomp.org. - -;Message Router -;mr.api.simpledemo.openecomp.org. IN CNAME vm1.mr.simpledemo.openecomp.org. -ueb.api.simpledemo.openecomp.org. IN CNAME vm1.mr.simpledemo.openecomp.org. -mr.api.simpledemo.openecomp.org. IN A 10.0.4.102 -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. - -;AAF -aaf.api.simpledemo.openecomp.org. IN CNAME vm1.aaf.simpledemo.openecomp.org.
\ No newline at end of file diff --git a/boot/db_simpledemo_openecomp_org b/boot/db_simpledemo_openecomp_org index f7d2b9dc..942be995 100644 --- a/boot/db_simpledemo_openecomp_org +++ b/boot/db_simpledemo_openecomp_org @@ -69,15 +69,20 @@ vm1.portal.simpledemo.openecomp.org. IN A 10.0.9.1 c1.vm1.portal.simpledemo.openecomp.org. IN A 10.0.9.1 c2.vm1.portal.simpledemo.openecomp.org. IN A 10.0.9.1 -vm1.aaf.simpledemo.openecomp.org. IN A 10.0.12.1 +vm1.aaf.simpledemo.openecomp.org. IN A 10.0.13.1 -vm1.mr.simpledemo.openecomp.org. IN A 10.0.11.1 +vm1.mr.simpledemo.openecomp.org. IN A 10.0.11.1 + +vm1.clamp.simpledemo.openecomp.org. IN A 10.0.12.1 +c1.vm1.clamp.simpledemo.openecomp.org. IN A 10.0.12.1 +c2.vm1.clamp.simpledemo.openecomp.org. IN A 10.0.12.1 ;CNAMES ;A&AI aai.api.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. aai.ui.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. +aai.searchservice.simpledemo.openecomp.org. IN CNAME vm1.aai.simpledemo.openecomp.org. aai.hbase.simpledemo.openecomp.org. IN CNAME vm2.aai.simpledemo.openecomp.org. aai.gremlinserver.simpledemo.openecomp.org. IN CNAME vm2.aai.simpledemo.openecomp.org. aai.elasticsearch.simpledemo.openecomp.org. IN CNAME vm2.aai.simpledemo.openecomp.org. @@ -114,5 +119,8 @@ 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.api.simpledemo.openecomp.org. IN CNAME vm1.clamp.simpledemo.openecomp.org. + ;AAF aaf.api.simpledemo.openecomp.org. IN CNAME vm1.aaf.simpledemo.openecomp.org. diff --git a/boot/dcae_install.sh b/boot/dcae_install.sh index 4cf78964..09a9e33d 100644 --- a/boot/dcae_install.sh +++ b/boot/dcae_install.sh @@ -6,6 +6,8 @@ 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) GERRIT_BRANCH=$(cat /opt/config/gerrit_branch.txt) +CODE_REPO=$(cat /opt/config/remote_repo.txt) +MR_REPO=$(cat /opt/config/mr_repo.txt) BASE=$(cat /opt/config/dcae_base_environment.txt) PUBLIC_NET_ID=$(cat /opt/config/public_net_id.txt) @@ -78,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 @@ -122,7 +125,7 @@ resolvconf -u # Clone Gerrit repository cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/dcae/demo/startup/controller.git dcae-startup-vm-controller +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO dcae-startup-vm-controller # Build a configuration file for the DCAE Controller. cd /opt/dcae-startup-vm-controller @@ -154,7 +157,7 @@ NEXUS-RAWURL: $NEXUS_REPO DOCKER-REGISTRY: $DOCKER_REGISTRY DOCKER-VERSION: $DOCKER_VERSION -GIT-MR-REPO: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git +GIT-MR-REPO: $MR_REPO public_net_id: $PUBLIC_NET_ID dcae_ip_addr: $DCAE_IP_ADDR diff --git a/boot/dns_install.sh b/boot/dns_install.sh index e76f371a..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 @@ -79,6 +80,8 @@ then sed -i "s/sdnc_ip_addr/"$(cat /opt/config/sdnc_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org 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 8c6ee206..e2168383 100644 --- a/boot/mr_install.sh +++ b/boot/mr_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -91,5 +93,5 @@ resolvconf -u # Clone Gerrit repository and run docker containers cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/dcae/demo/startup/message-router.git dcae-startup-vm-message-router +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO dcae-startup-vm-message-router ./mr_vm_init.sh
\ No newline at end of file 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 18cc3def..3f6ea5d1 100644 --- a/boot/policy_install.sh +++ b/boot/policy_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -91,5 +93,5 @@ resolvconf -u # Clone Gerrit repository and run docker containers cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/policy/docker.git policy +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO policy ./policy_vm_init.sh
\ No newline at end of file diff --git a/boot/portal_install.sh b/boot/portal_install.sh index 6b1c34f0..c1b816e0 100644 --- a/boot/portal_install.sh +++ b/boot/portal_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -92,5 +94,6 @@ resolvconf -u # Clone Gerrit repository and run docker containers mkdir -p /PROJECT/OpenSource/UbuntuEP/logs cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/portal.git +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO + ./portal_vm_init.sh
\ No newline at end of file diff --git a/boot/portal_vm_init.sh b/boot/portal_vm_init.sh index 5f34aae8..5b201e09 100755 --- a/boot/portal_vm_init.sh +++ b/boot/portal_vm_init.sh @@ -1,71 +1,45 @@ #!/bin/bash -# Starts docker containers for ONAP Portal +# Starts docker containers for ONAP Portal in Rackspace. +# Version for Amsterdam/R1 uses docker-compose. # be verbose set -x -# Refresh source area with start scripts -cd /opt/portal -git pull -cd /opt - # 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/docker_version.txt) -# Get container, image and tag names used below -source portal/deliveries/os_settings.sh +# Refresh configuration and scripts +cd /opt/portal +git pull +cd deliveries + +# Get image names used below from docker-compose environment file +source .env -# Unpack property files -unzip -o portal/deliveries/etc.zip -d /PROJECT/OpenSource/UbuntuEP/ +# Copy property files +ETC=/PROJECT/OpenSource/UbuntuEP/etc +mkdir -p $ETC +cp -r properties_rackspace/* $ETC # Refresh images docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO -docker pull $NEXUS_DOCKER_REPO/openecomp/${DB_TAG_NAME}:$DOCKER_IMAGE_VERSION -docker pull $NEXUS_DOCKER_REPO/openecomp/${EP_TAG_NAME}:$DOCKER_IMAGE_VERSION -docker pull $NEXUS_DOCKER_REPO/openecomp/${WMS_TAG_NAME}:$DOCKER_IMAGE_VERSION - -# Remove lingering containers; order matters. -docker rm -f $DB_CONT_NAME -docker rm -f $DB_VOL_NAME -docker rm -f $EP_CONT_NAME -docker rm -f $WMS_CONT_NAME - -docker create --name $DB_VOL_NAME -v /var/lib/mysql mariadb -docker tag $NEXUS_DOCKER_REPO/openecomp/${DB_TAG_NAME}:$DOCKER_IMAGE_VERSION $DB_IMG_NAME -docker tag $NEXUS_DOCKER_REPO/openecomp/${EP_TAG_NAME}:$DOCKER_IMAGE_VERSION $EP_IMG_NAME -# WMS image has no version in the registry -docker tag $NEXUS_DOCKER_REPO/openecomp/${WMS_TAG_NAME}:$DOCKER_IMAGE_VERSION ${WMS_IMG_NAME}:latest - -# Recreate the named containers -cd portal/deliveries -echo "Starting database" -./dbstart.sh -echo "Delaying for database" -sleep 10 -echo "Starting apps" -./new_start.sh -echo "Starting widget-ms" -./widget_ms_start.sh - -sleep 180 +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 -if [ ! -e /opt/config/boot.txt ] -then - if [ -e /opt/config/public_ip.txt ] - then - IP_ADDRESS=$(cat /opt/config/public_ip.txt) - else - IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) - fi - # Wait until MySQL is running... - while [[ $(netstat -vulntp |grep -i mysql | awk '{print $4}') != ":::3306" ]] - do - sleep 1 - done - # no longer necessary; done at docker build time - # mysql -u root -p'Aa123456' -h $IP_ADDRESS < /opt/portal/deliveries/Apps_Users_OnBoarding_Script.sql - echo "yes" > /opt/config/boot.txt -fi diff --git a/boot/robot_install.sh b/boot/robot_install.sh index caf5bef4..3447a01f 100644 --- a/boot/robot_install.sh +++ b/boot/robot_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -93,7 +95,7 @@ resolvconf -u mkdir -p /opt/eteshare/logs mkdir -p /opt/eteshare/config cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/testsuite/properties.git testsuite/properties +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO testsuite/properties # Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes if [[ $CLOUD_ENV != "rackspace" ]] 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 59d6c836..2c32266c 100644 --- a/boot/asdc_install.sh +++ b/boot/sdc_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -70,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 @@ -116,7 +118,7 @@ chmod 777 /data chmod 777 /data/logs/BE chmod 777 /data/logs/FE -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/sdc.git +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO cat > /root/.bash_aliases << EOF alias dcls='/data/scripts/docker_clean.sh \$1' @@ -138,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 88148764..3b5c5cfa 100644 --- a/boot/sdnc_install.sh +++ b/boot/sdnc_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -91,5 +93,5 @@ resolvconf -u # Clone Gerrit repository and run docker containers cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/sdnc/oam.git sdnc +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO sdnc ./sdnc_vm_init.sh
\ No newline at end of file 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/aai2_install.sh b/boot/so_install.sh index d2708018..d9a8a646 100644 --- a/boot/aai2_install.sh +++ b/boot/so_install.sh @@ -5,9 +5,10 @@ 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) -AAI_INSTANCE=$(cat /opt/config/aai_instance.txt) MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) +CODE_REPO=$(cat /opt/config/remote_repo.txt) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -48,20 +49,21 @@ 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/aai2_vm_init.sh -o /opt/aai2_vm_init.sh -curl -k $NEXUS_REPO/org.onap.demo/boot/$ARTIFACTS_VERSION/aai2_serv.sh -o /opt/aai2_serv.sh -chmod +x /opt/aai2_vm_init.sh -chmod +x /opt/aai2_serv.sh -mv /opt/aai2_serv.sh /etc/init.d -update-rc.d aai2_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-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list +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 @@ -90,21 +92,23 @@ service docker restart echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head resolvconf -u -# Run docker containers +# Clone Gerrit repository cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/aai/test-config +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO test_lab +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 -if [[ $AAI_INSTANCE == "aai_instance_1" ]] +# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes +if [[ $CLOUD_ENV != "rackspace" ]] then - mkdir -p /opt/aai/logroot/AAI-RESOURCES - mkdir -p /opt/aai/logroot/AAI-TRAVERSAL - mkdir -p /opt/aai/logroot/AAI-ML - mkdir -p /opt/aai/logroot/AAI-SDB - mkdir -p /opt/aai/logroot/AAI-DRMS - mkdir -p /opt/aai/logroot/AAI-UI - chown -R 999:999 /opt/aai/logroot/AAI-RESOURCES /opt/aai/logroot/AAI-TRAVERSAL - - sleep 300 + 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 -./aai2_vm_init.sh
\ No newline at end of file +# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted +./so_vm_init.sh diff --git a/boot/aai2_serv.sh b/boot/so_serv.sh index add00097..d324447f 100644 --- a/boot/aai2_serv.sh +++ b/boot/so_serv.sh @@ -10,7 +10,7 @@ ### END INIT INFO dir="/opt" -cmd="./aai2_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 d9f775cc..118995c4 100644 --- a/boot/vid_install.sh +++ b/boot/vid_install.sh @@ -7,6 +7,7 @@ DNS_IP_ADDR=$(cat /opt/config/dns_ip_addr.txt) CLOUD_ENV=$(cat /opt/config/cloud_env.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) # Add host name to /etc/host to avoid warnings in openstack images if [[ $CLOUD_ENV != "rackspace" ]] @@ -47,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 @@ -91,5 +93,5 @@ resolvconf -u # Clone Gerrit repository and run docker containers cd /opt -git clone -b $GERRIT_BRANCH --single-branch http://gerrit.onap.org/r/vid.git +git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO ./vid_vm_init.sh
\ 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 + |