Add docker configuration for Prometheus and Grafana 30/127030/8
authoradheli.tavares <adheli.tavares@est.tech>
Wed, 2 Feb 2022 14:53:10 +0000 (14:53 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Tue, 15 Feb 2022 16:50:14 +0000 (16:50 +0000)
- docker compose file with the policy components
- configuration files for components to allow usage of http
- basic prometheus configuration to connect to api, pap, drools (apps/pdp), xaclm and apex
- examples of metrics to be added to a dashboard in Grafana

Issue-ID: POLICY-3886
Change-Id: Ic377b69b1a296017a85cb08ccdbbf9b8b281d8e3
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
35 files changed:
csit/apex-pdp/plans/setup.sh
csit/apex-pdp/plans/teardown.sh
csit/api/plans/setup.sh
csit/api/plans/teardown.sh
csit/clamp/plans/setup.sh
csit/compose-grafana.yml [new file with mode: 0644]
csit/config/apex-pdp/OnapPfConfig.json
csit/config/api/apiParameters.yaml [new file with mode: 0644]
csit/config/distribution/defaultConfig.json
csit/config/drools-apps/custom/feature-lifecycle.properties
csit/config/drools-apps/env/base.conf
csit/config/drools/env/base.conf
csit/config/pap/papParameters.yaml
csit/config/sim-all/simParameters.json
csit/config/xacml-pdp/defaultConfig.json
csit/distribution/plans/setup.sh
csit/distribution/plans/teardown.sh
csit/drools-applications/plans/setup.sh
csit/drools-applications/plans/teardown.sh
csit/drools-pdp/plans/setup.sh
csit/drools-pdp/plans/teardown.sh
csit/get-branch.sh [moved from csit/get-branch-mariadb.sh with 92% similarity]
csit/get-models-examples.sh
csit/get-versions.sh [moved from csit/detmVers.sh with 69% similarity]
csit/metrics/policy-dashboard-example.json [new file with mode: 0644]
csit/metrics/prometheus.yml [new file with mode: 0644]
csit/pap/plans/setup.sh
csit/pap/plans/teardown.sh
csit/prepare-config-files.py [new file with mode: 0755]
csit/prepare-csit.sh
csit/run-project-csit.sh
csit/start-grafana.sh [new file with mode: 0755]
csit/stop-grafana.sh [new file with mode: 0755]
csit/xacml-pdp/plans/setup.sh
csit/xacml-pdp/plans/teardown.sh

index 2bde0ea..1320b52 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2018 Ericsson. All rights reserved.
 #
-#  Modifications copyright (c) 2019, 2021 Nordix Foundation.
+#  Modifications Copyright (c) 2019-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
 #  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
 # ================================================================================
@@ -20,7 +20,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
-source ${SCRIPTS}/get-branch-mariadb.sh
 
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
@@ -29,27 +28,27 @@ python3 -m pip install -U docker
 
 sudo apt-get -y install libxml2-utils
 
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d apex-pdp
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d apex-pdp
 
 unset http_proxy https_proxy
 
-POLICY_API_IP=`get-instance-ip.sh policy-api`
-POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
-MARIADB_IP=`get-instance-ip.sh mariadb`
-APEX_IP=`get-instance-ip.sh policy-apex-pdp`
-SIM_IP=`get-instance-ip.sh simulator`
+POLICY_API_IP=$(get-instance-ip.sh policy-api)
+POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
+APEX_IP=$(get-instance-ip.sh policy-apex-pdp)
+SIM_IP=$(get-instance-ip.sh simulator)
 export SIM_IP
 
-echo PAP IP IS ${POLICY_PAP_IP}
-echo MARIADB IP IS ${MARIADB_IP}
-echo API IP IS ${POLICY_API_IP}
-echo APEX IP IS ${APEX_IP}
-echo DMAAP_IP IS ${SIM_IP}
+echo PAP IP IS "${POLICY_PAP_IP}"
+echo MARIADB IP IS "${MARIADB_IP}"
+echo API IP IS "${POLICY_API_IP}"
+echo APEX IP IS "${APEX_IP}"
+echo DMAAP_IP IS "${SIM_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${APEX_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${APEX_IP}" 6969
 
 ROBOT_VARIABLES=""
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v SCRIPTS:${SCRIPTS}"
index f47fcd8..a44e3aa 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2018 Ericsson. All rights reserved.
 #
-#  Modifications copyright (c) 2019 Nordix Foundation.
+#  Modifications copyright (c) 2019-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,4 +20,9 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
+docker logs policy-api
+docker logs simulator
+docker logs policy-pap
+docker logs apex-pdp
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
index d20540d..c8346e3 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
-# Modification Copyright 2021. Nordix Foundation.
+# Modifications Copyright 2021-2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
-# Select branch
-source ${SCRIPTS}/get-branch-mariadb.sh
-
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
 python3 -m pip uninstall -y docker
 python3 -m pip install -U docker
 
+source "${SCRIPTS}"/get-versions.sh
 
 sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/get-models-examples.sh
-
-source ${SCRIPTS}/detmVers.sh
+bash "${SCRIPTS}"/get-models-examples.sh
 
 DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
 
@@ -44,22 +40,22 @@ sed -e 's!"version": "1.0.0"!"version": "2.0.0"!' \
         ${DATA}/vCPE.policy.monitoring.input.tosca.json \
     >${DATA}/vCPE.policy.monitoring.input.tosca.v2.json
 
-echo ${POLICY_API_VERSION}
+echo "${POLICY_API_VERSION}"
 
-cd ${SCRIPTS}
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d api
+cd "${SCRIPTS}"
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d api
 
 sleep 10
 unset http_proxy https_proxy
 
-POLICY_API_IP=`get-instance-ip.sh policy-api`
-MARIADB_IP=`get-instance-ip.sh mariadb`
+POLICY_API_IP=$(get-instance-ip.sh policy-api)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
 
-echo API IP IS ${POLICY_API_IP}
-echo MARIADB IP IS ${MARIADB_IP}
+echo API IP IS "${POLICY_API_IP}"
+echo MARIADB IP IS "${MARIADB_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${POLICY_API_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_API_IP}" 6969
 
 ROBOT_VARIABLES=""
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_API_IP:${POLICY_API_IP}"
index e101973..71daccc 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+#  Modifications copyright (c) 2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,4 +18,7 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
+docker logs policy-api
+docker logs simulator
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
index dbd5b6a..d9a97db 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
-#  Copyright (C) 2021 Nordix Foundation.
+#  Copyright (C) 2021-2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -16,7 +16,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
-source ${SCRIPTS}/get-branch-mariadb.sh
 
 echo "Uninstall docker-py and reinstall docker."
 pip uninstall -y docker-py
@@ -25,32 +24,32 @@ pip install -U docker==2.7.0
 
 sudo apt-get -y install libxml2-utils
 
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d policy-clamp-cl-runtime
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d policy-clamp-cl-runtime
 
 sleep 10
 unset http_proxy https_proxy
 
-POLICY_CONTROLLOOP_RUNTIME_IP=`get-instance-ip.sh policy-clamp-cl-runtime`
-POLICY_PARTICIPANT_IP=`get-instance-ip.sh policy-clamp-cl-pf-ppnt`
-K8S_PARTICIPANT_IP=`get-instance-ip.sh policy-clamp-cl-k8s-ppnt`
-HTTP_PARTICIPANT_IP=`get-instance-ip.sh policy-clamp-cl-http-ppnt`
-MARIADB_IP=`get-instance-ip.sh mariadb`
-DMAAP_IP=`get-instance-ip.sh simulator`
-POLICY_API_IP=`get-instance-ip.sh policy-api`
-
-echo MARIADB IP IS ${MARIADB_IP}
-echo DMAAP_IP IS ${DMAAP_IP}
-echo API IP IS ${POLICY_API_IP}
-echo POLICY CONTROLLOOP RUNTIME IP IS ${POLICY_CONTROLLOOP_RUNTIME_IP}
-echo POLICY PARTICIPANT IP IS ${POLICY_PARTICIPANT_IP}
-echo K8S PARTICIPANT IP IS ${K8S_PARTICIPANT_IP}
-echo HTTP PARTICIPANT IP IS ${HTTP_PARTICIPANT_IP}
+POLICY_CONTROLLOOP_RUNTIME_IP=$(get-instance-ip.sh policy-clamp-cl-runtime)
+POLICY_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-cl-pf-ppnt)
+K8S_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-cl-k8s-ppnt)
+HTTP_PARTICIPANT_IP=$(get-instance-ip.sh policy-clamp-cl-http-ppnt)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
+DMAAP_IP=$(get-instance-ip.sh simulator)
+POLICY_API_IP=$(get-instance-ip.sh policy-api)
+
+echo MARIADB IP IS "${MARIADB_IP}"
+echo DMAAP_IP IS "${DMAAP_IP}"
+echo API IP IS "${POLICY_API_IP}"
+echo POLICY CONTROLLOOP RUNTIME IP IS "${POLICY_CONTROLLOOP_RUNTIME_IP}"
+echo POLICY PARTICIPANT IP IS "${POLICY_PARTICIPANT_IP}"
+echo K8S PARTICIPANT IP IS "${K8S_PARTICIPANT_IP}"
+echo HTTP PARTICIPANT IP IS "${HTTP_PARTICIPANT_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${POLICY_CONTROLLOOP_RUNTIME_IP} 6969
-${SCRIPTS}/wait_for_port.sh ${POLICY_API_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_CONTROLLOOP_RUNTIME_IP}" 6969
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_API_IP}" 6969
 
 ROBOT_VARIABLES=""
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v POLICY_CONTROLLOOP_RUNTIME_IP:${POLICY_CONTROLLOOP_RUNTIME_IP}"
diff --git a/csit/compose-grafana.yml b/csit/compose-grafana.yml
new file mode 100644 (file)
index 0000000..9c5f736
--- /dev/null
@@ -0,0 +1,241 @@
+#
+# ===========LICENSE_START====================================================
+#  Copyright (C) 2022 Nordix Foundation.
+# ============================================================================
+# 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=====================================================
+#
+version: '2'
+services:
+   mariadb:
+      image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER}
+      container_name: mariadb
+      hostname: mariadb
+      command: ['--lower-case-table-names=1', '--wait_timeout=28800']
+      env_file: config/db/db.conf
+      volumes:
+         - ./config/db:/docker-entrypoint-initdb.d:ro
+      expose:
+       - 3306
+   policy-db-migrator:
+      image: nexus3.onap.org:10001/onap/policy-db-migrator:${POLICY_DOCKER_VERSION}
+      container_name: policy-db-migrator
+      hostname: policy-db-migrator
+      depends_on:
+        - mariadb
+      expose:
+       - 6824
+      env_file: config/db/db.conf
+      environment:
+        SQL_DB: policyadmin
+        SQL_HOST: mariadb
+      volumes:
+         - ./db_migrator_policy_init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh:ro
+         - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+              '-c',
+                '/opt/app/policy/bin/db_migrator_policy_init.sh',
+                'mariadb', '3306'
+               ]
+   simulator:
+      image: nexus3.onap.org:10001/onap/policy-models-simulator:${POLICY_MODELS_VERSION}
+      container_name: simulator
+      hostname: simulator
+      networks:
+          default:
+              aliases:
+                  - message-router
+                  - aai-sim
+                  - grpc-sim
+                  - sdnc-sim
+                  - so-sim
+                  - vfc-sim
+      volumes:
+       - ./config/sim-all:/opt/app/policy/simulators/etc/mounted:ro
+      expose:
+       - 6666
+       - 6668
+       - 6669
+       - 6670
+       - 3904
+       - 6680
+   api:
+      image: nexus3.onap.org:10001/onap/policy-api:${POLICY_API_VERSION}
+      container_name: policy-api
+      depends_on:
+       - policy-db-migrator
+      hostname: policy-api
+      expose:
+       - 6969
+      volumes:
+       - ./config/api/apiParameters.yaml:/opt/app/policy/api/etc/apiParameters.yaml:ro
+       - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro
+      entrypoint: ./wait_for_port.sh
+      command: [
+        '-c', './policy-api.sh',
+        'mariadb', '3306',
+        'policy-db-migrator', '6824'
+        ]
+   pap:
+      image: nexus3.onap.org:10001/onap/policy-pap:${POLICY_PAP_VERSION}
+      container_name: policy-pap
+      depends_on:
+       - mariadb
+       - simulator
+       - api
+      hostname: policy-pap
+      expose:
+       - 6969
+      volumes:
+       - ./config/pap/papParameters.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro
+       - ./config/pap/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
+       - ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
+      entrypoint: ./wait_for_port.sh
+      command: [
+        '-c', './policy-pap.sh',
+        'mariadb', '3306',
+        'message-router', '3904',
+        'api', '6969'
+        ]
+   xacml-pdp:
+      image: nexus3.onap.org:10001/onap/policy-xacml-pdp:${POLICY_XACML_PDP_VERSION}
+      container_name: policy-xacml-pdp
+      depends_on:
+       - mariadb
+       - simulator
+       - pap
+      hostname: policy-xacml-pdp
+      expose:
+       - 6969
+      volumes:
+       - ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
+       - ./wait_for_port.sh:/opt/app/policy/pdpx/bin/wait_for_port.sh:ro
+      entrypoint: ./wait_for_port.sh
+      command: [
+        '-c', './policy-pdpx.sh',
+        'mariadb', '3306',
+        'message-router', '3904',
+        'pap', '6969'
+        ]
+   drools:
+      image: nexus3.onap.org:10001/onap/policy-drools:${POLICY_DROOLS_VERSION}
+      container_name: drools
+      depends_on:
+       - mariadb
+       - simulator
+       - pap
+      hostname: drools
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ./config/drools/custom:/tmp/policy-install/config:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      env_file:
+        - config/drools/env/base.conf
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', '/opt/app/policy/bin/pdpd-entrypoint.sh boot',
+        'mariadb', '3306',
+        'message-router', '3904'
+        ]
+   drools-apps:
+      image: nexus3.onap.org:10001/onap/policy-pdpd-cl:${POLICY_DROOLS_APPS_VERSION}
+      container_name: drools-apps
+      depends_on:
+       - mariadb
+       - simulator
+       - pap
+       - xacml-pdp
+      hostname: drools-apps
+      expose:
+       - 6969
+       - 9696
+      volumes:
+       - ./config/drools-apps/custom:/tmp/policy-install/config:ro
+       - ./config/drools-apps/custom/feature-lifecycle.properties:/opt/app/policy/features/lifecycle/config/feature-lifecycle.properties:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      env_file:
+        - config/drools-apps/env/base.conf
+        - config/drools-apps/env/feature-healthcheck.conf
+        - config/drools-apps/env/feature-pooling-dmaap.conf
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', '/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot',
+        'mariadb', '3306',
+        'message-router', '3904',
+        'pap', '6969',
+        'aai-sim', '6666',
+        'sdnc-sim', '6668',
+        'so-sim', '6669',
+        'vfc-sim', '6670'
+        ]
+   apex-pdp:
+      image: nexus3.onap.org:10001/onap/policy-apex-pdp:${POLICY_APEX_PDP_VERSION}
+      container_name: policy-apex-pdp
+      depends_on:
+       - mariadb
+       - simulator
+       - pap
+      hostname: policy-apex-pdp
+      expose:
+       - 6969
+       - 23324
+      volumes:
+       - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json',
+        'mariadb', '3306',
+        'message-router', '3904',
+        'pap', '6969'
+        ]
+   distribution:
+      image: nexus3.onap.org:10001/onap/policy-distribution:${POLICY_DISTRIBUTION_VERSION}
+      container_name: policy-distribution
+      depends_on:
+       - mariadb
+       - api
+       - pap
+       - apex-pdp
+      hostname: policy-distribution
+      volumes:
+       - ./config/distribution/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json:ro
+       - ./distribution/config/temp/:/opt/app/policy/distribution/etc/temp/:ro
+       - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+      entrypoint: /opt/app/policy/bin/wait_for_port.sh
+      command: [
+        '-c', './policy-dist.sh',
+        'mariadb', '3306',
+        'message-router', '3904',
+        'pap', '6969',
+        'apex-pdp', '6969'
+        ]
+   prometheus:
+      image: prom/prometheus:v2.32.1
+      container_name: prometheus
+      hostname: prometheus
+      expose:
+       - 9090
+      volumes:
+       - ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml
+   grafana:
+      image: grafana/grafana-oss:8.3.4
+      container_name: grafana
+      depends_on:
+       - prometheus
+      hostname: grafana
+      expose:
+       - 3000
index d46a8b2..74085a1 100644 (file)
@@ -5,7 +5,7 @@
         "port": 6969,
         "userName": "healthcheck",
         "password": "zb!XztG34",
