From 36f1786dbd131ff63b993aa65f4c8f2d18b757f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <post@soeren-henning.de> Date: Sat, 2 May 2020 12:20:33 +0200 Subject: [PATCH] Add basic support for distributed load generation in UC1 --- execution/run_uc1-new.sh | 4 +++- execution/uc1-workload-generator/deployment.yaml | 13 ++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/execution/run_uc1-new.sh b/execution/run_uc1-new.sh index 77e26884d..d83772da3 100755 --- a/execution/run_uc1-new.sh +++ b/execution/run_uc1-new.sh @@ -19,7 +19,9 @@ kubectl exec kafka-client -- bash -c "kafka-topics --zookeeper my-confluent-cp-z # Start workload generator NUM_SENSORS=$DIM_VALUE -sed "s/{{NUM_SENSORS}}/$NUM_SENSORS/g" uc1-workload-generator/deployment.yaml | kubectl apply -f - +WL_MAX_RECORDS=150000 +WL_INSTANCES=$(((NUM_SENSORS + (WL_MAX_RECORDS -1 ))/ WL_MAX_RECORDS)) +sed "s/{{NUM_SENSORS}}/$NUM_SENSORS/g; s/{{INSTANCES}}/$WL_INSTANCES/g" uc1-workload-generator/deployment.yaml | kubectl apply -f - # Start application REPLICAS=$INSTANCES diff --git a/execution/uc1-workload-generator/deployment.yaml b/execution/uc1-workload-generator/deployment.yaml index f82519ebd..a0fde4bbf 100644 --- a/execution/uc1-workload-generator/deployment.yaml +++ b/execution/uc1-workload-generator/deployment.yaml @@ -1,12 +1,13 @@ apiVersion: apps/v1 -kind: Deployment +kind: StatefulSet metadata: name: titan-ccp-load-generator spec: selector: matchLabels: app: titan-ccp-load-generator - replicas: 1 + serviceName: titan-ccp-load-generator + replicas: {{INSTANCES}} template: metadata: labels: @@ -15,10 +16,16 @@ spec: terminationGracePeriodSeconds: 0 containers: - name: workload-generator - image: benediktwetzel/uc1-wg:latest + image: soerenhenning/uc1-wg:latest env: - name: KAFKA_BOOTSTRAP_SERVERS value: "my-confluent-cp-kafka:9092" - name: NUM_SENSORS value: "{{NUM_SENSORS}}" + - name: POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name + - name: INSTANCES + value: "{{INSTANCES}}" \ No newline at end of file -- GitLab