get latest amsterdam maven coordinates from nexus 83/48783/1
authorJorge Hernandez <jh1730@att.com>
Wed, 23 May 2018 18:59:50 +0000 (13:59 -0500)
committerJorge Hernandez <jh1730@att.com>
Wed, 23 May 2018 18:59:50 +0000 (13:59 -0500)
- latest coordinates will be set to the controller
  for failure and scale out case so to not require
  manual operation.
- reduce the replicat count to 2 to make life easier
  to testers, and since should be expected to
  support enough performance testing.
- fix aai so urls.

Change-Id: I5d0d6d6c1c8242944d9d56601c5d463e790df900
Issue-ID: OOM-1104
Signed-off-by: Jorge Hernandez <jh1730@att.com>
kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf
kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh
kubernetes/policy/charts/drools/templates/statefulset.yaml
kubernetes/policy/charts/drools/values.yaml

index 9202b0a..1236176 100644 (file)
@@ -78,13 +78,13 @@ DMAAP_SERVERS=message-router
 
 # AAI
 
-AAI_URL=https://aai.api.simpledemo.openecomp.org:8443
+AAI_URL=https://aai.{{.Release.Namespace}}:8443
 AAI_USERNAME=POLICY
 AAI_PASSWORD=POLICY
 
 # MSO
 
-SO_URL=http://mso:8080/ecomp/mso/infra
+SO_URL=http://so.{{.Release.Namespace}}:8080/ecomp/mso/infra
 SO_USERNAME=InfraPortalClient
 SO_PASSWORD=password1$
 
index 5470007..218cd8a 100644 (file)
@@ -1,4 +1,4 @@
-#! /bin/bash
+#! /bin/bash -xv
 
 # Copyright © 2017-2018 Amdocs, Bell Canada, AT&T
 #
 # limitations under the License.
 
 
-${POLICY_HOME}/bin/features enable healthcheck
-${POLICY_HOME}/bin/features enable pooling-dmaap
-${POLICY_HOME}/bin/features enable distributed-locking
+"${POLICY_HOME}"/bin/features enable healthcheck
+"${POLICY_HOME}"/bin/features enable pooling-dmaap
+"${POLICY_HOME}"/bin/features enable distributed-locking
 
-${POLICY_HOME}/bin/db-migrator -s pooling -o upgrade
+"${POLICY_HOME}"/bin/db-migrator -s pooling -o upgrade
+
+# make sure the PDPD-CONFIGURATION anonymous topic is created
+# so not to lose any configuration updates
+
+echo
+echo "creating PDPD-CONFIGURATION topic"
+echo
+
+curl --silent --connect-timeout 60 -X POST --header "Content-Type: application/json" -d "{}"   http://message-router:3904/events/PDPD-CONFIGURATION
+
+echo
+echo "removing PDPD-CONFIGURATION topic dummy message"
+echo
+
+curl --silent --connect-timeout 60 -X GET http://message-router:3904/events/PDPD-CONFIGURATION/1/1?timeout=15000
+
+# for resiliency/scalability scenarios, check to see
+# if there's an amsterdam artifact  already deployed
+# by brmsgw.  If so, update the amsterdam controller
+# coordinates.  In the future, a more sophisticated
+# solution will be put in place, that will required
+# coordination among policy components.
+
+echo
+echo "checking if there are amsterdam policies already deployed .."
+echo
+
+AMSTERDAM_VERSION=$(curl --silent --connect-timeout 60 -X GET "http://nexus:8081/nexus/service/local/artifact/maven/resolve?r=releases&g=org.onap.policy-engine.drools.amsterdam&a=policy-amsterdam-rules&v=RELEASE" | grep -Po "(?<=<version>).*(?=</version>)")
+
+if [[ -z ${AMSTERDAM_VERSION} ]]; then
+       echo "no amsterdam policies have been found .."
+       exit 0
+fi
+
+echo
+echo "The latest deployed amsterdam artifact in nexus has version ${AMSTERDAM_VERSION}"
+echo
+
+sed -i.INSTALL -e "s/^rules.artifactId=.*/rules.artifactId=policy-amsterdam-rules/g" \
+               -e "s/^rules.groupId=.*/rules.groupId=org.onap.policy-engine.drools.amsterdam/g" \
+               -e "s/^rules.version=.*/rules.version=${AMSTERDAM_VERSION}/g" "${POLICY_HOME}"/config/amsterdam-controller.properties
+
+echo
+echo "amsterdam controller will be started brained with maven coordinates:"
+echo
+
+grep "^rules" "${POLICY_HOME}"/config/amsterdam-controller.properties
+
+echo
+echo
index 68b415e..71844f1 100644 (file)
@@ -51,10 +51,6 @@ spec:
         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
-      hostAliases:
-      - ip: "{{ .Values.config.aaiServiceClusterIp }}"
-        hostnames:
-        - "aai.api.simpledemo.openecomp.org"
       containers:
         - name: {{ include "common.name" . }}
           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
index 9ce8040..ca62f2b 100644 (file)
@@ -36,10 +36,9 @@ debugEnabled: false
 # application configuration
 config:
   nexusPort: 8081
-  aaiServiceClusterIp: 10.43.255.254
 
 # default number of instances
-replicaCount: 4
+replicaCount: 2
 
 nodeSelector: {}