Add code for R2MVP deployment 79/40879/4
authorLusheng Ji <lji@research.att.com>
Wed, 4 Apr 2018 03:18:58 +0000 (23:18 -0400)
committerLusheng Ji <lji@research.att.com>
Wed, 4 Apr 2018 03:43:47 +0000 (03:43 +0000)
Added code using a "dcae_deployment_profile" parameter to control
what kind of deployment for DCAE.  R1 is for ONAP Amsterdam deployment
(bootstrap installs Cloudify Manager then uses CM to deploy additional
VMs).  R2MVP is a new MVP deployment, with only service components such
as VES collector and supporting components.  All components are
deployed with their default configurations.  R2MVP does not support
dynamic depoyment of additional assets and configuration via CLAMP.

Issue-ID: DCAEGEN2-206
Change-Id: Ide51c780a45c23f33123d52f9df225b8715833d3
Signed-off-by: Lusheng Ji <lji@research.att.com>
boot/dcae2_install.sh [changed mode: 0644->0755]
boot/dcae2_vm_init.sh
heat/ONAP/onap_openstack.env
heat/ONAP/onap_openstack.yaml

old mode 100644 (file)
new mode 100755 (executable)
index 3c84c62..b59f06f
@@ -100,25 +100,52 @@ chmod 777 /opt/app/config/key
 # move keystone url file
 #cp /opt/config/keystone_url.txt /opt/app/config/keystone_url.txt
 
-# download blueprint input template files
-rm -rf /opt/app/inputs-templates
-mkdir -p /opt/app/inputs-templates
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/inputs.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/cdapinputs.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/phinputs.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/dhinputs.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/invinputs.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/vesinput.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/tcainputs.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/he-ip.yaml
-wget -P /opt/app/inputs-templates https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/input-templates/hr-ip.yaml
-
-
-# generate blueprint input files
-pip install --upgrade jinja2
-wget https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.deployments/releases/scripts/detemplate-bpinputs.py && (python detemplate-bpinputs.py /opt/config /opt/app/inputs-templates /opt/app/config; rm detemplate-bpinputs.py)
-
-
-# Run docker containers
-cd /opt
-./dcae2_vm_init.sh
+
+URL_ROOT='nexus.onap.org/service/local/repositories/raw/content'
+REPO_BLUEPRINTS='org.onap.dcaegen2.platform.blueprints' 
+REPO_DEPLOYMENTS='org.onap.dcaegen2.deployments' 
+
+if [ -e /opt/config/dcae_deployment_profile.txt ]; then
+  DEPLOYMENT_PROFILE=$(cat /opt/config/dcae_deployment_profile.txt)
+fi
+DEPLOYMENT_PROFILE=${DEPLOYMENT_PROFILE:-R1}
+if [ "$DEPLOYMENT_PROFILE" == "R1" ]; then
+  RELEASE_TAG='releases'
+  # download blueprint input template files
+  rm -rf /opt/app/inputs-templates
+  mkdir -p /opt/app/inputs-templates
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/inputs.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/cdapinputs.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/phinputs.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/dhinputs.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/invinputs.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/vesinput.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/tcainputs.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/he-ip.yaml
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_BLUEPRINTS}/${RELEASE_TAG}/input-templates/hr-ip.yaml
+
+
+  # generate blueprint input files
+  pip install --upgrade jinja2
+  wget https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/scripts/detemplate-bpinputs.py && \
+    (python detemplate-bpinputs.py /opt/config /opt/app/inputs-templates /opt/app/config; rm detemplate-bpinputs.py)
+
+  # Run docker containers
+  cd /opt
+  ./dcae2_vm_init.sh
+fi
+
+if [ "$DEPLOYMENT_PROFILE" == "R2MVP" ]; then
+  RELEASE_TAG='R2'
+  rm -rf /opt/app/inputs-templates
+  mkdir -p /opt/app/inputs-templates
+  wget -P /opt/app/inputs-templates https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/heat/${DEPLOYMENT_PROFILE}/docker-compose.yaml
+
+  pip install --upgrade jinja2
+  wget https://${URL_ROOT}/${REPO_DEPLOYMENTS}/${RELEASE_TAG}/scripts/detemplate-bpinputs.py && \
+    (python detemplate-bpinputs.py /opt/config /opt/app/inputs-templates /opt/app/config; rm detemplate-bpinputs.py)
+
+  cd /opt
+  ./dcae2_vm_init.sh
+fi
+
index c8ab317..581c0bf 100755 (executable)
@@ -597,7 +597,13 @@ list_dns_zone()
 
 
 