-        "https": true,
+        "https": {{HTTPS_ENABLED}},
         "prometheus": true
     },
     "pdpStatusParameters":{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "dmaap",
-            "useHttps" : true
+            "useHttps" : {{HTTPS_ENABLED}}
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "dmaap",
-            "useHttps" : true
+            "useHttps" : {{HTTPS_ENABLED}}
         }]
     }
 }
diff --git a/csit/config/api/apiParameters.yaml b/csit/config/api/apiParameters.yaml
new file mode 100644 (file)
index 0000000..93b7c1b
--- /dev/null
@@ -0,0 +1,67 @@
+server:
+  port: 6969
+  ssl:
+    enabled: false
+
+spring:
+  security.user:
+    name: policyadmin
+    password: zb!XztG34
+  mvc.converters.preferred-json-mapper: gson
+
+policy-api:
+  name: ApiGroup
+  aaf: false
+
+database:
+  name: PolicyProviderParameterGroup
+  implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl
+  driver: org.mariadb.jdbc.Driver
+  url: jdbc:mariadb://mariadb:3306/policyadmin
+  user: policy_user
+  password: policy_user
+  persistenceUnit: PolicyDb
+
+policy-preload:
+  policyTypes:
+    - policytypes/onap.policies.monitoring.tcagen2.yaml
+    - policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml
+    - policytypes/onap.policies.monitoring.dcae-restconfcollector.yaml
+    - policytypes/onap.policies.monitoring.dcae-pm-subscription-handler.yaml
+    - policytypes/onap.policies.monitoring.dcae-pm-mapper.yaml
+    - policytypes/onap.policies.Optimization.yaml
+    - policytypes/onap.policies.optimization.Resource.yaml
+    - policytypes/onap.policies.optimization.Service.yaml
+    - policytypes/onap.policies.optimization.resource.AffinityPolicy.yaml
+    - policytypes/onap.policies.optimization.resource.DistancePolicy.yaml
+    - policytypes/onap.policies.optimization.resource.HpaPolicy.yaml
+    - policytypes/onap.policies.optimization.resource.OptimizationPolicy.yaml
+    - policytypes/onap.policies.optimization.resource.PciPolicy.yaml
+    - policytypes/onap.policies.optimization.service.QueryPolicy.yaml
+    - policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml
+    - policytypes/onap.policies.optimization.resource.Vim_fit.yaml
+    - policytypes/onap.policies.optimization.resource.VnfPolicy.yaml
+    - policytypes/onap.policies.controlloop.guard.Common.yaml
+    - policytypes/onap.policies.controlloop.guard.common.Blacklist.yaml
+    - policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter.yaml
+    - policytypes/onap.policies.controlloop.guard.common.MinMax.yaml
+    - policytypes/onap.policies.controlloop.guard.common.Filter.yaml
+    - policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml
+    - policytypes/onap.policies.Naming.yaml
+    - policytypes/onap.policies.Match.yaml
+    - policytypes/onap.policies.native.Drools.yaml
+    - policytypes/onap.policies.native.Xacml.yaml
+    - policytypes/onap.policies.native.Apex.yaml
+    - policytypes/onap.policies.controlloop.operational.Common.yaml
+    - policytypes/onap.policies.controlloop.operational.common.Apex.yaml
+    - policytypes/onap.policies.controlloop.operational.common.Drools.yaml
+  policies:
+    - policies/sdnc.policy.naming.input.tosca.yaml
+
+management:
+  endpoints:
+    web:
+      base-path: /
+      exposure:
+        include: health,metrics,prometheus
+      path-mapping.prometheus: metrics
\ No newline at end of file
index 05640d9..50cb822 100644 (file)
@@ -5,7 +5,7 @@
         "port":6969,
         "userName":"healthcheck",
         "password":"zb!XztG34",
