From 835142575e76466d46e98fbf7e73c5b6d65a8afe Mon Sep 17 00:00:00 2001 From: Patrick Brady Date: Mon, 13 Feb 2017 11:57:08 -0800 Subject: Initial OpenECOMP appc/deployment commit Change-Id: I46850ced2a3ff7a55dd1e92ec4509bf728466ce9 Signed-off-by: Patrick Brady --- installation/README.md | 46 +++++ installation/appc/pom.xml | 228 +++++++++++++++++++++ installation/appc/src/main/docker/Dockerfile | 10 + .../appc/src/main/scripts/installFeatures.sh | 37 ++++ installation/appc/src/main/scripts/installZips.sh | 59 ++++++ installation/appc/src/main/scripts/startODL.sh | 73 +++++++ installation/pom.xml | 31 +++ .../src/main/appc-properties/appc.properties | 121 +++++++++++ .../main/stores/truststore.openecomp.client.jks | Bin 0 -> 3168 bytes 9 files changed, 605 insertions(+) create mode 100644 installation/README.md create mode 100644 installation/appc/pom.xml create mode 100644 installation/appc/src/main/docker/Dockerfile create mode 100644 installation/appc/src/main/scripts/installFeatures.sh create mode 100644 installation/appc/src/main/scripts/installZips.sh create mode 100644 installation/appc/src/main/scripts/startODL.sh create mode 100644 installation/pom.xml create mode 100644 installation/src/main/appc-properties/appc.properties create mode 100644 installation/src/main/stores/truststore.openecomp.client.jks (limited to 'installation') diff --git a/installation/README.md b/installation/README.md new file mode 100644 index 0000000..42d0e47 --- /dev/null +++ b/installation/README.md @@ -0,0 +1,46 @@ +# OpenECOMP APP-C - Available Properties + +--- +--- + +# Introduction + +The current list of properties that can be overwritten from all default.properties files to appc.properties (./src/main/appc-properties/appc.properties) are list below. Please note that some properties have default values since some code requires it to be defined as part of the building/compilation process. + +- NOTE: The only defined property values in appc.properties are the following: + - "appc.ClosedLoop1607.*" properties (needed for demo) + - "appc.provider.vfodl.url" property (needed for demo) + - "appc.service.logic.module.name" property (needed for demo) + - "appc.topology.dg.*" properties (needed for demo) + +# Properties List +The following properties are ready to be defined based on which feature needs to be tested or used: + +- provider1.* properties: + - Applies to the following features: appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle + - These properties need to be defined in order to use OpenStack-based API executions. For example, the APP-C function "restart" is in charge of restarting a VM when requested. Therefore, properties such as OpenStack credentials, tenant name, VM ID, and others pre-defined in the appc.properties need to be defined with the information of the OpenStack Environment you are deploying APP-C from. + +- dmaap.poolMembers property: + - Applies to the following features: appc-command-executor-core, appc-license-manager-core, appc-lifecycle-management-core, appc-request-handler-core, and appc-workflow-management-core (all part of the appc-dispatcher package) + - Defines the DMaaP IP or URL location of the DMaaP Pool Members involved in the DMaaP Communication of that feature in specific (NOTE: More than one Pool Member can be defined in the form of a comma-delimited list) + +- appc.ClosedLoop.* properties: + - Applies to the following feature: appc-event-listener-bundle (both in src/main and src/test) + - These properties define in which DMaaP will the appc-event-listener feature will listen in + +- appc.LCM.* properties: + - Applies to the following feature: appc-event-listener-bundle (in src/test only) + - These properties define in which DMaaP will the appc-event-listener feature will listen in. These properties are especifically used to define LCM (LifeCycle Management) actions, and are only used as part of JUnit Test Cases. + +- test.* properties: + - Applies to the following features: appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle + - These are properties that test OpenStack-based APP-C API requests + +- appc.asdc.*: + - Applies to the following feature: appc-asdc-listener-bundle + - These properties are used to test integration between the SDC OpenECOMP component & APP-C. Properties such as pointing to the DMaaP listener & topic, SDC credentials to authenticate into the SDC component, define the RESTCONF URL, and others are mapped here. + +- Other properties: + - poolMembers, event.pool.members, restconf.user, restconf.pass + - Applies to the following features: appc-netconf-adapter-bundle, appc-dg-common, appc-dmaap-adapter-bundle + - These properties can be defined to use the features defined above. They are used to point to current DMaaP listener, and to define the RESTCONF credentials needed to execute APP-C API requests from the features impacted above. \ No newline at end of file diff --git a/installation/appc/pom.xml b/installation/appc/pom.xml new file mode 100644 index 0000000..fc8400a --- /dev/null +++ b/installation/appc/pom.xml @@ -0,0 +1,228 @@ + + + + + org.openecomp.appc.deployment + installation + 1.0.0 + + + 4.0.0 + pom + org.openecomp.appc.deployment + installation-appc + 1.0.0 + + Installation - APPC Docker + Creates APPC Docker container on top of the SDNC Base Docker Image + + + ecomp/appc-image + ${project.version} + + + + + + + io.fabric8 + docker-maven-plugin + 0.16.5 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + ${basedir}/target/docker-stage/Dockerfile + + ${project.version} + + + + + + + + + generate-images + generate-sources + + build + + + + + push-images + deploy + + build + push + + + + + + + + maven-resources-plugin + 2.6 + + + copy-dockerfile + + copy-resources + + validate + + ${basedir}/target/docker-stage + + + src/main/docker + + Dockerfile + + true + + + + + + + copy-scripts + + copy-resources + + validate + + ${basedir}/target/docker-stage/opt/openecomp/appc/bin + + + src/main/scripts + + *.sh + + false + + + + + + + + + + copy-properties + + copy-resources + + validate + + ${basedir}/target/docker-stage/opt/openecomp/appc/data/properties + + + ../src/main/appc-properties + + *.properties + + false + + + + + + + + exec-maven-plugin + org.codehaus.mojo + + + Get features + generate-sources + + exec + + + /bin/bash + + ${appc.version} + ${project.version} + ${project.version} + + + ${basedir}/src/main/scripts/installZips.sh + ${basedir}/target/docker-stage/opt/openecomp/appc + + + + + + change shell permissions + process-sources + + exec + + + /usr/bin/find + + ${basedir}/target/docker-stage/opt/openecomp/appc + -name + *.sh + -exec + chmod + +x + {} + ; + + + + + + + + + + openECOMP + + + diff --git a/installation/appc/src/main/docker/Dockerfile b/installation/appc/src/main/docker/Dockerfile new file mode 100644 index 0000000..82f04ba --- /dev/null +++ b/installation/appc/src/main/docker/Dockerfile @@ -0,0 +1,10 @@ +# Base ubuntu with added packages needed for open ecomp +FROM ecomp/sdnc-image:latest +MAINTAINER APP-C Team (appc@lists.openecomp.org) + +# copy openecomp +COPY opt /opt +RUN ln -s /opt/openecomp/appc /opt/appc + +# ENTRYPOINT exec /opt/opendaylight/current/bin/karaf +EXPOSE 8181 diff --git a/installation/appc/src/main/scripts/installFeatures.sh b/installation/appc/src/main/scripts/installFeatures.sh new file mode 100644 index 0000000..a10b4c1 --- /dev/null +++ b/installation/appc/src/main/scripts/installFeatures.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +APPC_FEATURE_DIR=${APPC_FEATURE_DIR:-${APPC_HOME}/features} + +APPC_FEATURES=" \ + appc-iaas-adapter \ + appc-provider \ + appc-event-listener \ + appc-dispatcher \ + appc-chef-adapter \ + appc-netconf-adapter \ + appc-rest-adapter \ + appc-dmaap-adapter \ + appc-dg-util \ + appc-metric \ + appc-dg-shared \ + appc-asdc-listener" + +echo "Enabling core APP-C features" +${ODL_HOME}/bin/client -u karaf feature:install odl-netconf-connector-all +${ODL_HOME}/bin/client -u karaf feature:install odl-restconf-noauth +${ODL_HOME}/bin/client -u karaf feature:install odl-netconf-topology + +echo "Installing APP-C Features" +echo "" + +for feature in ${APPC_FEATURES} +do + if [ -f ${APPC_FEATURE_DIR}/${feature}/install-feature.sh ] + then + ${APPC_FEATURE_DIR}/${feature}/install-feature.sh + else + echo "No installer found for feature ${feature}" + fi +done diff --git a/installation/appc/src/main/scripts/installZips.sh b/installation/appc/src/main/scripts/installZips.sh new file mode 100644 index 0000000..9e4d330 --- /dev/null +++ b/installation/appc/src/main/scripts/installZips.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc} + +targetDir=${1:-${APPC_HOME}} +sdnc_targetDir=${1:-${SDNC_HOME}} + +featureDir=${targetDir}/features + +APPC_FEATURES=" \ + appc-iaas-adapter \ + appc-provider \ + appc-event-listener \ + appc-dispatcher \ + appc-chef-adapter \ + appc-netconf-adapter \ + appc-rest-adapter \ + appc-dmaap-adapter \ + appc-dg-util \ + appc-metric \ + appc-dg-shared \ + appc-asdc-listener" + +APPC_VERSION=${APPC_VERSION:-0.0.1} +APPC_OAM_VERSION=${APPC_OAM_VERSION:-0.1.1} + +if [ ! -d ${targetDir} ] +then + mkdir -p ${targetDir} +fi + +if [ ! -d ${featureDir} ] +then + mkdir -p ${featureDir} +fi + +cwd=$(pwd) + +mavenOpts=${2:-"-s $cwd/../../jenkins-settings.xml"} +cd /tmp + +echo "Installing APP-C version ${APPC_VERSION}" +for feature in ${APPC_FEATURES} +do + rm -f /tmp/${feature}-installer*.zip + mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc:${feature}-installer:${APPC_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true + unzip -d ${featureDir} /tmp/${feature}-installer*zip +done + +echo "Installing platform-logic for APP-C" +rm -f /tmp/platform-logic-installer*.zip +mvn -U ${mavenOpts} org.apache.maven.plugins:maven-dependency-plugin:2.9:copy -Dartifact=org.openecomp.appc.deployment:platform-logic-installer:${APPC_OAM_VERSION}:zip -DoutputDirectory=/tmp -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.ssl.insecure=true +unzip -d ${targetDir} /tmp/platform-logic-installer*.zip + +find ${targetDir} -name '*.sh' -exec chmod +x '{}' \; + +cd $cwd + diff --git a/installation/appc/src/main/scripts/startODL.sh b/installation/appc/src/main/scripts/startODL.sh new file mode 100644 index 0000000..00702e3 --- /dev/null +++ b/installation/appc/src/main/scripts/startODL.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +# Install SDN-C & APP-C platform components if not already installed and start container + +ODL_HOME=${ODL_HOME:-/opt/opendaylight/current} +ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} +SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc} +APPC_HOME=${APPC_HOME:-/opt/openecomp/appc} +SLEEP_TIME=${SLEEP_TIME:-120} +MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0} + +# +# Adding the DMAAP_TOPIC_ENV variable into APPC-ASDC-LISTENER properties +# +DMAAP_TOPIC_ENV=${DMAAP_TOPIC_ENV} + +if [ -z "$DMAAP_TOPIC_ENV" ] + then + echo "DMAAP_TOPIC_ENV shell variable is empty. Adding default value OS-ETE-DFW" + DMAAP_TOPIC_ENV="OS-ETE-DFW" + else + echo "DMAAP_TOPIC_ENV shell variable exists and it's $DMAAP_TOPIC_ENV" +fi + + +echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature" +echo "" >> $APPC_HOME/data/properties/appc.properties +echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties +echo "" >> $APPC_HOME/data/properties/appc.properties + + + +# +# Wait for database to init properly +# +echo "Waiting for mysql" +until mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql &> /dev/null +do + printf "." + sleep 1 +done +echo -e "\nmysql ready" + +if [ ! -f ${SDNC_HOME}/.installed ] +then + echo "Installing SDN-C database" + ${SDNC_HOME}/bin/installSdncDb.sh + echo "Starting OpenDaylight" + ${ODL_HOME}/bin/start + echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize" + sleep ${SLEEP_TIME} + echo "Installing SDN-C platform features" + ${SDNC_HOME}/bin/installFeatures.sh + if [ -x ${SDNC_HOME}/svclogic/bin/install.sh ] + then + echo "Installing directed graphs" + ${SDNC_HOME}/svclogic/bin/install.sh + fi + + echo "Installing APP-C platform features" + ${APPC_HOME}/bin/installFeatures.sh + if [ -x ${APPC_HOME}/svclogic/bin/install.sh ] + then + echo "Installing directed graphs for APP-C" + ${APPC_HOME}/svclogic/bin/install.sh + fi + + echo "Restarting OpenDaylight" + ${ODL_HOME}/bin/stop + echo "Installed at `date`" > ${SDNC_HOME}/.installed +fi + +exec ${ODL_HOME}/bin/karaf \ No newline at end of file diff --git a/installation/pom.xml b/installation/pom.xml new file mode 100644 index 0000000..4698e05 --- /dev/null +++ b/installation/pom.xml @@ -0,0 +1,31 @@ + + + + + org.openecomp.appc.deployment + appc-docker-project + 1.0.0 + + + 4.0.0 + pom + org.openecomp.appc.deployment + installation + 1.0.0 + + Installation + Installs APP-C on local file system + + + installation + yyMMdd-HHmmss + ${maven.build.timestamp} + UTF-8 + UTF-8 + + + + appc + + diff --git a/installation/src/main/appc-properties/appc.properties b/installation/src/main/appc-properties/appc.properties new file mode 100644 index 0000000..93025f1 --- /dev/null +++ b/installation/src/main/appc-properties/appc.properties @@ -0,0 +1,121 @@ +### ### +### Closed-Loop 1607 Properties (for demo) ### +### ### +appc.ClosedLoop1607.poolMembers=10.0.11.1:3904 +appc.ClosedLoop1607.topic.read=APPC-CL +appc.ClosedLoop1607.topic.write=APPC-CL +appc.ClosedLoop1607.client.name=APPC-TEST-CLIENT-DEMO-EXAMPLE +appc.ClosedLoop1607.client.name.id=0 +#dmaap.client.key=J6JsbtSm4By5CWAr +#dmaap.client.secret=kmadWKmItZTnajR9rBmcRCXG +appc.ClosedLoop1607.threads.queuesize.min=1 +appc.ClosedLoop1607.threads.queuesize.max=1000 +appc.ClosedLoop1607.threads.poolsize.min=1 +appc.ClosedLoop1607.threads.poolsize.max=2 +appc.ClosedLoop1607.provider.user=admin +appc.ClosedLoop1607.provider.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +appc.ClosedLoop1607.provider.url=http://localhost:8181/restconf/operations/appc-provider +appc.provider.vfodl.url=http://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@10.0.2.1:8282/restconf/config/network-topology:network-topology/topology/topology-netconf/node/NODE_NAME/yang-ext:mount/sample-plugin:sample-plugin/pg-streams/ + +# The properties right below are needed to properly call the Master DG to serve demo purposes +appc.service.logic.module.name=APPC +appc.topology.dg.method=topology-operation-all +appc.topology.dg.version=2.0.0 + + + + + +### ### +### OpenStack credentials (these properties also are used in appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle) ### +### ### +provider1.type=test +provider1.name=test +provider1.identity= +provider1.tenant1.name=test +provider1.tenant1.userid=test +provider1.tenant1.password=test + + + + + +### ### +### Properties that are not covered or being replaced from default.properties files. Default value for DMaaP IP is 10.0.11.1:3904 ### +### which is what the Master HEAT Template to instantiate OpenECOMP is pointing to (version R1). All other default values are ### +### left there since these are pre-defined as part of APP-C/OpenECOMP default instantiation with Master HEAT Template ### +### ### + + +# Property below is valid in appc-command-executor-core, appc-license-manager-core, appc-lifecycle-management-core, +# appc-request-handler-core, appc-workflow-management-core (all from the appc-dispatcher package). +dmaap.poolMembers=10.0.11.1:3904 + + +# appc-event-listener-bundle properties (DMaaP topics need to be defined in default.properties files in src/main and src/test). +appc.ClosedLoop.poolMembers=10.0.11.1:3904 +appc.ClosedLoop.client.key=testCL +appc.ClosedLoop.client.secret=testCL +appc.ClosedLoop.provider.url=https://admin:Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U@localhost:8443/restconf/operations/appc-provider:topology-operation +appc.ClosedLoop.provider.url.user=admin +appc.ClosedLoop.provider.url.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +test.vm_url= + + +# appc-event-listener-bundle properties (only defined in src/test of default.properties) +appc.LCM.poolMembers=10.0.11.1:3904 +appc.LCM.topic.read=testLCM +appc.LCM.topic.write=testLCM +appc.LCM.client.name=APPC-EVENT-LISTENER-TEST +appc.LCM.provider.user=admin +appc.LCM.provider.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + + +# properties from appc-netconf-adapter-bundle, appc-dg-common, appc-dmaap-adapter-bundle +poolMembers=10.0.11.1:3904 +event.pool.members=10.0.11.1:3904 +restconf.user=admin +restconf.pass=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U + + +# properties found in appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle) +#Your OpenStack IP +test.ip= +# Your OpenStack Platform's Keystone Port (default is 5000) +test.port= +test.tenantid=test +test.vmid=test +# Port 8774 below is default port for OpenStack's Nova API Service +test.url= + + +# Properties from default.properties in the src/test and src/main paths of appc-asdc-listener-bundle +appc.asdc.host=10.0.3.1:8443 +appc.asdc.env=APPC-ASDC-ENV +appc.asdc.user=test +appc.asdc.pass=test +appc.asdc.consumer=APPC-ASDC-CONSUMER +appc.asdc.consumer.id=APPC-ASDC-CONSUMER-ID +appc.asdc.provider.url=http://localhost:8181/restconf/operations/AsdcMessage:configuration-document-request + + + + + + + + + + + + + + + + + + + + + + diff --git a/installation/src/main/stores/truststore.openecomp.client.jks b/installation/src/main/stores/truststore.openecomp.client.jks new file mode 100644 index 0000000..6c854b4 Binary files /dev/null and b/installation/src/main/stores/truststore.openecomp.client.jks differ -- cgit 1.2.3-korg