Add performance test producer deployment yaml 89/90889/3
authorJakub Dudycz <jakub.dudycz@nokia.com>
Wed, 3 Jul 2019 13:17:16 +0000 (15:17 +0200)
committerJakub Dudycz <jakub.dudycz@nokia.com>
Fri, 5 Jul 2019 08:31:24 +0000 (10:31 +0200)
- create cloud performance test directory structure
- move consumer deployment file to "tools/performence/cloud" directory

Change-Id: Ia5c6d8ed15a2188ff9306cf788052f432dae1e33
Signed-off-by: Jakub Dudycz <jakub.dudycz@nokia.com>
Issue-ID: DCAEGEN2-1652

tools/performance/cloud/consumer-deployment.yaml [moved from sources/hv-collector-kafka-consumer/k8s-deployment.yaml with 82% similarity]
tools/performance/cloud/producer-pod.yaml [new file with mode: 0644]
tools/performance/cloud/test.properties [new file with mode: 0644]
tools/performance/local/configuration/base.json [moved from tools/performance/configuration/base.json with 100% similarity]
tools/performance/local/consul/configuration.hcl [moved from tools/performance/consul/configuration.hcl with 100% similarity]
tools/performance/local/docker-compose.yml [moved from tools/performance/docker-compose.yml with 99% similarity]
tools/performance/local/local-performance-test.sh [moved from tools/performance/local-performance-test.sh with 95% similarity]
tools/performance/local/logs/.gitignore [moved from tools/performance/logs/.gitignore with 100% similarity]
tools/performance/local/prometheus.yml [moved from tools/performance/prometheus.yml with 100% similarity]

 # limitations under the License.
 # ============LICENSE_END=========================================================
 
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: kafka-servers-config
-  namespace: onap
-data:
-  kafka.bootstrapServers: message-router-kafka-0:9092,message-router-kafka-1:9092,message-router-kafka-2:9092
-  kafka.topics: HV_VES_PERF3GPP
-
 ---
 
 apiVersion: apps/v1
@@ -59,13 +50,13 @@ spec:
             - name: KAFKA_BOOTSTRAP_SERVERS
               valueFrom:
                 configMapKeyRef:
-                  name: kafka-servers-config
-                  key: kafka.bootstrapServers
+                  name: performance-test-config
+                  key: consumer.kafka.bootstrapServers
             - name: KAFKA_TOPICS
               valueFrom:
                 configMapKeyRef:
-                  name: kafka-servers-config
-                  key: kafka.topics
+                  name: performance-test-config
+                  key: consumer.kafka.topics
             - name: DISABLE_PROCESSING
 
 ---
@@ -102,10 +93,10 @@ spec:
             - name: KAFKA_BOOTSTRAP_SERVERS
               valueFrom:
                 configMapKeyRef:
-                  name: kafka-servers-config
-                  key: kafka.bootstrapServers
+                  name: performance-test-config
+                  key: consumer.kafka.bootstrapServers
             - name: KAFKA_TOPICS
               valueFrom:
                 configMapKeyRef:
