From 4f2ce0b35e54366d47db601dc365d7cdf5469b0b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de>
Date: Sat, 3 Dec 2022 15:43:30 +0100
Subject: [PATCH] Add vertical scaling option for Samza

---
 .../uc1-beam-samza-benchmark-operator.yaml    | 21 +++++++++++++++++++
 .../uc2-beam-samza-benchmark-operator.yaml    | 21 +++++++++++++++++++
 .../uc3-beam-samza-benchmark-operator.yaml    | 21 +++++++++++++++++++
 .../uc4-beam-samza-benchmark-operator.yaml    | 21 +++++++++++++++++++
 4 files changed, 84 insertions(+)

diff --git a/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml
index 615511caf..08d86ad97 100644
--- a/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc1-beam-samza/uc1-beam-samza-benchmark-operator.yaml
@@ -36,6 +36,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc1-beam-samza-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc1-beam-samza-deployment.yaml
+          properties:
+            container: uc1-beam-samza
+            variableName: SAMZA_JOB_CONTAINER_THREADS_POOL_SIZE
+        - type: ResourceLimitPatcher
+          resource: uc1-beam-samza-deployment.yaml
+          properties:
+            container: uc1-beam-samza
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc1-beam-samza-deployment.yaml
+          properties:
+            container: uc1-beam-samza
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumSensors"
       patchers:
diff --git a/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml
index c385df649..f179cec2c 100644
--- a/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc2-beam-samza/uc2-beam-samza-benchmark-operator.yaml
@@ -36,6 +36,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc2-beam-samza-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc2-beam-samza-deployment.yaml
+          properties:
+            container: uc2-beam-samza
+            variableName: SAMZA_JOB_CONTAINER_THREADS_POOL_SIZE
+        - type: ResourceLimitPatcher
+          resource: uc2-beam-samza-deployment.yaml
+          properties:
+            container: uc2-beam-samza
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc2-beam-samza-deployment.yaml
+          properties:
+            container: uc2-beam-samza
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumSensors"
       patchers:
diff --git a/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml
index 6fde25874..cc3af9f51 100644
--- a/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc3-beam-samza/uc3-beam-samza-benchmark-operator.yaml
@@ -36,6 +36,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc3-beam-samza-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc3-beam-samza-deployment.yaml
+          properties:
+            container: uc3-beam-samza
+            variableName: SAMZA_JOB_CONTAINER_THREADS_POOL_SIZE
+        - type: ResourceLimitPatcher
+          resource: uc3-beam-samza-deployment.yaml
+          properties:
+            container: uc3-beam-samza
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc3-beam-samza-deployment.yaml
+          properties:
+            container: uc3-beam-samza
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumSensors"
       patchers:
diff --git a/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml
index b07976d82..fcded561e 100644
--- a/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml
+++ b/theodolite-benchmarks/definitions/uc4-beam-samza/uc4-beam-samza-benchmark-operator.yaml
@@ -36,6 +36,27 @@ spec:
       patchers:
         - type: "ReplicaPatcher"
           resource: "uc4-beam-samza-deployment.yaml"
+    - typeName: ThreadsAndPodResources
+      patchers:
+        - type: EnvVarPatcher
+          resource: uc4-beam-samza-deployment.yaml
+          properties:
+            container: uc4-beam-samza
+            variableName: SAMZA_JOB_CONTAINER_THREADS_POOL_SIZE
+        - type: ResourceLimitPatcher
+          resource: uc4-beam-samza-deployment.yaml
+          properties:
+            container: uc4-beam-samza
+            limitedResource: cpu
+            factor: 1000
+            format: m
+        - type: ResourceLimitPatcher
+          resource: uc4-beam-samza-deployment.yaml
+          properties:
+            container: uc4-beam-samza
+            limitedResource: memory
+            factor: 4
+            format: Gi
   loadTypes:
     - typeName: "NumNestedGroups"
       patchers:
-- 
GitLab