-        "https": true,
+        "https": {{HTTPS_ENABLED}},
         "prometheus": true
     },
     "receptionHandlerParameters":{
@@ -59,7 +59,7 @@
                     "port": 6969,
                     "userName": "policyadmin",
                     "password": "zb!XztG34",
-                    "useHttps": true
+                    "useHttps": {{HTTPS_ENABLED}}
                 },
                 "papParameters": {
                     "clientName": "policy-pap",
@@ -67,7 +67,7 @@
                     "port": 6969,
                     "userName": "policyadmin",
                     "password": "zb!XztG34",
-                    "useHttps": true
+                    "useHttps": {{HTTPS_ENABLED}}
                 },
                 "deployPolicies": true
             }
index 911cdca..edf0759 100644 (file)
@@ -29,10 +29,10 @@ dmaap.source.topics.POLICY-PDP-PAP.servers=${envd:DMAAP_SERVERS}
 dmaap.source.topics.POLICY-PDP-PAP.effectiveTopic=${envd:POLICY_PDP_PAP_TOPIC}
 dmaap.source.topics.POLICY-PDP-PAP.apiKey=${envd:POLICY_PDP_PAP_API_KEY}
 dmaap.source.topics.POLICY-PDP-PAP.apiSecret=${envd:POLICY_PDP_PAP_API_SECRET}
-dmaap.source.topics.POLICY-PDP-PAP.https=true
+dmaap.source.topics.POLICY-PDP-PAP.https={{HTTPS_ENABLED}}
 
 dmaap.sink.topics.POLICY-PDP-PAP.servers=${envd:DMAAP_SERVERS}
 dmaap.sink.topics.POLICY-PDP-PAP.effectiveTopic=${envd:POLICY_PDP_PAP_TOPIC}
 dmaap.sink.topics.POLICY-PDP-PAP.apiKey=${envd:POLICY_PDP_PAP_API_KEY}
 dmaap.sink.topics.POLICY-PDP-PAP.apiSecret=${envd:POLICY_PDP_PAP_API_SECRET}
