Multiple fixes & enhancement
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Sat, 9 Feb 2019 23:33:55 +0000 (18:33 -0500)
committerAlexis de Talhouët <adetalhouet89@gmail.com>
Tue, 12 Feb 2019 18:02:59 +0000 (13:02 -0500)
- Rework docker image build
- Fix compress function
- Fix node type name for source-primary-db

Change-Id: Ide38e17036e76047d9f850b714ba0da4add5cd9d
Issue-ID: CCSDK-414
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
ms/blueprintsprocessor/application/etc/logback.xml [deleted file]
ms/blueprintsprocessor/application/opt/app/onap/config/application.properties
ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml [deleted file]
ms/blueprintsprocessor/application/src/main/resources/application.properties
ms/blueprintsprocessor/distribution/src/main/dc/docker-compose.yaml
ms/blueprintsprocessor/distribution/src/main/docker/Dockerfile
ms/blueprintsprocessor/distribution/src/main/docker/distribution.xml
ms/blueprintsprocessor/distribution/src/main/docker/run.source [moved from ms/blueprintsprocessor/application/etc/run.source with 100% similarity]
ms/blueprintsprocessor/distribution/src/main/docker/startService.sh

diff --git a/ms/blueprintsprocessor/application/etc/logback.xml b/ms/blueprintsprocessor/application/etc/logback.xml
deleted file mode 100755 (executable)
index a97bb8c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--\r
-  ~  Copyright © 2017-2018 AT&T Intellectual Property.\r
-  ~\r
-  ~  Licensed under the Apache License, Version 2.0 (the "License");\r
-  ~  you may not use this file except in compliance with the License.\r
-  ~  You may obtain a copy of the License at\r
-  ~\r
-  ~      http://www.apache.org/licenses/LICENSE-2.0\r
-  ~\r
-  ~  Unless required by applicable law or agreed to in writing, software\r
-  ~  distributed under the License is distributed on an "AS IS" BASIS,\r
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  ~  See the License for the specific language governing permissions and\r
-  ~  limitations under the License.\r
-  -->\r
-\r
-<configuration>\r
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-        <!-- encoders are assigned the type\r
-             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->\r
-        <encoder>\r
-            <pattern>%d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n</pattern>\r
-        </encoder>\r
-    </appender>\r
-\r
-\r
-    <logger name="org.springframework" level="info"/>\r
-    <logger name="org.springframework.web" level="info"/>\r
-    <logger name="org.hibernate" level="error"/>\r
-    <logger name="org.onap.ccsdk.apps" level="info"/>\r
-\r
-    <root level="warn">\r
-        <appender-ref ref="STDOUT"/>\r
-    </root>\r
-\r
-</configuration>\r
index 37a5708..e69de29 100755 (executable)
@@ -1,40 +0,0 @@
-#\r
-#  Copyright � 2017-2018 AT&T Intellectual Property.\r
-#  Modifications Copyright © 2019 Bell Canada.\r
-#\r
-#  Licensed under the Apache License, Version 2.0 (the "License");\r
-#  you may not use this file except in compliance with the License.\r
-#  You may obtain a copy of the License at\r
-#\r
-#      http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-#  Unless required by applicable law or agreed to in writing, software\r
-#  distributed under the License is distributed on an "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-#  See the License for the specific language governing permissions and\r
-#  limitations under the License.\r
-#\r
-#logging.level.web=DEBUG\r
-\r
-# Web server config\r
-server.port=8080\r
-\r
-blueprintsprocessor.grpcEnable=false\r
-blueprintsprocessor.httpPort=8080\r
-blueprintsprocessor.grpcPort=9111\r
-# Blueprint Processor File Execution and Handling Properties\r
-blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy\r
-blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive\r
-# Primary Database Configuration\r
-blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl\r
-blueprintsprocessor.db.primary.username=sdnctl\r
-blueprintsprocessor.db.primary.password=sdnctl\r
-blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver\r
-blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=validate\r
-blueprintsprocessor.db.primary.hibernateDDLAuto=none\r
-blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy\r
-blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect\r
-\r
-# Python executor\r
-blueprints.processor.functions.python.executor.executionPath=/opt/app/onap/scripts/jython\r
-blueprints.processor.functions.python.executor.modulePaths=/opt/app/onap/scripts/jython
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml b/ms/blueprintsprocessor/application/opt/app/onap/config/logback.xml
deleted file mode 100755 (executable)
index a97bb8c..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-<!--\r
-  ~  Copyright © 2017-2018 AT&T Intellectual Property.\r
-  ~\r
-  ~  Licensed under the Apache License, Version 2.0 (the "License");\r
-  ~  you may not use this file except in compliance with the License.\r
-  ~  You may obtain a copy of the License at\r
-  ~\r
-  ~      http://www.apache.org/licenses/LICENSE-2.0\r
-  ~\r
-  ~  Unless required by applicable law or agreed to in writing, software\r
-  ~  distributed under the License is distributed on an "AS IS" BASIS,\r
-  ~  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-  ~  See the License for the specific language governing permissions and\r
-  ~  limitations under the License.\r
-  -->\r
-\r
-<configuration>\r
-    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">\r
-        <!-- encoders are assigned the type\r
-             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->\r
-        <encoder>\r
-            <pattern>%d{HH:mm:ss.SSS} %-5level %logger{100} - %msg%n</pattern>\r
-        </encoder>\r
-    </appender>\r
-\r
-\r
-    <logger name="org.springframework" level="info"/>\r
-    <logger name="org.springframework.web" level="info"/>\r
-    <logger name="org.hibernate" level="error"/>\r
-    <logger name="org.onap.ccsdk.apps" level="info"/>\r
-\r
-    <root level="warn">\r
-        <appender-ref ref="STDOUT"/>\r
-    </root>\r
-\r
-</configuration>\r
index a7ffc42..d48aba5 100755 (executable)
@@ -1,41 +1,40 @@
-#\r
-#  Copyright � 2017-2018 AT&T Intellectual Property.\r
-#\r
-#  Modifications Copyright © 2019 IBM, Bell Canada.\r
-#\r
-#  Licensed under the Apache License, Version 2.0 (the "License");\r
-#  you may not use this file except in compliance with the License.\r
-#  You may obtain a copy of the License at\r
-#\r
-#      http://www.apache.org/licenses/LICENSE-2.0\r
-#\r
-#  Unless required by applicable law or agreed to in writing, software\r
-#  distributed under the License is distributed on an "AS IS" BASIS,\r
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-#  See the License for the specific language governing permissions and\r
-#  limitations under the License.\r
-#\r
-#logging.level.web=DEBUG\r
-\r
-# Web server config\r
-server.port=8080\r
-\r
-blueprintsprocessor.grpcEnable=false\r
-blueprintsprocessor.httpPort=8080\r
-blueprintsprocessor.grpcPort=9111\r
-# Blueprint Processor File Execution and Handling Properties\r
-blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy\r
-blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive\r
-# Primary Database Configuration\r
-blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl\r
-blueprintsprocessor.db.primary.username=sdnctl\r
-blueprintsprocessor.db.primary.password=sdnctl\r
-blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver\r
-blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=validate\r
-blueprintsprocessor.db.primary.hibernateDDLAuto=none\r
-blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy\r
-blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect\r
-\r
-# Python executor\r
-blueprints.processor.functions.python.executor.executionPath=/opt/app/onap/scripts/jython\r
+#
+#  Copyright � 2017-2018 AT&T Intellectual Property.
+#  Modifications Copyright © 2019 IBM, Bell Canada.
+#
+#  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.
+#
+#logging.level.web=DEBUG
+
+# Web server config
+server.port=8080
+
+blueprintsprocessor.grpcEnable=false
+blueprintsprocessor.httpPort=8080
+blueprintsprocessor.grpcPort=9111
+# Blueprint Processor File Execution and Handling Properties
+blueprintsprocessor.blueprintDeployPath=/opt/app/onap/blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=/opt/app/onap/blueprints/archive
+# Primary Database Configuration
+blueprintsprocessor.db.primary.url=jdbc:mysql://db:3306/sdnctl
+blueprintsprocessor.db.primary.username=sdnctl
+blueprintsprocessor.db.primary.password=sdnctl
+blueprintsprocessor.db.primary.driverClassName=org.mariadb.jdbc.Driver
+blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=none
+blueprintsprocessor.db.primary.hibernateDDLAuto=none
+blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy
+blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.MySQL5InnoDBDialect
+
+# Python executor
+blueprints.processor.functions.python.executor.executionPath=/opt/app/onap/scripts/jython
 blueprints.processor.functions.python.executor.modulePaths=/opt/app/onap/scripts/jython