-                  name: kafka-servers-config
-                  key: kafka.topics
\ No newline at end of file
+                  name: performance-test-config
+                  key: consumer.kafka.topics
\ No newline at end of file
diff --git a/tools/performance/cloud/producer-pod.yaml b/tools/performance/cloud/producer-pod.yaml
new file mode 100644 (file)
index 0000000..75d0379
--- /dev/null
@@ -0,0 +1,61 @@
+# ============LICENSE_START=======================================================
+# dcaegen2-collectors-veshv
+# ================================================================================
+# Copyright (C) 2019 NOKIA
+# ================================================================================
+# 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=========================================================
+
+apiVersion: v1
+kind: Pod
+metadata:
+  name: hv-collector-producer
+  namespace: onap
+  labels:
+    app: hv-collector-producer
+spec:
+  containers:
+    - name: hv-collector-producer
+      image: the-a-team-registry-local.esisoj70.emea.nsn-net.net/onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-rust-client:latest
+      env:
+        - name: HV_VES_ADDRESS
+          valueFrom:
+            configMapKeyRef:
+              name: performance-test-config
+              key: producer.hvVesAddress
+        - name: CLIENTS_COUNT
+          valueFrom:
+            configMapKeyRef:
+              name: performance-test-config
+              key: producer.client.count
+        - name: MSG_SIZE
+          valueFrom:
+            configMapKeyRef:
+              name: performance-test-config
+              key: producer.message.size
+        - name: MSG_COUNT
+          valueFrom:
+            configMapKeyRef:
+              name: performance-test-config
+              key: producer.message.count
+        - name: INTERVAL_MS
+          valueFrom:
+            configMapKeyRef:
+              name: performance-test-config
+              key: producer.message.interval
+      args: ["--ssl-disable",
+             "--address", "$HV_VES_ADDRESS",
+             "--clients", "$CLIENTS_COUNT",
+             "--msgsize", "$MSG_SIZE",
+             "--msgcount", "$MSG_COUNT",
+             "--intervalms", "$INTERVAL_MS"]
\ No newline at end of file
diff --git a/tools/performance/cloud/test.properties b/tools/performance/cloud/test.properties
new file mode 100644 (file)
index 0000000..9865339
--- /dev/null
@@ -0,0 +1,24 @@
+# TODO: in script create configmap from that file
+
+# PRODUCER CONFIGURATION
+
+# HV-VES address
+producer.hvVesAddress=ves-hv-collector:6061
+# Number of pods to create
+producer.pod.count=1
+# Number of clients per pod
+producer.client.count=1
+# Size in bytes of a single message
+producer.message.size=16384
+# Amount of messages to sent by one client in a single pod
+producer.message.count=1000
+# Interval between messages
+producer.message.interval=0
+
+
+# CONSUMER CONFIGURATION
+
+# Addresses of Kafka services to consume from
+consumer.kafka.bootstrapServers=message-router-kafka-0:9092,message-router-kafka-1:9092,message-router-kafka-2:9092
+# Kafka topics to subscribe to
+consumer.kafka.topics=HV_VES_PERF3GPP
similarity index 99%
rename from tools/performance/docker-compose.yml
rename to tools/performance/local/docker-compose.yml
index 8214323..c0dfc47 100644 (file)
@@ -98,7 +98,7 @@ services:
     volumes:
       - ./configuration/:/etc/ves-hv/configuration/
       - ./logs:/var/log/ONAP/dcae-hv-ves-collector
-      - ../ssl/:/etc/ves-hv/ssl/
+      - ../../ssl/:/etc/ves-hv/ssl/
 
   kafka-consumer:
     image: onap/org.onap.dcaegen2.collectors.hv-ves.hv-collector-kafka-consumer
similarity index 95%
rename from tools/performance/local-performance-test.sh
rename to tools/performance/local/local-performance-test.sh
index cad21ef..3c885a6 100755 (executable)
@@ -1,7 +1,6 @@
 #!/usr/bin/env bash
 
-cd "$(dirname "$0")"
-
+SCRIPT_DIRECTORY="$(dirname "$0")"
 CERT_FILE=${CERT_FILE:-/ssl/client.p12}
 CERT_PASS_FILE=${CERT_PASS_FILE:-/ssl/client.pass}
 HV_VES_NETWORK=${HV_VES_NETWORK:-performance_default}
@@ -16,7 +15,6 @@ MSG_SIZE=16384
 MSG_COUNT=1000
 INTERVAL_MS=0
 
-
 function usage() {
     echo ""
     echo "Run HV-VES performance test locally"
@@ -26,7 +24,7 @@ function usage() {
     echo "    Optional parameters:"
     echo "      --address    : HV-VES address in host:port format (ves-hv-collector:6061)"
     echo "      --containers : number of docker containers to create (1)"
-    echo "      --clients    : number of clients in single container (1)"
+    echo "      --clients    : number of clients in single container (1)"
     echo "      --msg-size   : size in bytes of a single message (16384)"
     echo "      --msg-count  : amount of messages to sent by one client in single container (1000)"
     echo "      --interval   : interval between messages (0)"
@@ -41,9 +39,9 @@ function usage() {
 
 function setup_environment(){
     echo "Setting up"
-    cd ../ssl
+    cd ../../ssl
     ./gen-certs.sh
-    cd ../performance
+    cd "$SCRIPT_DIRECTORY"
     docker-compose up -d
 
     echo "Waiting for components to be healthy.."
@@ -101,7 +99,6 @@ function create_containers(){
         --address "$HV_VES_ADDRESS" \
         --certfile "$CERT_FILE" \
         --certpass "$CERT_PASS_FILE" \
-        --containers "$CONTAINERS_COUNT" \
         --clients "$CLIENTS_PER_CONTAINER" \
         --msgsize "$MSG_SIZE" \
         --msgcount "$MSG_COUNT" \
@@ -116,15 +113,17 @@ function clean(){
     docker rm --force $(docker ps -aqf "label=app=$PRODUCER_APP_NAME")
 
     echo "Clearing generated certs"
-    cd ../ssl
+    cd ../../ssl
     ./gen-certs.sh clean
-    cd ../performance
+    cd "$SCRIPT_DIRECTORY"
 
     echo "Removing HV-VES components"
     docker-compose down
     exit 0
 }
 
+cd "$SCRIPT_DIRECTORY"
+
 if [[ $# -eq 0 ]]; then
     usage
 else