-
+URL_ROOT='nexus.onap.org/service/local/repositories/raw/content'
+REPO_BLUEPRINTS='org.onap.dcaegen2.platform.blueprints'
+REPO_DEPLOYMENTS='org.onap.dcaegen2.deployments'
+if [ -e /opt/config/dcae_deployment_profile.txt ]; then
+  DEPLOYMENT_PROFILE=$(cat /opt/config/dcae_deployment_profile.txt)
+fi
+DEPLOYMENT_PROFILE=${DEPLOYMENT_PROFILE:-R1}
 
 NEXUS_USER=$(cat /opt/config/nexus_username.txt)
 NEXUS_PASSWORD=$(cat /opt/config/nexus_password.txt)
@@ -610,14 +616,18 @@ MYLOCALIP=$(cat /opt/config/dcae_ip_addr.txt)
 
 # start docker image pulling while we are waiting for A&AI to come online
 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 pull nginx &
 
-#########################################
-# Wait for then register with A&AI
-########################################
 
-DNSAAS_PROXYED=$(tr '[:upper:]' '[:lower:]' < /opt/config/dnsaas_config_enabled.txt)
-if [ "$DNSAAS_PROXYED" == 'true' ]; then
+
+if [ "$DEPLOYMENT_PROFILE" == "R1" ]; then
+  docker pull "$NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION" && docker pull nginx &
+
+  #########################################
+  # Wait for then register with A&AI
+  ########################################
+
+  DNSAAS_PROXYED=$(tr '[:upper:]' '[:lower:]' < /opt/config/dnsaas_config_enabled.txt)
+  if [ "$DNSAAS_PROXYED" == 'true' ]; then
     echo "Using proxyed DNSaaS service, performing additional registration and configuration"
     wait_for_aai_ready
 
@@ -629,40 +639,35 @@ if [ "$DNSAAS_PROXYED" == 'true' ]; then
     wait_for_multicloud_ready
     register_dns_zone_proxied_designate "$ZONE" 
     echo "Registration and configuration for proxying DNSaaS completed."
-else
+  else
     echo "Using Designate DNSaaS service, performing additional registration and configuration"
     register_dns_zone_designate "$ZONE" 
-fi
-
-
-
+  fi
 
+  #########################################
+  # Start DCAE Bootstrap container
+  #########################################
 
-#########################################
-# Start DCAE Bootstrap container
-#########################################
+  chmod 777 /opt/app/config
+  rm -f /opt/config/runtime.ip.consul
+  rm -f /opt/config/runtime.ip.cm
 
-chmod 777 /opt/app/config
-rm -f /opt/config/runtime.ip.consul
-rm -f /opt/config/runtime.ip.cm
 
+  #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 -d --name boot -v /opt/app/config:/opt/app/installer/config -e "LOCATION=$ZONE" "$NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION"
 
-#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 -d --name boot -v /opt/app/config:/opt/app/installer/config -e "LOCATION=$ZONE" "$NEXUS_DOCKER_REPO/onap/org.onap.dcaegen2.deployments.bootstrap:$DOCKER_VERSION"
 
+  # waiting for bootstrap to complete then starting nginx for proxying healthcheck calls
+  echo "Waiting for Consul to become accessible"
+  while [ ! -f /opt/app/config/runtime.ip.consul ]; do echo "."; sleep 30; done
 
-# waiting for bootstrap to complete then starting nginx for proxying healthcheck calls
-echo "Waiting for Consul to become accessible"
-while [ ! -f /opt/app/config/runtime.ip.consul ]; do echo "."; sleep 30; done
 
+  # start proxy for consul's health check
+  CONSULIP=$(head -1 /opt/app/config/runtime.ip.consul | sed 's/[[:space:]]//g')
+  echo "Consul is available at $CONSULIP" 
 