\ No newline at end of file
index c0eade5..1e19744 100755 (executable)
@@ -22,9 +22,6 @@ services:
     ports:\r
     - "8000:8080"\r
     restart: always\r
-    volumes:\r
-    - ~/share/vm_ms/blueprintsprocessor/config:/opt/app/onap/config\r
-    - ~/share/vm_ms/blueprintsprocessor/logs:/logs\r
     environment:\r
       APPLICATIONNAME: BlueprintsProcessor\r
       BUNDLEVERSION: 1.0.0\r
index bd6bcb3..d3e10b7 100755 (executable)
@@ -3,19 +3,16 @@ FROM anapsix/alpine-java:8_jdk
 ENV HTTP_PROXY  ${HTTP_PROXY}
 ENV HTTPS_PROXY ${HTTPS_PROXY}
 
-RUN apk add --no-cache curl
-
+# add entrypoint
+COPY run.source /etc/run.source
 COPY startService.sh /startService.sh
 RUN chmod 777 /startService.sh && dos2unix /startService.sh
 
+# add application
 COPY @project.build.finalName@-@assembly.id@.tar.gz /source.tar.gz
-
-RUN (mkdir -p /source /opt/app/onap) && (tar -xzf /source.tar.gz -C /source) \
-&& (mv /source/@project.build.finalName@ /source/app) \
-&& (cp -rf /source/app/opt/app/onap/lib /opt/app/onap/) \
-&& (cp -rf /source/app/etc /) \
-&& (cp -rf /source/app/config /) \
-&& (cp -rf /source/app/scripts /opt/app/onap/) \
-&& (rm -rf /source)
+RUN tar -xzf /source.tar.gz -C /tmp \
+ && cp -rf /tmp/@project.build.finalName@/opt / \
+ && rm -rf /source.tar.gz \
+ && rm -rf /tmp/@project.build.finalName@
 
 ENTRYPOINT /startService.sh
