Add docker compose deployment for endurance tests 11/139311/2
authorhalil.cakal <halil.cakal@est.tech>
Thu, 31 Oct 2024 10:37:13 +0000 (10:37 +0000)
committerhalil.cakal <halil.cakal@est.tech>
Fri, 1 Nov 2024 11:40:47 +0000 (11:40 +0000)
- add new config file containing env variables for endurance test
- add notes to describe how to run and stop it

Note 1: Existing docker-compose deployment won't be affected by this
changes
Note 2: Both docker-compose can be deployed simultaneously without any
issue

Issue-ID: CPS-2463

Change-Id: I15936718dda2f31a5077b9c36eded21c1a85dfcd
Signed-off-by: halil.cakal <halil.cakal@est.tech>
docker-compose/config/endurance.env [new file with mode: 0644]
docker-compose/docker-compose.yml

diff --git a/docker-compose/config/endurance.env b/docker-compose/config/endurance.env
new file mode 100644 (file)
index 0000000..0ca1a11
--- /dev/null
@@ -0,0 +1,35 @@
+DB_CONTAINER_NAME=endurance-dbpostgresql
+DB_PORT=5433
+
+NGINX_CONTAINER_NAME=endurance-nginx-loadbalancer
+CPS_CORE_PORT=8884
+
+ZOOKEEPER_CONTAINER_NAME=endurance-zookeeper
+ZOOKEEPER_PORT=2182
+
+KAFKA_CONTAINER_NAME=endurance-kafka
+KAFKA_PORT=9093
+
+NCMP_DMI_PLUGIN_CONTAINER_NAME=endurance-ncmp-dmi-plugin
+DMI_PORT=8786
+
+NCMP_DMI_PLUGIN_DEMO_AND_CSIT_STUB_CONTAINER_NAME=endurance-ncmp-dmi-plugin-demo-and-csit-stub
+DMI_DEMO_STUB_PORT=8787
+
+POLICY_EXECUTOR_STUB_CONTAINER_NAME=endurance-policy-executor-stub
+POLICY_EXECUTOR_STUB_PORT=8788
+
+PROMETHEUS_CONTAINER_NAME=endurance-prometheus
+PROMETHEUS_PORT=9091
+
+GRAFANA_CONTAINER_NAME=endurance-grafana
+GRAFANA_PORT=3001
+
+KAFKA_UI_CONTAINER_NAME=endurance-kafka-ui
+KAFKA_UI_PORT=8090
+
+JAEGER_SERVICE_CONTAINER_NAME=endurance-jaeger-service
+JAEGER_SERVICE_PORT=16687
+
+CPS_NCMP_CACHES_CLUSTER_NAME=endurance-cps-and-ncmp-common-cache-cluster
+CPS_NCMP_INSTANCE_CONFIG_NAME=endurance-cps-and-ncmp-hazelcast-instance-config
\ No newline at end of file
index b854064..feb58d8 100644 (file)
@@ -24,9 +24,11 @@ services:
   ### docker-compose --profile dmi-stub --profile policy-executor-stub up -d -> run CPS with stubbed dmi-plugin and policy executor stub (for policy executor service testing make POLICY_SERVICE_ENABLED "true")
   ### to disable notifications make notification.enabled to false & comment out kafka/zookeeper services ###
   ### DEBUG: Look for '### DEBUG' comments to enable CPS-NCMP debugging
+  ### docker-compose --profile dmi-stub --project-name endurance --env-file config/endurance.env up -d -> run CPS with stubbed dmi-plugin for endurance testing
+  ### docker-compose --profile dmi-stub --project-name endurance down --volumes
 
   dbpostgresql:
-    container_name: dbpostgresql
+    container_name: ${DB_CONTAINER_NAME:-dbpostgresql}
     image: postgres:14.1-alpine
     ports:
       - ${DB_PORT:-5432}:5432
@@ -80,7 +82,7 @@ services:
     ### DEBUG  - ${CPS_CORE_DEBUG_PORT:-5005}:5005
 
   nginx:
-    container_name: nginx-loadbalancer
+    container_name: ${NGINX_CONTAINER_NAME:-nginx-loadbalancer}
     image: nginx:latest
     ports:
       - ${CPS_CORE_PORT:-8883}:80