-dmaap.sink.topics.POLICY-PDP-PAP.https=true
+dmaap.sink.topics.POLICY-PDP-PAP.https={{HTTPS_ENABLED}}
index 3ec5e83..9a3f80d 100644 (file)
@@ -59,7 +59,7 @@ AAF_HOST=aaf.api.simpledemo.onap.org
 
 # HTTP Servers
 
-HTTP_SERVER_HTTPS=true
+HTTP_SERVER_HTTPS={{HTTPS_ENABLED}}
 PROMETHEUS=true
 
 # PDP-D DMaaP configuration channel
index 8f3c4c0..9871d62 100644 (file)
@@ -59,7 +59,7 @@ AAF_HOST=aaf.api.simpledemo.onap.org
 
 # HTTP Servers
 
-HTTP_SERVER_HTTPS=true
+HTTP_SERVER_HTTPS={{HTTPS_ENABLED}}
 PROMETHEUS=true
 
 # PDP-D DMaaP configuration channel
index 8b4c0ce..00912de 100644 (file)
@@ -24,7 +24,7 @@ spring:
 server:
   port: 6969
   ssl:
-    enabled: true
+    enabled: {{HTTPS_ENABLED}}
 
 pap:
   name: PapGroup
@@ -43,7 +43,7 @@ pap:
       servers:
       - message-router
       topicCommInfrastructure: dmaap
-      useHttps: true
+      useHttps: {{HTTPS_ENABLED}}
       fetchTimeout: 15000
     - topic: POLICY-HEARTBEAT
       effectiveTopic: POLICY-PDP-PAP
@@ -51,26 +51,26 @@ pap:
       servers:
       - message-router
       topicCommInfrastructure: dmaap
-      useHttps: true
+      useHttps: {{HTTPS_ENABLED}}
       fetchTimeout: 15000
     topicSinks:
     - topic: POLICY-PDP-PAP
       servers:
       - message-router
       topicCommInfrastructure: dmaap
-      useHttps: true
+      useHttps: {{HTTPS_ENABLED}}
     - topic: POLICY-NOTIFICATION
       servers:
       - message-router
       topicCommInfrastructure: dmaap
-      useHttps: true
+      useHttps: {{HTTPS_ENABLED}}
   healthCheckRestClientParameters:
   - clientName: api
     hostname: policy-api
     port: 6969
     userName: policyadmin
     password: zb!XztG34
-    useHttps: true
+    useHttps: {{HTTPS_ENABLED}}
     basePath: policy/api/v1/healthcheck
 
 management:
index e33710c..3d34812 100644 (file)
@@ -8,15 +8,15 @@
             "name": "DMaaP simulator",
             "providerClass": "org.onap.policy.models.sim.dmaap.rest.DmaapSimRestControllerV1",
             "host": "0.0.0.0",
-            "port": 3905,
-            "https": true
+            "port": {{MESSAGE_ROUTER_PORT}},
+            "https": {{HTTPS_ENABLED}}
         },
         {
             "name": "A&AI simulator",
             "providerClass": "org.onap.policy.simulators.AaiSimulatorJaxRs",
             "host": "0.0.0.0",
             "port": 6666,
-            "https": true,
+            "https": {{HTTPS_ENABLED}},
             "userName": "policy@policy.onap.org",
             "password": "demo123456!",
             "resourceLocation": "/opt/app/policy/simulators/etc/mounted/aairesponse/"
@@ -26,7 +26,7 @@
             "providerClass": "org.onap.policy.simulators.SdncSimulatorJaxRs",
             "host": "0.0.0.0",
             "port": 6668,
-            "https": true
+            "https": {{HTTPS_ENABLED}}
         },
         {
             "name": "SO simulator",
@@ -42,7 +42,7 @@
             "providerClass": "org.onap.policy.simulators.VfcSimulatorJaxRs",
             "host": "0.0.0.0",
             "port": 6670,
-            "https": true
+            "https": {{HTTPS_ENABLED}}
         }
     ],
     "topicSinks": [
@@ -50,7 +50,7 @@
             "topic": "APPC-CL",
             "servers": ["${HOST_NAME}"],
             "topicCommInfrastructure": "DMAAP",
-            "useHttps": true,
+            "useHttps": {{HTTPS_ENABLED}},
             "apiKey": "some-key",
             "apiSecret": "some-secret"
         },
@@ -58,7 +58,7 @@
             "topic": "APPC-LCM-WRITE",
             "servers": ["${HOST_NAME}"],
             "topicCommInfrastructure": "DMAAP",
-            "useHttps": true,
+            "useHttps": {{HTTPS_ENABLED}},
             "apiKey": "some-key",
             "apiSecret": "some-secret"
         }
@@ -68,7 +68,7 @@
             "topic": "APPC-CL",
             "servers": ["${HOST_NAME}"],
             "topicCommInfrastructure": "DMAAP",
-            "useHttps": true,
+            "useHttps": {{HTTPS_ENABLED}},
             "apiKey": "some-key",
             "apiSecret": "some-secret"
         },
@@ -76,7 +76,7 @@
             "topic": "APPC-LCM-READ",
             "servers": ["${HOST_NAME}"],
             "topicCommInfrastructure": "DMAAP",
-            "useHttps": true,
+            "useHttps": {{HTTPS_ENABLED}},
             "apiKey": "some-key",
             "apiSecret": "some-secret"
         }
index e2536ce..6ee0769 100644 (file)
@@ -7,7 +7,7 @@
         "port": 6969,
         "userName": "healthcheck",
         "password": "zb!XztG34",
-        "https": true,
+        "https": {{HTTPS_ENABLED}},
         "aaf": false,
         "prometheus": true
     },
@@ -16,7 +16,7 @@
         "port": 6969,
         "userName": "policyadmin",
         "password": "zb!XztG34",
-        "useHttps": true,
+        "useHttps": {{HTTPS_ENABLED}},
         "aaf": false
     },
     "applicationParameters": {
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "dmaap",
-            "useHttps" : true
+            "useHttps" : {{HTTPS_ENABLED}}
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
             "servers" : [ "message-router" ],
             "topicCommInfrastructure" : "dmaap",
-            "useHttps" : true
+            "useHttps" : {{HTTPS_ENABLED}}
         }]
     }
 }
index df0bdb1..b749500 100644 (file)
@@ -1,10 +1,8 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2018 Ericsson. All rights reserved.
-#
-#  Modifications copyright (c) 2019 Nordix Foundation.
+#  Modifications Copyright (c) 2019-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
-#  Modification Copyright 2021. Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -20,7 +18,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
-source ${SCRIPTS}/get-branch-mariadb.sh
 
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
@@ -29,37 +26,37 @@ python3 -m pip install -U docker
 
 sudo apt-get -y install libxml2-utils
 
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
 
 SCRIPT_DIR=${TESTPLANDIR}/config
 
 # Remaking the csar file in case if the file got corrupted
-zip -F ${SCRIPT_DIR}/csar/sample_csar_with_apex_policy.csar --out ${SCRIPT_DIR}/csar/csar_temp.csar
+zip -F "${SCRIPT_DIR}"/csar/sample_csar_with_apex_policy.csar --out "${SCRIPT_DIR}"/csar/csar_temp.csar
 
 # Remake temp directory