\ No newline at end of file
index f84ed2d..3137eb4 100755 (executable)
                 <include>application.properties</include>
                 <include>logback.xml</include>
             </includes>
-            <outputDirectory>./</outputDirectory>
+            <outputDirectory>/opt/app/onap/config</outputDirectory>
             <useDefaultExcludes>true</useDefaultExcludes>
         </fileSet>
         <fileSet>
-            <directory>${project.basedir}/src/main/docker</directory>
-            <includes>
-                <include>Dockerfile</include>
-                <include>startService.sh</include>
-            </includes>
-            <outputDirectory>./</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../application/src/main/resources</directory>
-            <outputDirectory>src/main/resources</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../application/opt/app/onap/config</directory>
-            <outputDirectory>./config</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../../../components/scripts/python/ccsdk_blueprints</directory>
-            <outputDirectory>./scripts/jython</outputDirectory>
-            <useDefaultExcludes>true</useDefaultExcludes>
-        </fileSet>
-        <fileSet>
-            <directory>${project.basedir}/../application/etc</directory>
-            <outputDirectory>./etc</outputDirectory>
+            <directory>${project.basedir}/../../../components/scripts/python</directory>
+            <outputDirectory>/opt/app/onap/scripts/jython</outputDirectory>
             <useDefaultExcludes>true</useDefaultExcludes>
         </fileSet>
     </fileSets>
index 5f75de8..8849715 100644 (file)
@@ -5,5 +5,4 @@ nodeName=BlueprintsProcessor_1.0.0_$(cat /proc/self/cgroup | grep docker | sed s
 echo "APP Config HOME : ${APP_CONFIG_HOME}"
 export APP_HOME=/opt/app/onap
 
-mv -rf /config /opt/app/onap/
 source /etc/run.source