@@ -93,17 +95,17 @@ services:
   ### if kafka is not required comment out zookeeper and kafka ###
   zookeeper:
     image: confluentinc/cp-zookeeper:6.2.1
-    container_name: zookeeper
+    container_name: ${ZOOKEEPER_CONTAINER_NAME:-zookeeper}
     ports:
-      - '2181:2181'
+      - ${ZOOKEEPER_PORT:-2181}:2181
     environment:
       ZOOKEEPER_CLIENT_PORT: 2181
 
   kafka:
     image: confluentinc/cp-kafka:6.2.1
-    container_name: kafka
+    container_name: ${KAFKA_CONTAINER_NAME:-kafka}
     ports:
-      - '9092:9092'
+      - ${KAFKA_PORT:-9092}:9092
     depends_on:
       - zookeeper
     environment:
@@ -114,7 +116,7 @@ services:
       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
 
   ncmp-dmi-plugin:
-    container_name: ncmp-dmi-plugin
+    container_name: ${NCMP_DMI_PLUGIN_CONTAINER_NAME:-ncmp-dmi-plugin}
     image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/ncmp-dmi-plugin:${DMI_VERSION:-1.6.0-SNAPSHOT-latest}
     ports:
       - ${DMI_PORT:-8783}:8080
@@ -139,7 +141,7 @@ services:
       - dmi-service
 
   ncmp-dmi-plugin-demo-and-csit-stub:
-    container_name: ncmp-dmi-plugin-demo-and-csit-stub
+    container_name: ${NCMP_DMI_PLUGIN_DEMO_AND_CSIT_STUB_CONTAINER_NAME:-ncmp-dmi-plugin-demo-and-csit-stub}
     image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/dmi-plugin-demo-and-csit-stub:${DMI_DEMO_STUB_VERSION:-latest}
     ports:
       - ${DMI_DEMO_STUB_PORT:-8784}:8092
@@ -158,19 +160,19 @@ services:
       - dmi-service
 
   policy-executor-stub:
-    container_name: policy-executor-stub
+    container_name: ${POLICY_EXECUTOR_STUB_CONTAINER_NAME:-policy-executor-stub}
     image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/policy-executor-stub:latest
     ports:
-      - 8785:8093
+      - ${POLICY_EXECUTOR_STUB_PORT:-8785}:8093
     restart: unless-stopped
     profiles:
       - policy-executor-stub
 
   prometheus:
-    container_name: prometheus
+    container_name: ${PROMETHEUS_CONTAINER_NAME:-prometheus}
     image: prom/prometheus:latest
     ports:
-      - 9090:9090
+      - ${PROMETHEUS_PORT:-9090}:9090
     restart: always
     volumes:
       - ./config/prometheus.yml:/etc/prometheus/prometheus.yml
@@ -180,12 +182,12 @@ services:
   grafana:
     image: grafana/grafana-oss:latest
     user: ""
-    container_name: grafana
+    container_name: ${GRAFANA_CONTAINER_NAME:-grafana}
     depends_on:
       prometheus:
         condition: service_started
     ports:
-      - 3000:3000
+      - ${GRAFANA_PORT:-3000}:3000
     volumes:
       - ./config/grafana/provisioning/:/etc/grafana/provisioning/
       - ./config/grafana/jvm-micrometer-dashboard.json:/var/lib/grafana/dashboards/jvm-micrometer-dashboard.json
@@ -197,10 +199,10 @@ services:
       - monitoring
 
   kafka-ui:
-    container_name: kafka-ui
+    container_name: ${KAFKA_UI_CONTAINER_NAME:-kafka-ui}
     image: provectuslabs/kafka-ui:latest
     ports:
-      - 8089:8080
+      - ${KAFKA_UI_PORT:-8089}:8080
     environment:
       DYNAMIC_CONFIG_ENABLED: 'true'
       KAFKA_CLUSTERS_0_NAME: 'cps-kafka-local'
@@ -209,10 +211,10 @@ services:
       - monitoring
 
   jaeger-service:
-    container_name: jaeger-service
+    container_name: ${JAEGER_SERVICE_CONTAINER_NAME:-jaeger-service}
     image: jaegertracing/all-in-one:latest
     ports:
-      - 16686:16686
+      - ${JAEGER_SERVICE_PORT:-16686}:16686
     restart: unless-stopped
     profiles:
       - tracing