-rm -rf ${SCRIPT_DIR}/temp
-mkdir ${SCRIPT_DIR}/temp
+rm -rf "${SCRIPT_DIR}"/temp
+mkdir "${SCRIPT_DIR}"/temp
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d distribution
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d distribution
 
 unset http_proxy https_proxy
 
-POLICY_API_IP=`get-instance-ip.sh policy-api`
-POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
-MARIADB_IP=`get-instance-ip.sh mariadb`
-APEX_IP=`get-instance-ip.sh policy-apex-pdp`
-DMAAP_IP=`get-instance-ip.sh simulator`
-POLICY_DISTRIBUTION_IP=`get-instance-ip.sh policy-distribution`
+POLICY_API_IP=$(get-instance-ip.sh policy-api)
+POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
+APEX_IP=$(get-instance-ip.sh policy-apex-pdp)
+DMAAP_IP=$(get-instance-ip.sh simulator)
+POLICY_DISTRIBUTION_IP=$(get-instance-ip.sh policy-distribution)
 
-echo PAP IP IS ${POLICY_PAP_IP}
-echo MARIADB IP IS ${MARIADB_IP}
-echo API IP IS ${POLICY_API_IP}
-echo APEX IP IS ${APEX_IP}
-echo DMAAP_IP IS ${DMAAP_IP}
-echo POLICY_DISTRIBUTION_IP IS ${POLICY_DISTRIBUTION_IP}
+echo PAP IP IS "${POLICY_PAP_IP}"
+echo MARIADB IP IS "${MARIADB_IP}"
+echo API IP IS "${POLICY_API_IP}"
+echo APEX IP IS "${APEX_IP}"
+echo DMAAP_IP IS "${DMAAP_IP}"
+echo POLICY_DISTRIBUTION_IP IS "${POLICY_DISTRIBUTION_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${POLICY_DISTRIBUTION_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_DISTRIBUTION_IP}" 6969
 
 ROBOT_VARIABLES=""
 ROBOT_VARIABLES="${ROBOT_VARIABLES} -v APEX_IP:${APEX_IP}"
index f47fcd8..e451ba6 100644 (file)
@@ -2,7 +2,7 @@
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2018 Ericsson. All rights reserved.
 #
-#  Modifications copyright (c) 2019 Nordix Foundation.
+#  Modifications copyright (c) 2019-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2020-2021 AT&T Intellectual Property.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,4 +20,9 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
+docker logs policy-api
+docker logs simulator
+docker logs policy-pap
+docker logs policy-distribution
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
index 438f82b..6ca073b 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # ===========LICENSE_START====================================================
 #  Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
-#  Modification Copyright 2021. Nordix Foundation.
+#  Modifications Copyright 2021-2022 Nordix Foundation.
 # ============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
 # limitations under the License.
 # ============LICENSE_END=====================================================
 #
-source ${SCRIPTS}/get-branch-mariadb.sh
 
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
@@ -26,28 +25,28 @@ python3 -m pip install -U docker
 
 sudo apt-get -y install libxml2-utils
 
-bash ${SCRIPTS}/get-models-examples.sh
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
+bash "${SCRIPTS}"/get-models-examples.sh
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d drools-apps
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools-apps
 
 unset http_proxy https_proxy
 
-DROOLS_IP=`get-instance-ip.sh drools-apps`
-API_IP=`get-instance-ip.sh policy-api`
-PAP_IP=`get-instance-ip.sh policy-pap`
-XACML_IP=`get-instance-ip.sh policy-xacml-pdp`
-SIM_IP=`get-instance-ip.sh simulator`
+DROOLS_IP=$(get-instance-ip.sh drools-apps)
+API_IP=$(get-instance-ip.sh policy-api)
+PAP_IP=$(get-instance-ip.sh policy-pap)
+XACML_IP=$(get-instance-ip.sh policy-xacml-pdp)
+SIM_IP=$(get-instance-ip.sh simulator)
 export SIM_IP
 
-echo DROOLS IP IS ${DROOLS_IP}
-echo API IP IS ${API_IP}
-echo PAP IP IS ${PAP_IP}
-echo XACML IP IS ${XACML_IP}
-echo SIMULATORS IP IS ${SIM_IP}
+echo DROOLS IP IS "${DROOLS_IP}"
+echo API IP IS "${API_IP}"
+echo PAP IP IS "${PAP_IP}"
+echo XACML IP IS "${XACML_IP}"
+echo SIMULATORS IP IS "${SIM_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${DROOLS_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${DROOLS_IP}" 6969
 
 # give enough time for the controllers to come up
 sleep 15
index ce89740..f1a8624 100755 (executable)
@@ -2,6 +2,7 @@
 #
 # ===========LICENSE_START====================================================
 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+#  Modifications copyright (c) 2022 Nordix Foundation.
 # ============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # limitations under the License.
 # ============LICENSE_END=====================================================
 #
+
+docker logs policy-api
+docker logs simulator
+docker logs policy-pap
+docker logs xacml-pdp
+docker logs drools-apps
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
index 6b02e76..987c453 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 # Copyright 2017-2021 AT&T Intellectual Property. All rights reserved.
-#  Modification Copyright 2021. Nordix Foundation.
+# Modifications Copyright 2021-2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,9 +17,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
-source ${SCRIPTS}/get-branch-mariadb.sh
-
-# OS upgrades
 
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
@@ -28,20 +25,21 @@ python3 -m pip install -U docker
 
 sudo apt-get -y install libxml2-utils
 
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d drools
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d drools
 
-POLICY_DROOLS_IP=`get-instance-ip.sh drools`
-MARIADB_IP=`get-instance-ip.sh mariadb`
+POLICY_DROOLS_IP=$(get-instance-ip.sh drools)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
 
-echo DROOLS IP IS ${POLICY_DROOLS_IP}
-echo MARIADB IP IS ${MARIADB_IP}
+echo DROOLS IP IS "${POLICY_DROOLS_IP}"
+echo MARIADB IP IS "${MARIADB_IP}"
 
-# wait for the app to start up - looking for telemtry service on port 9696
-${SCRIPTS}/wait_for_port.sh ${POLICY_DROOLS_IP} 9696
+# wait for the app to start up - looking for telemetry service on port 9696
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_DROOLS_IP}" 9696
 
 # give enough time for the controllers to come up
 sleep 15
 
-ROBOT_VARIABLES="-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}"
+ROBOT_VARIABLES=""
+ROBOT_VARIABLES="${ROBOT_VARIABLES}-v POLICY_DROOLS_IP:${POLICY_DROOLS_IP}"
index d16c164..6ec0051 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 # Copyright 2017-2021 AT&T Intellectual Property. All rights reserved.
-#
+# Modifications copyright (c) 2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -16,4 +16,9 @@
 # limitations under the License.
 # ============LICENSE_END=========================================================
 
+docker logs policy-api
+docker logs simulator
+docker logs policy-pap
+docker logs drools
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
similarity index 92%
rename from csit/get-branch-mariadb.sh
rename to csit/get-branch.sh
index 46af8f8..3ce5131 100644 (file)
@@ -1,5 +1,6 @@
 # ============LICENSE_START====================================================
 #  Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
+#  Modifications Copyright 2022 Nordix Foundation.
 # =============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END======================================================
 
-export POLICY_MARIADB_VER=10.5.8
 export NEXUS_URL=https://nexus.onap.org/content/repositories/snapshots
 
 GIT_TOP=$(git rev-parse --show-toplevel)
 GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
                     "${GIT_TOP}"/.gitreview)
