Alter s3p for kafka 65/137865/2
authorsaul.gill <saul.gill@est.tech>
Wed, 8 May 2024 12:02:03 +0000 (13:02 +0100)
committersaul.gill <saul.gill@est.tech>
Thu, 9 May 2024 10:45:45 +0000 (11:45 +0100)
Issue-ID: POLICY-4989
Change-Id: I7bf0bb794059f50a55ccd43c46fea11870d7a053
Signed-off-by: saul.gill <saul.gill@est.tech>
testsuites/run-s3p-test.sh
testsuites/stability/src/main/resources/setup/config/jsonConfigs/pdpSimConfig.json
testsuites/stability/src/main/resources/setup/config/papParameters.yaml
testsuites/stability/src/main/resources/setup/docker-compose.yml

index 00f8643..a0c53b4 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/bash
 # ============LICENSE_START=======================================================
-#  Copyright (c) 2023 Nordix Foundation.
+#  Copyright (c) 2023-2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -87,7 +87,7 @@ sudo apt install -y wget unzip
 
 # Install JMeter
 mkdir -p ~/jmeter
-wget https://dlcdn.apache.org//jmeter/binaries/apache-jmeter-5.5.zip # check if valid version
+wget https://archive.apache.org/dist/jmeter/binaries/apache-jmeter-5.5.zip # check if valid version
 unzip -q -d ~/jmeter apache-jmeter-5.5.zip
 rm apache-jmeter-5.5.zip
 
index d809955..3459ca1 100644 (file)
     "topicParameterGroup": {
         "topicSources": [
             {
-                "topic": "POLICY-PDP-PAP",
+                "topic": "policy-pdp-pap",
                 "servers": [
-                    "message-router:3904"
+                    "kafka:9092"
                 ],
-                "topicCommInfrastructure": "dmaap"
+                "fetchTimeout": 15000,
+                "topicCommInfrastructure": "kafka"
             }
         ],
         "topicSinks": [
             {
-                "topic": "POLICY-PDP-PAP",
+                "topic": "policy-pdp-pap",
                 "servers": [
-                    "message-router:3904"
+                    "kafka:9092"
                 ],
-                "topicCommInfrastructure": "dmaap"
+                "topicCommInfrastructure": "kafka"
             }
         ]
     }
index 4020365..7235395 100644 (file)
@@ -12,9 +12,6 @@ spring:
     username: policy_user
     password: policy_user
   jpa:
-    properties:
-      hibernate:
-        dialect: org.hibernate.dialect.MariaDB103Dialect
     hibernate:
       ddl-auto: none
       naming:
@@ -32,9 +29,9 @@ pap:
   name: PapGroup
   aaf: false
   topic:
-    pdp-pap.name: POLICY-PDP-PAP
-    notification.name: POLICY-NOTIFICATION
-    heartbeat.name: POLICY-HEARTBEAT
+    pdp-pap.name: policy-pdp-pap
+    notification.name: policy-notification
+    heartbeat.name: policy-heartbeat
   pdpParameters:
     heartBeatMs: 120000
     updateParameters:
@@ -46,30 +43,30 @@ pap:
   savePdpStatisticsInDb: true
   topicParameterGroup:
     topicSources:
-      - topic: POLICY-PDP-PAP
+      - topic: ${pap.topic.pdp-pap.name}
         servers:
-          - message-router
-        topicCommInfrastructure: dmaap
+          - kafka:9092
+        topicCommInfrastructure: kafka
         useHttps: false
         fetchTimeout: 15000
-      - topic: POLICY-HEARTBEAT
-        effectiveTopic: POLICY-PDP-PAP
+      - topic: ${pap.topic.heartbeat.name}
+        effectiveTopic: ${pap.topic.pdp-pap.name}
         consumerGroup: policy-pap
         servers:
-          - message-router
-        topicCommInfrastructure: dmaap
+          - kafka:9092
+        topicCommInfrastructure: kafka
         useHttps: false
         fetchTimeout: 15000
     topicSinks:
-      - topic: POLICY-PDP-PAP
+      - topic: ${pap.topic.pdp-pap.name}
         servers:
-          - message-router
-        topicCommInfrastructure: dmaap
+          - kafka:9092
+        topicCommInfrastructure: kafka
         useHttps: false
-      - topic: POLICY-NOTIFICATION
+      - topic: ${pap.topic.notification.name}
         servers:
-          - message-router
-        topicCommInfrastructure: dmaap
+          - kafka:9092
+        topicCommInfrastructure: kafka
         useHttps: false
   healthCheckRestClientParameters:
     - clientName: api
@@ -88,4 +85,4 @@ management:
         include: health, metrics, prometheus
       path-mapping:
         -metrics: plain-metrics
-        -prometheus: metrics
\ No newline at end of file
+        -prometheus: metrics
index 2fd77d7..75dd928 100644 (file)
@@ -1,5 +1,5 @@
 # ============LICENSE_START=======================================================
-# Copyright (C) 2021-2023 Nordix Foundation.
+# Copyright (C) 2021-2024 Nordix Foundation.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -49,23 +49,12 @@ services:
       '/opt/app/policy/bin/db_migrator_policy_init.sh',
       'mariadb', '3306'
     ]
-  simulator:
-    image: nexus3.onap.org:10001/onap/policy-models-simulator:${POLICY_MODELS_SIMULATOR}
-    container_name: simulator
-    hostname: simulator
-    networks:
-      default:
-        aliases:
-          - message-router
-    expose:
-      - 3904
-    volumes:
-      - ./config/jsonConfigs/dmaapSimConfig.json:/opt/app/policy/simulators/etc/mounted/simParameters.json:ro
+
   pdp:
     image: pdp/simulator
     container_name: pdp-simulator
     depends_on:
-      - simulator
+      - kafka
     hostname: pdp-simulator
     volumes:
       - ./config/wait_for_port.sh:/opt/app/policy/pdp-sim/bin/wait_for_port.sh:ro
@@ -95,7 +84,7 @@ services:
       - 6969
     depends_on:
       - policy-db-migrator
-      - simulator
+      - kafka
       - policy-api
     volumes:
       - ./config/wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
@@ -105,7 +94,7 @@ services:
     command: [
       '-c', './policy-pap.sh',
       'mariadb', '3306',
-      'message-router', '3904',
+      'kafka', '9092',
       'policy-api', '6969'
     ]
   policy-dist:
@@ -126,7 +115,32 @@ services:
     command: [
       '-c', './policy-dist.sh',
       'mariadb', '3306',
-      'message-router', '3904',
+      'kafka', '9092',
       'policy-api', '6969',
       'policy-pap', '6969'
     ]
+
+  zookeeper:
+    image: confluentinc/cp-zookeeper:latest
+    container_name: zookeeper
+    environment:
+      ZOOKEEPER_CLIENT_PORT: 2181
+      ZOOKEEPER_TICK_TIME: 2000
+    ports:
+      - "2181:2181"
+
+  kafka:
+    image: confluentinc/cp-kafka:latest
+    container_name: kafka
+    depends_on:
+      - zookeeper
+    ports:
+      - "29092:29092"
+      - "9092:9092"
+    environment:
+      KAFKA_BROKER_ID: 1
+      KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
+      KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
+      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
+      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1