From c557d4315c112a4202777287c49023034833f77f Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Mon, 9 Oct 2017 11:05:50 -0400 Subject: [PATCH] Add missing ueb-listener docker container Add docker container for ueb-listener process Change-Id: I0892379367f1cb20cd892d668abed94d897d0eb5 Issue-ID: SDNC-116 Signed-off-by: Dan Timoney --- installation/pom.xml | 1 + installation/ueb-listener/pom.xml | 216 +++++++++++++++++++++ .../ueb-listener/src/main/docker/Dockerfile | 11 ++ .../ueb-listener/src/main/properties/artifact.map | 2 + .../src/main/properties/dblib.properties | 38 ++++ .../src/main/properties/log4j.properties | 37 ++++ .../src/main/properties/ueb-listener.properties | 21 ++ .../src/main/scripts/start-ueb-listener.sh | 52 +++++ 8 files changed, 378 insertions(+) create mode 100644 installation/ueb-listener/pom.xml create mode 100644 installation/ueb-listener/src/main/docker/Dockerfile create mode 100644 installation/ueb-listener/src/main/properties/artifact.map create mode 100644 installation/ueb-listener/src/main/properties/dblib.properties create mode 100644 installation/ueb-listener/src/main/properties/log4j.properties create mode 100755 installation/ueb-listener/src/main/properties/ueb-listener.properties create mode 100644 installation/ueb-listener/src/main/scripts/start-ueb-listener.sh diff --git a/installation/pom.xml b/installation/pom.xml index 1d9f97e4..7185d075 100644 --- a/installation/pom.xml +++ b/installation/pom.xml @@ -30,5 +30,6 @@ sdnc admportal + ueb-listener diff --git a/installation/ueb-listener/pom.xml b/installation/ueb-listener/pom.xml new file mode 100644 index 00000000..722840b1 --- /dev/null +++ b/installation/ueb-listener/pom.xml @@ -0,0 +1,216 @@ + + + + + org.onap.sdnc.oam + installation + 1.2.0-SNAPSHOT + + 4.0.0 + pom + installation-ueb-listener + 1.2.0-SNAPSHOT + + Installation - ueb-listener + Creates ueb-listener Docker container + + + onap/sdnc-ueb-listener-image + ${project.version} + 0.1.0-SNAPSHOT + ${https_proxy} + + + + + + + + + org.codehaus.groovy.maven + gmaven-plugin + + + validate + + execute + + + + println project.properties['sdnc.project.version']; + def versionArray; + if ( project.properties['sdnc.project.version'] != null ) { + versionArray = project.properties['sdnc.project.version'].split('\\.'); + } + + if (project.properties['sdnc.project.version'].endsWith("-SNAPSHOT")) + { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + } else { + project.properties['project.docker.latesttag.version']=versionArray[0] + '.' + versionArray[1] + "-STAGING-latest"; + } + + println 'New Tag for docker:' + + project.properties['project.docker.latesttag.version']; + + + + + + + + + + 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/onap/sdnc/ueb-listener/bin + + + src/main/scripts + + *.sh + + false + + + + + + + copy-properties + + copy-resources + + validate + + ${basedir}/target/docker-stage/opt/onap/sdnc/data/properties + + + src/main/properties + + * + + false + + + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + unpack + + unpack + + initialize + + + + org.onap.ccsdk.sli.northbound + ueb-listener + zip + ${ccsdk.project.version} + + + ${basedir}/target/docker-stage/opt/onap/sdnc/ueb-listener + bin/** + true + true + + + + + + + + + + + + + docker + + + + io.fabric8 + docker-maven-plugin + 0.16.5 + false + + + + ${image.name} + + try + ${basedir}/target/docker-stage + ${basedir}/target/docker-stage/Dockerfile + + ${project.version} + ${project.version}-STAGING-${maven.build.timestamp} + ${project.docker.latesttag.version} + + + + + + + + generate-images + package + + build + + + + + push-images + deploy + + build + push + + + + + + + + + + ONAP + + diff --git a/installation/ueb-listener/src/main/docker/Dockerfile b/installation/ueb-listener/src/main/docker/Dockerfile new file mode 100644 index 00000000..31025da8 --- /dev/null +++ b/installation/ueb-listener/src/main/docker/Dockerfile @@ -0,0 +1,11 @@ +# Base ubuntu with added packages needed for open ecomp +FROM onap/ccsdk-ubuntu-image:${project.version} +MAINTAINER SDNC Team (onap-sdnc@lists.onap.org) +ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 +ENV SDNC_CONFIG_DIR /opt/onap/sdnc/data/properties + + +# copy deliverables to opt +COPY opt /opt + + diff --git a/installation/ueb-listener/src/main/properties/artifact.map b/installation/ueb-listener/src/main/properties/artifact.map new file mode 100644 index 00000000..0256515f --- /dev/null +++ b/installation/ueb-listener/src/main/properties/artifact.map @@ -0,0 +1,2 @@ +vf-license-model,ASDC-API:vf-license-model-update,0 +bad-entry,0 diff --git a/installation/ueb-listener/src/main/properties/dblib.properties b/installation/ueb-listener/src/main/properties/dblib.properties new file mode 100644 index 00000000..9506ac8d --- /dev/null +++ b/installation/ueb-listener/src/main/properties/dblib.properties @@ -0,0 +1,38 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +# dblib.properrties +org.onap.ccsdk.sli.dbtype=jdbc + +org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01 +org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl +org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver +org.onap.ccsdk.sli.jdbc.database=sdnctl +org.onap.ccsdk.sli.jdbc.user=sdnctl +org.onap.ccsdk.sli.jdbc.password=gamma +org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01 +org.onap.ccsdk.sli.jdbc.connection.timeout=50 +org.onap.ccsdk.sli.jdbc.request.timeout=100 +org.onap.ccsdk.sli.jdbc.limit.init=10 +org.onap.ccsdk.sli.jdbc.limit.min=10 +org.onap.ccsdk.sli.jdbc.limit.max=20 +org.onap.dblib.connection.recovery=false + diff --git a/installation/ueb-listener/src/main/properties/log4j.properties b/installation/ueb-listener/src/main/properties/log4j.properties new file mode 100644 index 00000000..d556b659 --- /dev/null +++ b/installation/ueb-listener/src/main/properties/log4j.properties @@ -0,0 +1,37 @@ +### +# ============LICENSE_START======================================================= +# openECOMP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +log4j.rootLogger=INFO,CONSOLE,LOGFILE + +# CONSOLE is set to be a ConsoleAppender using a PatternLayout. +log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender +log4j.appender.CONSOLE.Threshold=ERROR +log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout +log4j.appender.CONSOLE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n + +# LOGFILE is set to be a File appender using a PatternLayout. +log4j.appender.LOGFILE=org.apache.log4j.RollingFileAppender +log4j.appender.LOGFILE.File=/opt/onap/sdnc/ueb-listener/logs/ueb-listener.log +log4j.appender.LOGFILE.Append=true +log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout +log4j.appender.LOGFILE.layout.ConversionPattern=%p %d{yyyy-MM-dd HH:mm:ss.SSS Z} %c{1} - %m%n +log4j.appender.LOGFILE.MaxFileSize=10MB +log4j.appender.LOGFILE.MaxBackupIndex=10 diff --git a/installation/ueb-listener/src/main/properties/ueb-listener.properties b/installation/ueb-listener/src/main/properties/ueb-listener.properties new file mode 100755 index 00000000..51e24961 --- /dev/null +++ b/installation/ueb-listener/src/main/properties/ueb-listener.properties @@ -0,0 +1,21 @@ +org.onap.ccsdk.sli.northbound.uebclient.asdc-address=c2.vm1.asdc.simpledemo.openecomp.org:8443 +org.onap.ccsdk.sli.northbound.uebclient.consumer-group=sdc-OpenSource-Env1-sdnc-dockero +org.onap.ccsdk.sli.northbound.uebclient.consumer-id=sdc-COpenSource-Env11-sdnc-dockero +org.onap.ccsdk.sli.northbound.uebclient.environment-name=AUTO +org.onap.ccsdk.sli.northbound.uebclient.password=sdnc +org.onap.ccsdk.sli.northbound.uebclient.user=sdnc +org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=admin +org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U +org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://sdnchost:8282/restconf/operations/ +org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace=org:onap:ccsdk +org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=/opt/onap/sdnc/ueb-listener/spool/incoming +org.onap.ccsdk.sli.northbound.uebclient.spool.archive=/opt/onap/sdnc/ueb-listener/spool/archive +org.onap.ccsdk.sli.northbound.uebclient.polling-interval=30 +org.onap.ccsdk.sli.northbound.uebclient.polling-timeout=15 +org.onap.ccsdk.sli.northbound.uebclient.client-startup-timeout=900 +org.onap.ccsdk.sli.northbound.uebclient.relevant-artifact-types=YANG_XML,VF_LICENSE,TOSCA_TEMPLATE,TOSCA_CSAR,UCPE_LAYER_2_CONFIGURATION +org.onap.ccsdk.sli.northbound.uebclient.activate-server-tls-auth=false +org.onap.ccsdk.sli.northbound.uebclient.keystore-path= +org.onap.ccsdk.sli.northbound.uebclient.keystore-password= +org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list= +org.onap.ccsdk.sli.northbound.uebclient.artifact-map=/opt/onap/sdnc/data/properties/artifact.map \ No newline at end of file diff --git a/installation/ueb-listener/src/main/scripts/start-ueb-listener.sh b/installation/ueb-listener/src/main/scripts/start-ueb-listener.sh new file mode 100644 index 00000000..762d1bd6 --- /dev/null +++ b/installation/ueb-listener/src/main/scripts/start-ueb-listener.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +### +# ============LICENSE_START======================================================= +# ONAP : SDN-C +# ================================================================================ +# Copyright (C) 2017 AT&T Intellectual Property. All rights +# reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +### + +PROPERTY_DIR=${PROPERTY_DIR:-/opt/onap/sdnc/data/properties} + + +LISTENER=ueb-listener + +UEBLISTENERROOT=${UEBLISTENERROOT:-/opt/onap/sdnc/ueb-listener} +JAVA_HOME=${JAVA_HOME:-/usr/lib/jvm/java-7-oracle} +JAVA_OPTS=${JAVA_OPTS:--Dhttps.protocols=TLSv1.1,TLSv1.2} +JAVA=${JAVA:-${JAVA_HOME}/bin/java} + +# Redirect output from script to $LISTENER.out +exec >> ${UEBLISTENERROOT}/logs/$LISTENER.out +exec 2>&1 + + +if [ ! -d ${UEBLISTENERROOT}/logs ] +then + mkdir ${UEBLISTENERROOT}/logs +fi + +for file in ${UEBLISTENERROOT}/lib/*.jar +do + LISTENERCLASSPATH=$LISTENERCLASSPATH:$file +done + +exec ${JAVA} ${JAVA_OPTS} -jar ${UEBLISTENERROOT}/lib/ueb-listener*.jar -Dlog4j.configuration=file:${UEBLISTENERROOT}/lib/log4j.properties -cp ${LISTENERCLASSPATH} & + + + -- 2.16.6