-echo GERRIT_BRANCH=${GERRIT_BRANCH}
+echo GERRIT_BRANCH="${GERRIT_BRANCH}"
index e83b024..fe75c90 100644 (file)
@@ -2,6 +2,7 @@
 #
 # ============LICENSE_START===================================================
 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
+#  Modifications Copyright 2022 Nordix Foundation.
 # ============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # ============LICENSE_END=====================================================
 #
 
-source ${SCRIPTS}/get-branch-mariadb.sh
+source "${SCRIPTS}"/get-branch.sh
 
-rm -rf ${WORKSPACE}/models
-mkdir ${WORKSPACE}/models
-cd ${WORKSPACE}
+rm -rf "${WORKSPACE}"/models
+mkdir "${WORKSPACE}"/models
+cd "${WORKSPACE}"
 
 # download models examples
-git clone -b ${GERRIT_BRANCH} --single-branch https://github.com/onap/policy-models.git models
+git clone -b "${GERRIT_BRANCH}" --single-branch https://github.com/onap/policy-models.git models
similarity index 69%
rename from csit/detmVers.sh
rename to csit/get-versions.sh
index 13e8fbe..5abc747 100644 (file)
@@ -1,6 +1,6 @@
 # ============LICENSE_START====================================================
 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-#  Modification Copyright 2021. Nordix Foundation.
+#  Modification Copyright 2021-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
 # =============================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END======================================================
 
-source ${SCRIPTS}/get-branch-mariadb.sh
+source "${SCRIPTS}"/get-branch.sh
 
+export POLICY_MARIADB_VER=10.5.8
 echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
 
 function getVersion
 {
     REPO=$1
     curl -qL --silent \
-      https://github.com/onap/policy-$REPO/raw/${GERRIT_BRANCH}/pom.xml |
+      https://github.com/onap/policy-"$REPO"/raw/"${GERRIT_BRANCH}"/pom.xml |
     xmllint --xpath \
       '/*[local-name()="project"]/*[local-name()="version"]/text()' - |
     awk -F \. '{print $1"."$2"-SNAPSHOT-latest"}'
 }
 
 export POLICY_MODELS_VERSION=$(getVersion models)
-echo POLICY_MODELS_VERSION=${POLICY_MODELS_VERSION}
+echo POLICY_MODELS_VERSION="${POLICY_MODELS_VERSION}"
 
 export POLICY_API_VERSION=$(getVersion api)
-echo POLICY_API_VERSION=${POLICY_API_VERSION}
+echo POLICY_API_VERSION="${POLICY_API_VERSION}"
 
 export POLICY_PAP_VERSION=$(getVersion pap)
-echo POLICY_PAP_VERSION=${POLICY_PAP_VERSION}
+echo POLICY_PAP_VERSION="${POLICY_PAP_VERSION}"
 
 export POLICY_XACML_PDP_VERSION=$(getVersion xacml-pdp)
-echo POLICY_XACML_PDP_VERSION=${POLICY_XACML_PDP_VERSION}
+echo POLICY_XACML_PDP_VERSION="${POLICY_XACML_PDP_VERSION}"
 
 export POLICY_DROOLS_VERSION=$(getVersion drools-pdp)
-echo POLICY_DROOLS_VERSION=${POLICY_DROOLS_VERSION}
+echo POLICY_DROOLS_VERSION="${POLICY_DROOLS_VERSION}"
 
 export POLICY_DROOLS_APPS_VERSION=$(getVersion drools-applications)
-echo POLICY_DROOLS_APPS_VERSION=${POLICY_DROOLS_APPS_VERSION}
+echo POLICY_DROOLS_APPS_VERSION="${POLICY_DROOLS_APPS_VERSION}"
 
 export POLICY_APEX_PDP_VERSION=$(getVersion apex-pdp)
-echo POLICY_APEX_PDP_VERSION=${POLICY_APEX_PDP_VERSION}
+echo POLICY_APEX_PDP_VERSION="${POLICY_APEX_PDP_VERSION}"
 
 export POLICY_DISTRIBUTION_VERSION=$(getVersion distribution)
-echo POLICY_DISTRIBUTION_VERSION=${POLICY_DISTRIBUTION_VERSION}
+echo POLICY_DISTRIBUTION_VERSION="${POLICY_DISTRIBUTION_VERSION}"
 
 export POLICY_CLAMP_VERSION=$(getVersion clamp)
-echo POLICY_CLAMP_VERSION=${POLICY_CLAMP_VERSION}
+echo POLICY_CLAMP_VERSION="${POLICY_CLAMP_VERSION}"
 
 export POLICY_DOCKER_VERSION=$(getVersion docker)
