Modifying code to point to AAIService Properties 81/7281/4
authorHector Anapan <ha076r@att.com>
Thu, 10 Aug 2017 08:25:53 +0000 (03:25 -0500)
committerPatrick Brady <pb071s@att.com>
Fri, 11 Aug 2017 19:25:36 +0000 (19:25 +0000)
Adding dblib.properties (mysql credential properties to the sdnctl db),
modifying setenv.sh (used to define property values to mysql
- such as authenticating against the MySQL DB's) and adding the
APPC_CONFIG_DIR env variable as part of the Dockerfile.

Patch: Reverted Unintentional changes to the docker-compose template.
Patch: Changed some formatting as per Marcus's suggestions

Change-Id: I7cf9d90405bb4d552779cd0cd8a4f01525bdd823
Signed-off-by: Hector Anapan <ha076r@att.com>
Issue: [APPC-129]

docker-compose/docker-compose.yml
installation/appc/src/main/docker/Dockerfile
installation/src/main/properties/dblib.properties [new file with mode: 0644]
platform-logic/appc/src/main/xml/APPC_chef.xml
platform-logic/appc/src/main/xml/APPC_method_ansible_adapter_1.0_2.0.1.xml
platform-logic/installer/src/main/scripts/setenv.sh

index 2087d60..d431e66 100644 (file)
@@ -15,12 +15,12 @@ services:
     environment:
       - MYSQL_ROOT_PASSWORD=openECOMP1.0
       - MYSQL_ROOT_HOST=%
-    logging:       
-      driver:   "json-file"
+    logging:
+      driver: "json-file"
       options:  
         max-size: "30m"
         max-file: "5"
-  
+
       
   appc:
     image: "openecomp/appc-image:latest"
@@ -41,17 +41,17 @@ services:
       - APPC_CONFIG_DIR=/opt/openecomp/appc/data/properties
       - DMAAP_TOPIC_ENV=SUCCESS
     logging:
-      driver:   "json-file"
+      driver: "json-file"
       options:
         max-size: "30m"
         max-file: "5"
-  
-  
+
+
   dgbuilder:
     image: "openecomp/dgbuilder-sdnc-image:latest"
     depends_on:
       - db
-    container_name:  sdnc_dgbuilder_container
+    container_name: sdnc_dgbuilder_container
     entrypoint:
        - "/bin/bash"
        - "-c"
@@ -67,8 +67,8 @@ services:
       - MYSQL_ROOT_PASSWORD=openECOMP1.0
       - SDNC_CONFIG_DIR=/opt/openecomp/sdnc/data/properties
       - APPC_CONFIG_DIR=/opt/openecomp/appc/data/properties
-    logging:       
-      driver:   "json-file"
-      options:  
+    logging:
+      driver: "json-file"
+      options:
         max-size: "30m"
         max-file: "5"
index 7be2093..535b2be 100644 (file)
@@ -2,10 +2,12 @@
 FROM openecomp/sdnc-image:1.1.2-SNAPSHOT
 MAINTAINER APP-C Team (appc@lists.openecomp.org)
 
-# copy openecomp
-COPY opt /opt
+# Set the Env. Variable in the container to add the APPC CONFIG DIR (the SDNC_CONFIG_DIR is inherited from SDNC Image)
+ENV APPC_CONFIG_DIR /opt/openecomp/appc/data/properties
 
+# Copy the opt folder to the container's /opt folder
+COPY opt /opt
 RUN ln -s /opt/openecomp/appc /opt/appc
 
-# ENTRYPOINT exec /opt/opendaylight/current/bin/karaf
+#Expose port 8181 for ODL REST calls
 EXPOSE 8181
diff --git a/installation/src/main/properties/dblib.properties b/installation/src/main/properties/dblib.properties
new file mode 100644 (file)
index 0000000..1523a37
--- /dev/null
@@ -0,0 +1,36 @@
+###
+# ============LICENSE_START=======================================================
+# APPC
+# ================================================================================
+# 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.properties
+org.openecomp.sdnc.sli.dbtype=jdbc
+
+org.openecomp.sdnc.sli.jdbc.hosts=sdnctldb01
+org.openecomp.sdnc.sli.jdbc.url=jdbc:mysql://dbhost:3306/sdnctl
+org.openecomp.sdnc.sli.jdbc.database=sdnctl
+org.openecomp.sdnc.sli.jdbc.user=sdnctl
+org.openecomp.sdnc.sli.jdbc.password=gamma
+org.openecomp.sdnc.sli.jdbc.connection.name=sdnctldb01
+org.openecomp.sdnc.sli.jdbc.connection.timeout=50
+org.openecomp.sdnc.sli.jdbc.request.timeout=100
+org.openecomp.sdnc.sli.jdbc.limit.init=10
+org.openecomp.sdnc.sli.jdbc.limit.min=10
+org.openecomp.sdnc.sli.jdbc.limit.max=20
+org.openecomp.dblib.connection.recovery=false
+
index 5e87526..7b7ecd5 100644 (file)
@@ -1,3 +1,23 @@
+<!--
+  ============LICENSE_START=======================================================
+  APPC
+  ================================================================================
+  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=========================================================
+  -->
+
 <service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='3.0.0'><method rpc='chef' mode='sync'>
 <block>
 <set>
 <parameter name='chef-organization' value='`$chef-organization`'/>
 </set><block>
 <execute plugin='org.openecomp.appc.adapter.chef.ChefAdapter' method='VnfcEnvironment' >
-<parameter name='organizations' value='`$chef-organization`'/> 
-<parameter name='serverAddress' value='`$chef-server-address`'/> 
-<parameter name='username' value='`$chef-username`'/> 
+<parameter name='organizations' value='`$chef-organization`'/>
+<parameter name='serverAddress' value='`$chef-server-address`'/>
+<parameter name='username' value='`$chef-username`'/>
 <parameter name='Environment' value='`$Environment`'/></execute><switch test='`$chefServerResult.code`'><outcome value='200'>
 <block>
 <execute plugin='org.openecomp.appc.adapter.chef.ChefAdapter' method='VnfcNodeobjects' >
-<parameter name='organizations' value='`$chef-organization`'/> 
-<parameter name='serverAddress' value='`$chef-server-address`'/> 
-<parameter name='username' value='`$chef-username`'/> 
+<parameter name='organizations' value='`$chef-organization`'/>
+<parameter name='serverAddress' value='`$chef-server-address`'/>
+<parameter name='username' value='`$chef-username`'/>
 <parameter name='NodeList' value='`$NodeList`'/>
 <parameter name='Node' value='`$Node`'/></execute><switch test='`$chefServerResult.code`'><outcome value='200'>
 <switch test='`$PushJobFlag`'>
 <return status='failure'>
 <parameter name='output.status.code' value='200' />
 <parameter name='output.status.message' value='`$chefServerResult.message`' />
-</return></outcome></switch></block></block></method></service-logic>
\ No newline at end of file
+</return></outcome></switch></block></block></method></service-logic>
index fcd7e7d..42a0645 100644 (file)
@@ -1,3 +1,23 @@
+<!--
+  ============LICENSE_START=======================================================
+  APPC
+  ================================================================================
+  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=========================================================
+  -->
+
 <service-logic xmlns='http://www.openecomp.org/sdnc/svclogic' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://www.openecomp.org/sdnc/svclogic ./svclogic.xsd' module='APPC' version='2.0.1'><method rpc='ansible-adapter-1.0' mode='sync'>
 <execute plugin='org.openecomp.appc.adapter.ansible.AnsibleAdapter' method='reqExec' >
 <parameter name='AgentUrl' value='`$AgentUrl`'/>
index ebf90d3..5484048 100644 (file)
 ###
 
 SDNC_CONFIG_DIR=${SDNC_CONFIG_DIR:-/opt/sdnc/data/properties}
+APPC_CONFIG_DIR=${APPC_CONFIG_DIR:-/opt/appc/data/properties}
 
-AAIURI=$(grep org.openecomp.sdnc.sli.aai.uri ${SDNC_CONFIG_DIR}/aaiclient.properties | grep -v '#' | cut -d'=' -f2)
+AAIURI=$(grep org.openecomp.sdnc.sli.aai.uri ${APPC_CONFIG_DIR}/aaiclient.properties | grep -v '#' | cut -d'=' -f2)
 
-MYSQL_USER=$(grep org.openecomp.sdnc.sli.jdbc.user ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2)
-MYSQL_PWD=$(grep org.openecomp.sdnc.sli.jdbc.password ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2)
-MYSQL_DB=$(grep org.openecomp.sdnc.sli.jdbc.database ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2)
-MYSQL_SERVER=$(grep org.openecomp.sdnc.sli.jdbc.hosts ${SDNC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2 | cut -d',' -f1)
+MYSQL_USER=$(grep org.openecomp.sdnc.sli.jdbc.user ${APPC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2)
+MYSQL_PWD=$(grep org.openecomp.sdnc.sli.jdbc.password ${APPC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2)
+MYSQL_DB=$(grep org.openecomp.sdnc.sli.jdbc.database ${APPCC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2)
+MYSQL_SERVER=$(grep org.openecomp.sdnc.sli.jdbc.hosts ${APPC_CONFIG_DIR}/dblib.properties | grep -v '#' | cut -d'=' -f2 | cut -d',' -f1)
 
 ODLUSER=$(grep controllerUser ${SDNC_CONFIG_DIR}/backup.properties | grep -v '#' | cut -d'=' -f2)
 ODLPWD=$(grep controllerPass ${SDNC_CONFIG_DIR}/backup.properties | grep -v '#' | cut -d'=' -f2)