-
-# start proxy for consul's health check
-CONSULIP=$(head -1 /opt/app/config/runtime.ip.consul | sed 's/[[:space:]]//g')
-echo "Consul is available at $CONSULIP" 
-
-cat >./nginx.conf <<EOL
+  cat >./nginx.conf <<EOL
 server {
     listen 80;
     server_name dcae.simpledemo.onap.org;
@@ -671,6 +676,15 @@ server {
     }
 }
 EOL
-docker run --name dcae-proxy -p 8080:80 -v "$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf" -d nginx
-echo "Healthcheck API available at http://${MYFLOATIP}:8080/healthcheck"
-echo "                          or http://${MYLOCALIP}:8080/healthcheck"
+  docker run --name dcae-proxy -p 8080:80 -v "$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf" -d nginx
+  echo "Healthcheck API available at http://${MYFLOATIP}:8080/healthcheck"
+  echo "                          or http://${MYLOCALIP}:8080/healthcheck"
+
+fi
+
+
+if [ "$DEPLOYMENT_PROFILE" == "R2MVP" ]; then
+  cd /opt/app/config
+  /opt/docker/docker-compose up -d
+fi
+
index 5798e16..546bd92 100644 (file)
@@ -100,6 +100,7 @@ parameters:
   #                         #
   ###########################
 
+  dcae_deployment_profile: PUT DCAE DEPLOYMENT PROFILE (R1 or R2MVP)
   dnsaas_config_enabled: PUT WHETHER TO USE PROXYED DESIGNATE
   dnsaas_region: PUT THE DESIGNATE PROVIDING OPENSTACK'S REGION HERE
   dnsaas_keystone_url: PUT THE DESIGNATE PROVIDING OPENSTACK'S KEYSTONE URL HERE
index 82ca78b..e48eec4 100644 (file)
@@ -216,6 +216,10 @@ parameters:
   #                         #
   ###########################
 
+  dcae_deployment_profile:
+    type: string
+    description: DCAE deployment profile.  Currently supported profiles R1, R2MVP.
+
   dnsaas_config_enabled:
     type: string
     description: whether the DNSaaS configuration section is enabled
@@ -1677,7 +1681,7 @@ resources:
     type: OS::Nova::Server
     properties:
       image: { get_param: ubuntu_1604_image }
-      flavor: { get_param: flavor_small }
+      flavor: { get_param: flavor_large }
       name:
         str_replace:
           template: base-dcae-bootstrap
@@ -1701,6 +1705,7 @@ resources:
             __nexus_username__: { get_param: nexus_username }
             __nexus_password__: { get_param: nexus_password }
             # conf for the ONAP environment where the DCAE bootstrap vm/conatiner runs
+            __dcae_deployment_profile__: { get_param: dcae_deployment_profile }
             __mac_addr__: { get_attr: [dcae_c_private_port, mac_address] }
             __dcae_ip_addr__: { get_param: dcae_ip_addr }
             __dcae_float_ip__: { get_attr: [dcae_c_floating_ip, floating_ip_address] }
@@ -1772,6 +1777,7 @@ resources:
             echo "__nexus_password__" > /opt/config/nexus_password.txt
             echo "__gerrit_branch__" > /opt/config/gerrit_branch.txt
             # conf for the ONAP environment where the DCAE bootstrap vm/conatiner runs
+            echo "__dcae_deployment_profile__" > /opt/config/dcae_deployment_profile.txt
             echo "__mac_addr__" > /opt/config/mac_addr.txt
             echo "__dcae_ip_addr__" > /opt/config/dcae_ip_addr.txt
             echo "__dcae_float_ip__" > /opt/config/dcae_float_ip.txt
@@ -1810,6 +1816,7 @@ resources:
             echo "__policy_ip_addr__" > /opt/config/policy_ip_addr.txt
             echo "__sdc_ip_addr__" > /opt/config/sdc_ip_addr.txt
             echo "__openo_ip_addr__" > /opt/config/openo_ip_addr.txt
+            echo "__openo_ip_addr__" > /opt/config/msb_ip_addr.txt
             echo "__aai1_ip_addr__" > /opt/config/aai1_ip_addr.txt
             echo "__aai2_ip_addr__" > /opt/config/aai2_ip_addr.txt
             # floating IPs