From ee4c615ad3ba7fc41c71ec5cdf4a123f3c257fb9 Mon Sep 17 00:00:00 2001 From: Jerry Flood Date: Thu, 28 Mar 2019 05:51:38 -0400 Subject: Commit 1 for Define OPtimizer API mS Multiple commits required due to commit size limitation. Change-Id: I407ad479f3788dd4b8c783cbe4d615509cc9b2d1 Issue-ID: OPTFRA-437 Signed-off-by: Jerry Flood --- cmso-optimizer/etc/config/README.txt | 3 + cmso-optimizer/etc/config/cadi.properties | 21 + cmso-optimizer/etc/config/optimizer.properties | 47 ++ cmso-optimizer/pom.xml | 520 +++++++++++++++++++++ cmso-optimizer/src/main/docker/Dockerfile | 33 ++ .../src/main/docker/assembly/cmso-files.xml | 64 +++ .../src/main/docker/extra-files/startService.sh | 7 + 7 files changed, 695 insertions(+) create mode 100644 cmso-optimizer/etc/config/README.txt create mode 100644 cmso-optimizer/etc/config/cadi.properties create mode 100644 cmso-optimizer/etc/config/optimizer.properties create mode 100644 cmso-optimizer/pom.xml create mode 100644 cmso-optimizer/src/main/docker/Dockerfile create mode 100644 cmso-optimizer/src/main/docker/assembly/cmso-files.xml create mode 100644 cmso-optimizer/src/main/docker/extra-files/startService.sh (limited to 'cmso-optimizer') diff --git a/cmso-optimizer/etc/config/README.txt b/cmso-optimizer/etc/config/README.txt new file mode 100644 index 0000000..f815955 --- /dev/null +++ b/cmso-optimizer/etc/config/README.txt @@ -0,0 +1,3 @@ +The files in this etc/config folder are here for testing locally on eclipse. + +The files actually deployed are elsewhere diff --git a/cmso-optimizer/etc/config/cadi.properties b/cmso-optimizer/etc/config/cadi.properties new file mode 100644 index 0000000..9a6b91c --- /dev/null +++ b/cmso-optimizer/etc/config/cadi.properties @@ -0,0 +1,21 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START============================================== +# Copyright (c) 2019 AT&T Intellectual Property. +# ======================================================================= +# 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================================================= +# +#------------------------------------------------------------------------------- +cadi_loglevel=DEBUG +cadi_prop_files=src/main/resources/aaf/org.onap.oof.props + diff --git a/cmso-optimizer/etc/config/optimizer.properties b/cmso-optimizer/etc/config/optimizer.properties new file mode 100644 index 0000000..7dc75f5 --- /dev/null +++ b/cmso-optimizer/etc/config/optimizer.properties @@ -0,0 +1,47 @@ +#------------------------------------------------------------------------------- +# ============LICENSE_START============================================== +# Copyright (c) 2019 AT&T Intellectual Property. +# ======================================================================= +# 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================================================= +# +#------------------------------------------------------------------------------- +### + +### MySQL DB. +spring.datasource.url=jdbc:mariadb://localhost:3306/optimizer +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver +spring.datasource.username=root +spring.datasource.password=beer +cmso.database.password=beer + +spring.datasource.initialize=false +spring.datasource.tomcat.max-wait=10000 +spring.datasource.tomcat.initialSize=5 +spring.datasource.tomcat.max-active=25 +spring.datasource.tomcat.test-on-borrow=true + +spring.jpa.show-sql=true +spring.jpa.hibernate.ddl-auto=none +spring.jpa.hibernate.naming.strategy=org.hibernate.cfg.EJB3NamingStrategy +spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect +spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl +spring.jpa.hibernate.id.new_generator_mappings=false +hibernate.id.new_generator_mappings=false + +logging.level.org.hibernate.SQL=TRACE + +logging.level.org.hibernate=TRACE + + +cmso.topology.create.request.url=http://127.0.0.1:7998/topology/v1/current diff --git a/cmso-optimizer/pom.xml b/cmso-optimizer/pom.xml new file mode 100644 index 0000000..afa75f2 --- /dev/null +++ b/cmso-optimizer/pom.xml @@ -0,0 +1,520 @@ + + + + + + 4.0.0 + + + org.onap.optf.cmso + cmso + 1.0.1-SNAPSHOT + + + org.onap.optf.cmso.optimizer + cmso-optimizer + + jar + + cmso + + + yyyyMMdd'T'HHmmss'Z' + + ${project.version} + ${maven.build.timestamp} + + cmso + Dublin + org.onap.optf.cmso + cmso + + 1.8 + 1.0.0 + 3.3.9 + 5.0.10.RELEASE + 2.1.3.RELEASE + 2.0.0 + + 1.8 + 1.8 + ${maven.build.timestamp} + UTF-8 + UTF-8 + yyyyMMdd'T'HHmmss'Z' + 2.2.1 + ${basedir}/src/main/resources/META-INF/resources/swagger/ + 2.1.4 + + + 2.0.7 + java + ${basedir}/target/jacoco_report + ${basedir}/target/jacoco_itReport + reuseReports + jacoco + ${basedir}/target/jacoco-ut.exec + ${basedir}/target/jacoco-it.exec + ${basedir}/target/surefire-reports + ${basedir}/target/failsafe-reports + + localhost:5000 + nexus3.onap.org:10001 + false + false + false + false + + + + + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot.version} + pom + import + + + + + + + org.springframework.boot + spring-boot-starter-actuator + + + org.springframework.boot + spring-boot-starter-jersey + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-security + + + + org.springframework.boot + spring-boot-starter-data-jpa + + + org.springframework.boot + spring-boot-starter-tomcat + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + org.springframework.boot + spring-boot-starter-test + test + + + org.mockito + mockito-core + + + + + org.apache.httpcomponents + httpclient + + + org.springframework + spring-test + test + + + org.springframework + spring-aop + + + org.springframework + spring-beans + + + org.springframework + spring-beans + + + org.springframework + spring-context + + + org.springframework + spring-core + + + org.springframework + spring-expression + + + org.springframework + spring-web + + + org.springframework + spring-tx + + + org.springframework + spring-context-support + + + com.att.eelf + eelf-core + ${eelf.version} + + + org.mockito + mockito-core + + + org.powermock + powermock-module + + + org.powermock + powermock-api-mockito + + + org.powermock + powermock-module-junit4 + + + + + + + javax.ws.rs + javax.ws.rs-api + 2.1 + + + + + io.swagger.core.v3 + swagger-jaxrs2 + ${swagger.core.version} + + + io.swagger.core.v3 + swagger-jaxrs2-servlet-initializer + ${swagger.core.version} + + + + io.swagger + swagger-jersey2-jaxrs + 1.5.0 + + + + + + org.mariadb.jdbc + mariadb-java-client + + + + joda-time + joda-time + + + org.apache.commons + commons-text + 1.6 + + + + + org.mockito + mockito-all + 1.9.5 + test + + + org.jacoco + jacoco-maven-plugin + 0.8.1 + test + + + org.onap.aaf.authz + aaf-cadi-aaf + ${aaf.version} + + + + + cmso-optimizer + + + au.com.dius + pact-jvm-provider-maven_2.11 + ${pact.version} + + + ${BROKER_URL} + pactadmin + pactadmin + 1.0.0 + + + + core + http + ${APP_URL} + ${APP_PORT} + / + + ${BROKER_URL} + + pactadmin + pactadmin + + + + + + + + maven-dependency-plugin + + + com.github.kongchen + swagger-maven-plugin + 3.1.5 + + + + + org.onap.optf.cmso.optimizer.service.rs + + /optimizer + + ${project.artifactId} + ${project.version} + + ${swagger.directory} + + + + + + compile + + generate + + + + + + org.codehaus.groovy.maven + gmaven-plugin + 1.0 + + + validate + + execute + + + ${project.basedir}/src/main/script/TagVersion.groovy + + + + + + exec-maven-plugin + org.codehaus.mojo + + + org.springframework.boot + spring-boot-maven-plugin + ${spring.boot.version} + + + + repackage + + + + + + io.fabric8 + docker-maven-plugin + 0.26.0 + + true + 1.23 + + + onap/optf-cmso-tciketmgt + onap-optf-cmso-tciketmgt + + true + + latest + ${project.docker.latesttagtimestamp.version} + ${project.docker.latesttag.version} + + ${project.basedir}/src/main/docker/Dockerfile + + ${project.basedir}/src/main/docker/assembly/cmso-files.xml + onap-cmso-optimizer + + + + + + + + generate-images + install + + build + + + + push-images + deploy + + build + push + + + onap/optf-cmso-optimizer:%l + + + + + + + + + src/main/resources + true + + **/* + + + + etc/config + true + + **/* + + + + ${basedir}/truststore + ${basedir}/target/truststore + true + + **/* + + + + ${basedir}/bin + ${basedir}/target/bin + true + + **/* + + + + ${basedir}/data + ${basedir}/target/data + true + + **/* + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + com.github.kongchen + + + swagger-maven-plugin + + + [3.1.5] + + + generate + + + + + + + + + + + + + + + + + snapshot + + true + + + -${build.number}-${release-tag} + + + + next-stable + + -${release-tag} + + + + last-stable + + -${release-tag} + + + + diff --git a/cmso-optimizer/src/main/docker/Dockerfile b/cmso-optimizer/src/main/docker/Dockerfile new file mode 100644 index 0000000..9ef42ab --- /dev/null +++ b/cmso-optimizer/src/main/docker/Dockerfile @@ -0,0 +1,33 @@ +FROM ubuntu:16.04 + +MAINTAINER "The Onap Team" +LABEL Description="This image contains ubuntu 16.04 with the openjdk installed" Version="16.04-8" +ENV APP_HOME=/opt/app/cmso +ARG http_proxy +ARG https_proxy +ENV HTTP_PROXY=$http_proxy +ENV HTTPS_PROXY=$https_proxy +ENV http_proxy=$HTTP_PROXY +ENV https_proxy=$HTTPS_PROXY + +RUN test -n "$http_proxy" && echo "Acquire::Proxy \"http://$http_proxy\";" > /etc/apt/apt.conf.d/02proxy || true && \ + apt-get update && \ + apt-get -y dist-upgrade && \ + apt-get install -y openjdk-8-jre-headless + +COPY onap-cmso-optimizer/cmso-optimizer.jar ${APP_HOME}/app.jar + +VOLUME /share/etc +VOLUME /share/logs +VOLUME /share/debug-logs + +COPY onap-cmso-optimizer/startService.sh ${APP_HOME}/startService.sh +COPY onap-cmso-optimizer/data ${APP_HOME}/data + +RUN chmod 700 ${APP_HOME}/startService.sh +RUN ln -s /share/etc ${APP_HOME}/etc +RUN ln -s /share/logs ${APP_HOME}/logs +RUN ln -s /share/debug-logs ${APP_HOME}/debug-logs + +WORKDIR ${APP_HOME} +ENTRYPOINT ./startService.sh diff --git a/cmso-optimizer/src/main/docker/assembly/cmso-files.xml b/cmso-optimizer/src/main/docker/assembly/cmso-files.xml new file mode 100644 index 0000000..37804ec --- /dev/null +++ b/cmso-optimizer/src/main/docker/assembly/cmso-files.xml @@ -0,0 +1,64 @@ + + + + cmso-files + + + tar.gz + + false + + + + + + + ${project.build.finalName}.jar + + ${project.build.directory} + / + + + + ** + + src/main/docker/extra-files + / + + + + ** + + data + /data + + + ${project.basedir}/src/main/resources + ./resources + + **/* + + + + ${project.basedir}/etc/config + ./ + + **/* + + + + + + diff --git a/cmso-optimizer/src/main/docker/extra-files/startService.sh b/cmso-optimizer/src/main/docker/extra-files/startService.sh new file mode 100644 index 0000000..199c637 --- /dev/null +++ b/cmso-optimizer/src/main/docker/extra-files/startService.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +VM_ARGS="${VM_ARGS} -Dserver.local.startpath=${RESOURCES_HOME}" + +echo "VM_ARGS="${VM_ARGS} + +java -Djava.security.egd=file:/dev/./urandom ${VM_ARGS} -Xms256m -Xmx1024m -jar ./app.jar -- cgit 1.2.3-korg