-echo POLICY_DOCKER_VERSION=${POLICY_DOCKER_VERSION}
+echo POLICY_DOCKER_VERSION="${POLICY_DOCKER_VERSION}"
diff --git a/csit/metrics/policy-dashboard-example.json b/csit/metrics/policy-dashboard-example.json
new file mode 100644 (file)
index 0000000..ac47924
--- /dev/null
@@ -0,0 +1,173 @@
+{
+    "panels": [
+        {
+            "fieldConfig": {
+                "defaults": {
+                    "color": {
+                        "mode": "palette-classic"
+                    },
+                    "custom": {
+                        "axisLabel": "",
+                        "axisPlacement": "auto",
+                        "barAlignment": 0,
+                        "drawStyle": "line",
+                        "fillOpacity": 0,
+                        "gradientMode": "none",
+                        "hideFrom": {
+                            "legend": false,
+                            "tooltip": false,
+                            "viz": false
+                        },
+                        "lineInterpolation": "linear",
+                        "lineWidth": 1,
+                        "pointSize": 5,
+                        "scaleDistribution": {
+                            "type": "linear"
+                        },
+                        "showPoints": "auto",
+                        "spanNulls": false,
+                        "stacking": {
+                            "group": "A",
+                            "mode": "none"
+                        },
+                        "thresholdsStyle": {
+                            "mode": "off"
+                        }
+                    },
+                    "mappings": [],
+                    "thresholds": {
+                        "mode": "absolute",
+                        "steps": [
+                            {
+                                "color": "green",
+                                "value": null
+                            },
+                            {
+                                "color": "red",
+                                "value": 80
+                            }
+                        ]
+                    },
+                    "unit": "decbytes"
+                },
+                "overrides": []
+            },
+            "gridPos": {
+                "h": 8,
+                "w": 12,
+                "x": 0,
+                "y": 0
+            },
+            "id": 4,
+            "options": {
+                "legend": {
+                    "calcs": [],
+                    "displayMode": "list",
+                    "placement": "bottom"
+                },
+                "tooltip": {
+                    "mode": "single"
+                }
+            },
+            "targets": [
+                {
+                    "datasource": {
+                        "type": "prometheus",
+                        "uid": "GdZ1Voanz"
+                    },
+                    "exemplar": true,
+                    "expr": "jvm_memory_bytes_used{area=\"heap\"}",
+                    "interval": "",
+                    "legendFormat": "{{job}}",
+                    "refId": "A"
+                }
+            ],
+            "title": "jvm_memory_bytes_used heap",
+            "type": "timeseries"
+        },
+        {
+            "fieldConfig": {
+                "defaults": {
+                    "color": {
+                        "mode": "palette-classic"
+                    },
+                    "custom": {
+                        "axisLabel": "",
+                        "axisPlacement": "auto",
+                        "barAlignment": 0,
+                        "drawStyle": "line",
+                        "fillOpacity": 0,
+                        "gradientMode": "none",
+                        "hideFrom": {
+                            "legend": false,
+                            "tooltip": false,
+                            "viz": false
+                        },
+                        "lineInterpolation": "linear",
+                        "lineWidth": 1,
+                        "pointSize": 5,
+                        "scaleDistribution": {
+                            "type": "linear"
+                        },
+                        "showPoints": "auto",
+                        "spanNulls": false,
+                        "stacking": {
+                            "group": "A",
+                            "mode": "none"
+                        },
+                        "thresholdsStyle": {
+                            "mode": "off"
+                        }
+                    },
+                    "mappings": [],
+                    "thresholds": {
+                        "mode": "absolute",
+                        "steps": [
+                            {
+                                "color": "green",
+                                "value": null
+                            },
+                            {
+                                "color": "red",
+                                "value": 80
+                            }
+                        ]
+                    }
+                },
+                "overrides": []
+            },
+            "gridPos": {
+                "h": 9,
+                "w": 12,
+                "x": 0,
+                "y": 8
+            },
+            "id": 2,
+            "options": {
+                "legend": {
+                    "calcs": [],
+                    "displayMode": "list",
+                    "placement": "bottom"
+                },
+                "tooltip": {
+                    "mode": "single"
+                }
+            },
+            "targets": [
+                {
+                    "datasource": {
+                        "type": "prometheus",
+                        "uid": "GdZ1Voanz"
+                    },
+                    "exemplar": true,
+                    "expr": "jvm_threads_current{}",
+                    "interval": "",
+                    "legendFormat": "{{job}}",
+                    "refId": "A"
+                }
+            ],
+            "title": "jvm_threads_current",
+            "type": "timeseries"
+        }
+    ]
+}
\ No newline at end of file
diff --git a/csit/metrics/prometheus.yml b/csit/metrics/prometheus.yml
new file mode 100644 (file)
index 0000000..255ecd0
--- /dev/null
@@ -0,0 +1,101 @@
+#
+# ===========LICENSE_START====================================================
+#  Copyright (C) 2022 Nordix Foundation.
+# ============================================================================
+# 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=====================================================
+#
+
+# my global config
+global:
+  scrape_interval: 60s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
+  evaluation_interval: 60s # Evaluate rules every 15 seconds. The default is every 1 minute.
+  #scrape_timeout is set to the global default (10s).
+
+# Alertmanager configuration
+alerting:
+  alertmanagers:
+    - static_configs:
+        - targets:
+          # - alertmanager:9093
+
+# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
+rule_files:
+  # - "first_rules.yml"
+  # - "second_rules.yml"
+
+# A scrape configuration containing exactly one endpoint to scrape:
+# Here it's Prometheus itself.
+scrape_configs:
+  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
+#  - job_name: "prometheus"
+#
+#    # metrics_path defaults to '/metrics'
+#    # scheme defaults to 'http'.
+#
+#    static_configs:
+#      - targets: ["localhost:9090"]
+
+  - job_name: "api-metrics"
+    static_configs:
+      - targets: ["policy-api:6969"]
+    basic_auth:
+      username: policyadmin
+      password: "zb!XztG34"
+
+  - job_name: "pap-metrics"
+    static_configs:
+      - targets: ["policy-pap:6969"]
+    basic_auth:
+      username: policyadmin
+      password: "zb!XztG34"
+
+  - job_name: "apex-pdp-metrics"
+    static_configs:
+      - targets:
+          - "policy-apex-pdp:6969"
+    basic_auth:
+      username: "healthcheck"
+      password: "zb!XztG34"
+
+  - job_name: "drools-apps-metrics"
+    static_configs:
+      - targets:
+          - "drools-apps:9696"
+    basic_auth:
+      username: "demo@people.osaaf.org"
+      password: "demo123456!"
+
+  - job_name: "drools-pdp-metrics"
+    static_configs:
+      - targets:
+          - "drools:9696"
+    basic_auth:
+      username: "demo@people.osaaf.org"
+      password: "demo123456!"
+
+  - job_name: "distribution-metrics"
+    static_configs:
+      - targets:
+          - "policy-distribution:6969"
+    basic_auth:
+      username: "healthcheck"
+      password: "zb!XztG34"
+
+  - job_name: "xacml-pdp-metrics"
+    static_configs:
+      - targets:
+          - "policy-xacml-pdp:6969"
+    basic_auth:
+      username: "healthcheck"
+      password: "zb!XztG34"
index f65e857..94a3b31 100644 (file)
@@ -1,8 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
-#  Copyright (C) 2019 Nordix Foundation.
+#  Copyright (C) 2019-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property.
-#  Modification Copyright 2021. Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
-source ${SCRIPTS}/get-branch-mariadb.sh
-
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
 python3 -m pip uninstall -y docker
 python3 -m pip install -U docker
 
 sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/get-models-examples.sh
 
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
+bash "${SCRIPTS}"/get-models-examples.sh
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d pap
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d pap
 
 unset http_proxy https_proxy
 
-POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
-POLICY_API_IP=`get-instance-ip.sh policy-api`
-MARIADB_IP=`get-instance-ip.sh mariadb`
-
-echo PAP IP IS ${POLICY_PAP_IP}
-echo API IP IS ${POLICY_API_IP}
-echo MARIADB IP IS ${MARIADB_IP}
+POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
+POLICY_API_IP=$(get-instance-ip.sh policy-api)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
 
+echo PAP IP IS "${POLICY_PAP_IP}"
+echo API IP IS "${POLICY_API_IP}"
+echo MARIADB IP IS "${MARIADB_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${POLICY_PAP_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_PAP_IP}" 6969
 
 
 DATA=${WORKSPACE}/models/models-examples/src/main/resources/policies
index 0cd4455..10c5f78 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
-#  Copyright (C) 2019 Nordix Foundation.
+#  Copyright (C) 2019-2022 Nordix Foundation.
 #  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,4 +18,8 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
+docker logs policy-api
+docker logs simulator
+docker logs policy-pap
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v
diff --git a/csit/prepare-config-files.py b/csit/prepare-config-files.py
new file mode 100755 (executable)
index 0000000..977df55
--- /dev/null
@@ -0,0 +1,57 @@
+#!/usr/bin/python3
+#
+# ============LICENSE_START====================================================
+#  Copyright (C) 2022 Nordix Foundation.
+# =============================================================================
+# 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+import os
+import argparse
+
+if __name__ == '__main__':
+    parser = argparse.ArgumentParser(description='Process configuration files for https/ssl '
+                                                 'disabling.')
+    parser.add_argument('--https', default="true",
+                        help='enable or disable https/ssl connection. '
+                             'use https=true or https=false')
+
+    https_enabled = parser.parse_args().https
+    message_router_port = '3905' if https_enabled == "true" else '3904'
+
+    current_dir = os.getcwd()
+    config_dir = current_dir + "/config/"
+
+    files = []
+    for (dirpath, dirnames, filenames) in os.walk(config_dir):
+        for filename in filenames:
+            files.append(os.path.join(dirpath, filename))
+
+    for file in files:
+        try:
+            with open(file, 'r+') as f:
+                content = f.read()
+                new_content = content.replace("{{HTTPS_ENABLED}}", https_enabled)
+                new_content = new_content.replace("{{MESSAGE_ROUTER_PORT}}", message_router_port)
+
+                if new_content != content:
+                    f.seek(0)
+                    f.truncate()
+                    f.write(new_content)
+                    print("File {0} updated!".format(file))
+        except UnicodeDecodeError:
+            print("File didn't open: ", file)
+
+    exit(0)
index 9625c48..4a6f3db 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # Copyright 2019 © Samsung Electronics Co., Ltd.
 # Modification Copyright 2021 © AT&T Intellectual Property.
