Add champ-service configuration 61/34061/2
authorMichael Arrastia <MArrasti@amdocs.com>
Mon, 5 Mar 2018 13:33:35 +0000 (13:33 +0000)
committerMichael Arrastia <MArrasti@amdocs.com>
Mon, 5 Mar 2018 15:05:15 +0000 (15:05 +0000)
Define environment specific configuration in champ-beans.xml
(test-config/champ-service/dynamic/conf/champ-beans.xml):
Graph host:
  key="storage.hostname" value="aai.hbase.simpledemo.onap.org"
Graph port:
  key="storage.hbase.ext.hbase.zookeeper.property.clientPort"
  value="2181"
  key="storage.port" value="2181"
Event bus host:
  name="host" value="mr.api.simpledemo.openecomp.org:3904"

Change-Id: I7c9c029047dd402dcd4a9d4023c33c532cf07e10
Issue-ID: AAI-815
Signed-off-by: Michael Arrastia <MArrasti@amdocs.com>
champ-service/appconfig/auth/champ_policy.json [new file with mode: 0644]
champ-service/appconfig/auth/tomcat_keystore [new file with mode: 0644]
champ-service/appconfig/champ-api.properties [new file with mode: 0644]
champ-service/dynamic/conf/champ-beans.xml [new file with mode: 0644]
deploy_vm1.sh
docker-compose-app.yml

diff --git a/champ-service/appconfig/auth/champ_policy.json b/champ-service/appconfig/auth/champ_policy.json
new file mode 100644 (file)
index 0000000..a39a146
--- /dev/null
@@ -0,0 +1,18 @@
+{
+       "roles": [
+               {
+                       "name": "admin",
+                       "functions": [
+                               {
+                                       "name": "champ", "methods": [ { "name": "GET" },{ "name": "DELETE" }, { "name": "PUT" }, { "name": "POST" } ]
+                               }
+                       ],
+
+                       "users": [
+                               {
+                                       "username": "CN=ONAP, OU=ONAP, O=ONAP, L=Ottawa, ST=Ontario, C=CA"
+                               }
+                       ]
+               }
+       ]
+}
diff --git a/champ-service/appconfig/auth/tomcat_keystore b/champ-service/appconfig/auth/tomcat_keystore
new file mode 100644 (file)
index 0000000..9eec841
Binary files /dev/null and b/champ-service/appconfig/auth/tomcat_keystore differ
diff --git a/champ-service/appconfig/champ-api.properties b/champ-service/appconfig/champ-api.properties
new file mode 100644 (file)
index 0000000..9ad9b33
--- /dev/null
@@ -0,0 +1,7 @@
+Replace with your actual properties file. Should contain something like:
+
+keyName=aai-uuid
+sourceOfTruthName=source-of-truth
+createdTsName=aai-created-ts
+lastModTsName=aai-last-mod-ts
+collectionPropertiesKey=properties
\ No newline at end of file
diff --git a/champ-service/dynamic/conf/champ-beans.xml b/champ-service/dynamic/conf/champ-beans.xml
new file mode 100644 (file)
index 0000000..28b4d8c
--- /dev/null
@@ -0,0 +1,80 @@
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xsi:schemaLocation="
+       http://www.springframework.org/schema/beans
+       http://www.springframework.org/schema/beans/spring-beans.xsd
+       http://www.springframework.org/schema/util
+       http://www.springframework.org/schema/util/spring-util.xsd
+       ">
+
+
+    <bean id="champEventPublisher" class="com.att.ecomp.event.client.DMaaPEventPublisher">
+        <constructor-arg name="host" value="mr.api.simpledemo.openecomp.org:3904"/>
+        <constructor-arg name="topic" value="champRawEventsOnap"/>
+        <constructor-arg name="username" value="test"/>
+        <constructor-arg name="password" value="test"/>
+        <constructor-arg name="maxBatchSize" value="100"/>
+        <constructor-arg name="maxAgeMs" value="250"/>
+        <constructor-arg name="delayBetweenBatchesMs" value="50"/>
+        <constructor-arg name="transportType" value="HTTPAUTH"/>
+    </bean>
+
+    <!-- Graph Implementation Configuration-->
+    <util:map id="props" map-class="java.util.HashMap" key-type="java.lang.String" value-type="java.lang.Object">
+        <entry key="champcore.event.stream.buffer.capacity" value="50" value-type="java.lang.Integer"/>
+        <entry key="champcore.event.stream.publisher-pool-size" value="10" value-type="java.lang.Integer"/>
+        <entry key="champcore.event.stream.publisher" value-ref="champEventPublisher"/>
+
+        <entry key="graph.name" value="aaigraph-onap.dev"/>
+        <entry key="storage.backend" value="hbase"/>
+        <entry key="storage.hostname" value="aai.hbase.simpledemo.onap.org"/>
+
+        <!-- Hbase Config -->
+        <entry key="storage.hbase.ext.hbase.zookeeper.property.clientPort" value="2181"/>
+        <entry key="storage.hbase.ext.zookeeper.znode.parent" value="/hbase-unsecure"/>
+
+        <!-- Cassandra Config -->
+        <entry key="storage.port" value="2181"/>
+    </util:map>
+
+    <!-- Titan Implementation -->
+    <bean id="graphBuilder" class="org.onap.aai.champtitan.graph.impl.TitanChampGraphImpl$Builder">
+        <constructor-arg value="aaigraph-onap.dev"/>
+        <constructor-arg ref="props" />
+    </bean>
+    <bean id="graphImpl" class="org.onap.aai.champtitan.graph.impl.TitanChampGraphImpl">
+        <constructor-arg ref="graphBuilder" />
+    </bean>
+
+    <!-- Janus Implementation -->
+<!--
+    <bean id="graphBuilder" class="org.onap.aai.champjanus.graph.impl.JanusChampGraphImpl$Builder">
+        <constructor-arg value="<%= @CHAMP_GRAPH_NAME %>"/>
+        <constructor-arg ref="props"/>
+    </bean>
+    <bean id="graphImpl" class="org.onap.aai.champjanus.graph.impl.JanusChampGraphImpl">
+        <constructor-arg ref="graphBuilder"/>
+    </bean>
+-->
+
+    <bean id="champUUIDService" class="org.onap.champ.service.ChampUUIDService">
+        <constructor-arg name="graphImpl" ref="graphImpl"/>
+    </bean>
+
+    <bean id="cache" class="org.onap.champ.service.ChampTransactionCache">
+        <constructor-arg name="txTimeOutInSec" value="600"/>
+        <constructor-arg name="graphImpl" ref="graphImpl"/>
+    </bean>
+
+    <bean id="champDataService" class="org.onap.champ.service.ChampDataService">
+        <constructor-arg name="champUUIDService" ref="champUUIDService"/>
+        <constructor-arg name="graphImpl" ref="graphImpl"/>
+        <constructor-arg name="cache" ref="cache"/>
+    </bean>
+
+    <bean id="champRestService" class="org.onap.champ.ChampRESTAPI">
+        <constructor-arg name="champDataService" ref="champDataService"/>
+        <constructor-arg name="champAsyncRequestProcessor" ref="champAsyncRequestProcessor"/>
+    </bean>
+</beans>
\ No newline at end of file
index a5a25d2..2c1376b 100755 (executable)
@@ -13,6 +13,7 @@ export SEARCH_LOGS="/opt/aai/logroot/AAI-SEARCH";
 export DATA_ROUTER_LOGS="/opt/aai/logroot/AAI-DATA-ROUTER";
 export MODEL_LOADER_LOGS="/opt/aai/logroot/AAI-MODEL-LOADER";
 export UI_LOGS="/opt/aai/logroot/AAI-UI";