-# Modification Copyright 2021. Nordix Foundation.
+# Modification Copyright 2021-2022 Nordix Foundation.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 #
 
 if [ -z "$WORKSPACE" ]; then
-    export WORKSPACE=`git rev-parse --show-toplevel`
+    export WORKSPACE=$(git rev-parse --show-toplevel)
 fi
 
 # Assume that if ROBOT_VENV is set and virtualenv with system site packages can be activated,
 # include-raw-integration-install-robotframework.sh has already been executed
 
-if [ -f ${WORKSPACE}/env.properties ]; then
-    source ${WORKSPACE}/env.properties
+if [ -f "${WORKSPACE}"/env.properties ]; then
+    source "${WORKSPACE}"/env.properties
 fi
-if [ -f ${ROBOT_VENV}/bin/activate ]; then
-    source ${ROBOT_VENV}/bin/activate
+if [ -f "${ROBOT_VENV}"/bin/activate ]; then
+    source "${ROBOT_VENV}"/bin/activate
 else
     source ./include-raw-integration-install-robotframework.sh
 fi
 
 
 # install eteutils
-mkdir -p ${ROBOT_VENV}/src/onap
-rm -rf ${ROBOT_VENV}/src/onap/testsuite
+mkdir -p "${ROBOT_VENV}"/src/onap
+rm -rf "${ROBOT_VENV}"/src/onap/testsuite
 python3 -m pip install --upgrade --extra-index-url="https://nexus3.onap.org/repository/PyPi.staging/simple" 'robotframework-onap==0.5.1.*' --pre
 
 python3 -m pip freeze
index d77b06f..f09af48 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright 2016-2017 Huawei Technologies Co., Ltd.
 # Modification Copyright 2019 © Samsung Electronics Co., Ltd.
 # Modification Copyright 2021 © AT&T Intellectual Property.
-# Modification Copyright 2021. Nordix Foundation.
+# Modification Copyright 2021-2022 Nordix Foundation.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -143,7 +143,11 @@ export SCRIPTS="${WORKSPACE}/csit"
 export ROBOT_VARIABLES=
 
 # get the plan from git clone
-source ${SCRIPTS}/get-branch-mariadb.sh
+source "${SCRIPTS}"/get-branch.sh
+
+# Prepare configuration files
+cd "${WORKSPACE}/csit"
+python3 ./prepare-config-files.py --https=true
 
 export PROJECT="${1}"
 
diff --git a/csit/start-grafana.sh b/csit/start-grafana.sh
new file mode 100755 (executable)
index 0000000..0350ad2
--- /dev/null
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# ============LICENSE_START====================================================
+#  Copyright (C) 2022 Nordix Foundation.
+# =============================================================================
+# 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+SCRIPTS=$(git rev-parse --show-toplevel)
+export SCRIPTS="${SCRIPTS}"/csit
+
+cd ${SCRIPTS}
+
+python3 ./prepare-config-files.py --https=false
+
+source ./get-versions.sh
+
+export PROJECT="${1}"
+
+if [ -z "${PROJECT}" ]; then
+    echo "Starting all components..."
+    docker-compose -f ./compose-grafana.yml up -d
+else
+    echo "Starting ${PROJECT} application..."
+    docker-compose -f ./compose-grafana.yml up -d "${PROJECT}" grafana
+fi
+
+prometheus=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' prometheus)
+grafana=$(docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' grafana)
+
+echo "Prometheus server: http://${prometheus}:9090"
+echo "Grafana server: http://${grafana}:3000"
diff --git a/csit/stop-grafana.sh b/csit/stop-grafana.sh
new file mode 100755 (executable)
index 0000000..901a034
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/bash
+#
+# ============LICENSE_START====================================================
+#  Copyright (C) 2022 Nordix Foundation.
+# =============================================================================
+# 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+SCRIPTS=$(git rev-parse --show-toplevel)
+export SCRIPTS="${SCRIPTS}"/csit
+
+source "${SCRIPTS}"/get-versions.sh
+
+docker-compose -f "${SCRIPTS}"/compose-grafana.yml down
index 718d512..c99a031 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-#  Modification Copyright 2021. Nordix Foundation.
+#  Modifications Copyright 2021-2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
 #
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
-source ${SCRIPTS}/get-branch-mariadb.sh
 
 echo "Uninstall docker-py and reinstall docker."
 python3 -m pip uninstall -y docker-py
@@ -25,30 +24,30 @@ python3 -m pip uninstall -y docker
 python3 -m pip install -U docker
 
 sudo apt-get -y install libxml2-utils
-bash ${SCRIPTS}/get-models-examples.sh
 
-source ${SCRIPTS}/detmVers.sh
+source "${SCRIPTS}"/get-versions.sh
+bash "${SCRIPTS}"/get-models-examples.sh
 
-docker-compose -f ${SCRIPTS}/docker-compose-all.yml up -d xacml-pdp
+docker-compose -f "${SCRIPTS}"/docker-compose-all.yml up -d xacml-pdp
 
 unset http_proxy https_proxy
 
-POLICY_API_IP=`get-instance-ip.sh policy-api`
-MARIADB_IP=`get-instance-ip.sh mariadb`
-POLICY_PDPX_IP=`get-instance-ip.sh policy-xacml-pdp`
-SIM_IP=`get-instance-ip.sh simulator`
-POLICY_PAP_IP=`get-instance-ip.sh policy-pap`
+POLICY_API_IP=$(get-instance-ip.sh policy-api)
+MARIADB_IP=$(get-instance-ip.sh mariadb)
+POLICY_PDPX_IP=$(get-instance-ip.sh policy-xacml-pdp)
+SIM_IP=$(get-instance-ip.sh simulator)
+POLICY_PAP_IP=$(get-instance-ip.sh policy-pap)
 
 export SIM_IP
 
-echo PDP IP IS ${POLICY_PDPX_IP}
-echo API IP IS ${POLICY_API_IP}
-echo PAP IP IS ${POLICY_PAP_IP}
-echo MARIADB IP IS ${MARIADB_IP}
-echo SIM_IP IS ${SIM_IP}
+echo PDP IP IS "${POLICY_PDPX_IP}"
+echo API IP IS "${POLICY_API_IP}"
+echo PAP IP IS "${POLICY_PAP_IP}"
+echo MARIADB IP IS "${MARIADB_IP}"
+echo SIM_IP IS "${SIM_IP}"
 
 # wait for the app to start up
-${SCRIPTS}/wait_for_port.sh ${POLICY_PDPX_IP} 6969
+"${SCRIPTS}"/wait_for_port.sh "${POLICY_PDPX_IP}" 6969
 
 DATA2=${WORKSPACE}/models/models-examples/src/main/resources/policies
 
index e101973..3e2fc5f 100644 (file)
@@ -1,6 +1,7 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
 #  Copyright (C) 2019-2021 AT&T Intellectual Property. All rights reserved.
+#  Modifications copyright (c) 2022 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -17,4 +18,9 @@
 # SPDX-License-Identifier: Apache-2.0
 # ============LICENSE_END=========================================================
 
+docker logs policy-api
+docker logs simulator
+docker logs policy-pap
+docker logs xacml-pdp
+
 docker-compose -f ${SCRIPTS}/docker-compose-all.yml down -v