+export CHAMP_LOGS="/opt/aai/logroot/AAI-CHAMP-SERVICE";
 
 if [ ! -d "$RESOURCES_LOGS" ];
 then
@@ -50,6 +51,12 @@ then
     mkdir -p $UI_LOGS;
 fi;
 
+if [ ! -d "$CHAMP_LOGS" ];
+then
+    echo "Warning: Unable to find the volume directory $CHAMP_LOGS so creating it as regular directory";
+    mkdir -p $CHAMP_LOGS;
+fi;
+
 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1);
 export DOCKER_REGISTRY="${DOCKER_REGISTRY:-localhost:5000}";
 export AAI_HAPROXY_IMAGE="${AAI_HAPROXY_IMAGE:-aaionap/haproxy}";
@@ -121,6 +128,9 @@ docker tag $DOCKER_REGISTRY/onap/model-loader:$DOCKER_IMAGE_VERSION $DOCKER_REGI
 docker pull ${DOCKER_REGISTRY}/onap/sparky-be:${DOCKER_IMAGE_VERSION};
 docker tag $DOCKER_REGISTRY/onap/sparky-be:$DOCKER_IMAGE_VERSION $DOCKER_REGISTRY/onap/sparky-be:latest;
 
+docker pull ${DOCKER_REGISTRY}/onap/champ-service:${DOCKER_IMAGE_VERSION};
+docker tag $DOCKER_REGISTRY/onap/champ-service:$DOCKER_IMAGE_VERSION $DOCKER_REGISTRY/onap/champ-service:latest;
+
 # cleanup
 $DOCKER_COMPOSE_CMD stop
 $DOCKER_COMPOSE_CMD rm -f -v
@@ -149,6 +159,8 @@ $DOCKER_COMPOSE_CMD up -d sparky-be
 
 $DOCKER_COMPOSE_CMD up -d model-loader datarouter aai.searchservice.simpledemo.openecomp.org
 
+$DOCKER_COMPOSE_CMD up -d champ-service
+
 echo "A&AI Microservices are successfully started";
 
 crontab < /opt/test-config/aaicrontab
index 6a6ccff..912309f 100644 (file)
@@ -124,7 +124,32 @@ services:
       options:
         max-size: "30m"
         max-file: "5"
-        
+
+  champ-service:
+    image: ${DOCKER_REGISTRY}/onap/champ-service
+    hostname: champ-service
+    volumes:
+      - ${CHAMP_LOGS}:/logs
+      - /opt/test-config/champ-service/appconfig:/opt/app/champ-service/config
+      - /opt/test-config/champ-service/dynamic:/opt/app/champ-service/dynamic
+    ports:
+      - 9522:9522
+    environment:
+      - CONFIG_HOME=/opt/app/champ-service/config/
+      - KEY_STORE_PASSWORD=OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10
+      - KEY_MANAGER_PASSWORD=OBF:1y0q1uvc1uum1uvg1pil1pjl1uuq1uvk1uuu1y10
+      - AJSC_JETTY_ThreadCount_MIN=5
+      - AJSC_JETTY_ThreadCount_MAX=200
+      - AJSC_JETTY_BLOCKING_QUEUE_SIZE=200
+      - MAX_HEAP=1024
+      - SERVICE_BEANS=/opt/app/champ-service/dynamic/conf
+      - GRAPHIMPL=titan-deps
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "30m"
+        max-file: "5"
+
 networks:
   default:
       driver: bridge