From 827432ca68cbe1733c3ce640efe7ebdd6eb41aa0 Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Tue, 23 Nov 2021 11:47:13 +0100 Subject: [PATCH] Enhance crd benchmark schemata by adding an resources field, small enhancements --- docs/crd-docu.md | 153 +++++++++++--- .../uc1-flink-benchmark-operator.yaml | 33 +-- .../uc1-kstreams/uc1-benchmark-operator.yaml | 27 +-- .../uc1-benchmark-standalone.yaml | 31 +-- .../uc2-flink-benchmark-operator.yaml | 33 +-- .../uc2-kstreams/uc2-benchmark-operator.yaml | 13 +- .../uc2-benchmark-standalone.yaml | 27 +-- .../definitions/uc3-flink/test-exec.yaml | 56 ----- .../uc3-flink-benchmark-operator.yaml | 33 +-- .../uc3-kstreams/uc3-benchmark-operator.yaml | 27 +-- .../uc3-benchmark-standalone.yaml | 27 +-- .../uc4-flink-benchmark-operator.yaml | 33 +-- .../uc4-kstreams/uc4-benchmark-operator.yaml | 25 +-- .../uc4-benchmark-standalone.yaml | 27 +-- theodolite/crd/crd-benchmark.yaml | 191 ++++++++++-------- .../examples/operator/example-benchmark.yaml | 21 +- .../examples/resources/test-service.yaml | 16 -- .../standalone/example-benchmark.yaml | 20 +- .../benchmark/KubernetesBenchmark.kt | 14 +- .../kotlin/theodolite/benchmark/Resources.kt | 13 ++ .../operator/TheodoliteController.kt | 4 +- .../execution/operator/BenchmarkCRDummy.kt | 12 +- .../k8s-resource-files/test-benchmark.yaml | 1 - 23 files changed, 450 insertions(+), 387 deletions(-) delete mode 100644 theodolite-benchmarks/definitions/uc3-flink/test-exec.yaml delete mode 100644 theodolite/examples/resources/test-service.yaml create mode 100644 theodolite/src/main/kotlin/theodolite/benchmark/Resources.kt diff --git a/docs/crd-docu.md b/docs/crd-docu.md index f97164a29..400e888af 100644 --- a/docs/crd-docu.md +++ b/docs/crd-docu.md @@ -79,19 +79,21 @@ Resource Types: </tr> </thead> <tbody><tr> - <td><b>name</b></td> - <td>string</td> + <td><b><a href="#benchmarkspecinfrastructure">infrastructure</a></b></td> + <td>object</td> <td> - This field exists only for technical reasons and should not be set by the user. The value of the field will be overwritten.<br/> + (Optional) A list of file names that reference Kubernetes resources that are deployed on the cluster to create the required infrastructure.<br/> + <br/> + <i>Default</i>: map[]<br/> </td> <td>false</td> </tr><tr> - <td><b><a href="#benchmarkspecinfrastructureindex">infrastructure</a></b></td> - <td>[]object</td> + <td><b>name</b></td> + <td>string</td> <td> - A list of file names that reference Kubernetes resources that are deployed on the cluster to create the required infrastructure.<br/> + This field exists only for technical reasons and should not be set by the user. The value of the field will be overwritten.<br/> </td> - <td>true</td> + <td>false</td> </tr><tr> <td><b><a href="#benchmarkspeckafkaconfig">kafkaConfig</a></b></td> <td>object</td> @@ -100,8 +102,8 @@ Resource Types: </td> <td>true</td> </tr><tr> - <td><b><a href="#benchmarkspecloadgeneratorindex">loadGenerator</a></b></td> - <td>[]object</td> + <td><b><a href="#benchmarkspecloadgenerator">loadGenerator</a></b></td> + <td>object</td> <td> The loadGenResourceSets specifies all Kubernetes resources required to start the load generator. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet.<br/> </td> @@ -121,8 +123,8 @@ Resource Types: </td> <td>true</td> </tr><tr> - <td><b><a href="#benchmarkspecsutindex">sut</a></b></td> - <td>[]object</td> + <td><b><a href="#benchmarkspecsut">sut</a></b></td> + <td>object</td> <td> The appResourceSets specifies all Kubernetes resources required to start the sut. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet.<br/> </td> @@ -131,11 +133,40 @@ Resource Types: </table> -### benchmark.spec.infrastructure[index] +### benchmark.spec.infrastructure <sup><sup>[↩ Parent](#benchmarkspec)</sup></sup> +(Optional) A list of file names that reference Kubernetes resources that are deployed on the cluster to create the required infrastructure. + +<table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Required</th> + </tr> + </thead> + <tbody><tr> + <td><b><a href="#benchmarkspecinfrastructureresourcesindex">resources</a></b></td> + <td>[]object</td> + <td> + <br/> + <br/> + <i>Default</i>: []<br/> + </td> + <td>false</td> + </tr></tbody> +</table> + + +### benchmark.spec.infrastructure.resources[index] +<sup><sup>[↩ Parent](#benchmarkspecinfrastructure)</sup></sup> + + + <table> @@ -148,14 +179,14 @@ Resource Types: </tr> </thead> <tbody><tr> - <td><b><a href="#benchmarkspecinfrastructureindexconfigmap">configMap</a></b></td> + <td><b><a href="#benchmarkspecinfrastructureresourcesindexconfigmap">configMap</a></b></td> <td>object</td> <td> The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap.<br/> </td> <td>false</td> </tr><tr> - <td><b><a href="#benchmarkspecinfrastructureindexfilesystem">fileSystem</a></b></td> + <td><b><a href="#benchmarkspecinfrastructureresourcesindexfilesystem">fileSystem</a></b></td> <td>object</td> <td> The fileSystem resourceSet loads the Kubernetes manifests from the filesystem.<br/> @@ -165,8 +196,8 @@ Resource Types: </table> -### benchmark.spec.infrastructure[index].configMap -<sup><sup>[↩ Parent](#benchmarkspecinfrastructureindex)</sup></sup> +### benchmark.spec.infrastructure.resources[index].configMap +<sup><sup>[↩ Parent](#benchmarkspecinfrastructureresourcesindex)</sup></sup> @@ -199,8 +230,8 @@ The configMap resourceSet loads the Kubernetes manifests from an Kubernetes conf </table> -### benchmark.spec.infrastructure[index].fileSystem -<sup><sup>[↩ Parent](#benchmarkspecinfrastructureindex)</sup></sup> +### benchmark.spec.infrastructure.resources[index].fileSystem +<sup><sup>[↩ Parent](#benchmarkspecinfrastructureresourcesindex)</sup></sup> @@ -323,11 +354,40 @@ Contains the Kafka configuration. </table> -### benchmark.spec.loadGenerator[index] +### benchmark.spec.loadGenerator <sup><sup>[↩ Parent](#benchmarkspec)</sup></sup> +The loadGenResourceSets specifies all Kubernetes resources required to start the load generator. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet. + +<table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Required</th> + </tr> + </thead> + <tbody><tr> + <td><b><a href="#benchmarkspecloadgeneratorresourcesindex">resources</a></b></td> + <td>[]object</td> + <td> + <br/> + <br/> + <i>Default</i>: []<br/> + </td> + <td>false</td> + </tr></tbody> +</table> + + +### benchmark.spec.loadGenerator.resources[index] +<sup><sup>[↩ Parent](#benchmarkspecloadgenerator)</sup></sup> + + + <table> @@ -340,14 +400,14 @@ Contains the Kafka configuration. </tr> </thead> <tbody><tr> - <td><b><a href="#benchmarkspecloadgeneratorindexconfigmap">configMap</a></b></td> + <td><b><a href="#benchmarkspecloadgeneratorresourcesindexconfigmap">configMap</a></b></td> <td>object</td> <td> The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap.<br/> </td> <td>false</td> </tr><tr> - <td><b><a href="#benchmarkspecloadgeneratorindexfilesystem">fileSystem</a></b></td> + <td><b><a href="#benchmarkspecloadgeneratorresourcesindexfilesystem">fileSystem</a></b></td> <td>object</td> <td> The fileSystem resourceSet loads the Kubernetes manifests from the filesystem.<br/> @@ -357,8 +417,8 @@ Contains the Kafka configuration. </table> -### benchmark.spec.loadGenerator[index].configMap -<sup><sup>[↩ Parent](#benchmarkspecloadgeneratorindex)</sup></sup> +### benchmark.spec.loadGenerator.resources[index].configMap +<sup><sup>[↩ Parent](#benchmarkspecloadgeneratorresourcesindex)</sup></sup> @@ -391,8 +451,8 @@ The configMap resourceSet loads the Kubernetes manifests from an Kubernetes conf </table> -### benchmark.spec.loadGenerator[index].fileSystem -<sup><sup>[↩ Parent](#benchmarkspecloadgeneratorindex)</sup></sup> +### benchmark.spec.loadGenerator.resources[index].fileSystem +<sup><sup>[↩ Parent](#benchmarkspecloadgeneratorresourcesindex)</sup></sup> @@ -587,11 +647,40 @@ The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. </table> -### benchmark.spec.sut[index] +### benchmark.spec.sut <sup><sup>[↩ Parent](#benchmarkspec)</sup></sup> +The appResourceSets specifies all Kubernetes resources required to start the sut. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet. + +<table> + <thead> + <tr> + <th>Name</th> + <th>Type</th> + <th>Description</th> + <th>Required</th> + </tr> + </thead> + <tbody><tr> + <td><b><a href="#benchmarkspecsutresourcesindex">resources</a></b></td> + <td>[]object</td> + <td> + <br/> + <br/> + <i>Default</i>: []<br/> + </td> + <td>false</td> + </tr></tbody> +</table> + + +### benchmark.spec.sut.resources[index] +<sup><sup>[↩ Parent](#benchmarkspecsut)</sup></sup> + + + <table> @@ -604,14 +693,14 @@ The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. </tr> </thead> <tbody><tr> - <td><b><a href="#benchmarkspecsutindexconfigmap">configMap</a></b></td> + <td><b><a href="#benchmarkspecsutresourcesindexconfigmap">configMap</a></b></td> <td>object</td> <td> The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap.<br/> </td> <td>false</td> </tr><tr> - <td><b><a href="#benchmarkspecsutindexfilesystem">fileSystem</a></b></td> + <td><b><a href="#benchmarkspecsutresourcesindexfilesystem">fileSystem</a></b></td> <td>object</td> <td> The fileSystem resourceSet loads the Kubernetes manifests from the filesystem.<br/> @@ -621,8 +710,8 @@ The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. </table> -### benchmark.spec.sut[index].configMap -<sup><sup>[↩ Parent](#benchmarkspecsutindex)</sup></sup> +### benchmark.spec.sut.resources[index].configMap +<sup><sup>[↩ Parent](#benchmarkspecsutresourcesindex)</sup></sup> @@ -655,8 +744,8 @@ The configMap resourceSet loads the Kubernetes manifests from an Kubernetes conf </table> -### benchmark.spec.sut[index].fileSystem -<sup><sup>[↩ Parent](#benchmarkspecsutindex)</sup></sup> +### benchmark.spec.sut.resources[index].fileSystem +<sup><sup>[↩ Parent](#benchmarkspecsutresourcesindex)</sup></sup> diff --git a/theodolite-benchmarks/definitions/uc1-flink/uc1-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc1-flink/uc1-flink-benchmark-operator.yaml index 33c120371..686a98a77 100644 --- a/theodolite-benchmarks/definitions/uc1-flink/uc1-flink-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc1-flink/uc1-flink-benchmark-operator.yaml @@ -3,24 +3,25 @@ kind: benchmark metadata: name: uc1-flink spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc1-flink" - files: - - "uc1-flink/flink-configuration-configmap.yaml" - - "uc1-flink/taskmanager-deployment.yaml" - - "uc1-flink/taskmanager-service.yaml" - - "uc1-flink/service-monitor.yaml" - - "uc1-flink/jobmanager-service.yaml" - - "uc1-flink/jobmanager-deployment.yaml" - #- "uc1-flink/jobmanager-rest-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc1-flink" + files: + - "uc1-flink/flink-configuration-configmap.yaml" + - "uc1-flink/taskmanager-deployment.yaml" + - "uc1-flink/taskmanager-service.yaml" + - "uc1-flink/service-monitor.yaml" + - "uc1-flink/jobmanager-service.yaml" + - "uc1-flink/jobmanager-deployment.yaml" + #- "uc1-flink/jobmanager-rest-service.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc1-loadgen" - files: - - "uc1-kstreams/uc1-load-generator-deployment.yaml" - - "uc1-kstreams/uc1-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc1-loadgen" + files: + - "uc1-kstreams/uc1-load-generator-deployment.yaml" + - "uc1-kstreams/uc1-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-operator.yaml index 8dade1e1d..0fb630107 100644 --- a/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-operator.yaml @@ -3,21 +3,22 @@ kind: benchmark metadata: name: uc1-kstreams spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc1-kstreams" - files: - - "uc1-kstreams/uc1-kstreams-deployment.yaml" - - "uc1-kstreams/uc1-kstreams-service.yaml" - - "uc1-kstreams/uc1-jmx-configmap.yaml" - - "uc1-kstreams/uc1-service-monitor.yaml" + resources: + - configMap: + name: "benchmark-resources-uc1-kstreams" + files: + - "uc1-kstreams/uc1-kstreams-deployment.yaml" + - "uc1-kstreams/uc1-kstreams-service.yaml" + - "uc1-kstreams/uc1-jmx-configmap.yaml" + - "uc1-kstreams/uc1-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc1-loadgen" - files: - - "uc1-kstreams/uc1-load-generator-deployment.yaml" - - "uc1-kstreams/uc1-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc1-loadgen" + files: + - "uc1-kstreams/uc1-load-generator-deployment.yaml" + - "uc1-kstreams/uc1-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-standalone.yaml b/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-standalone.yaml index 0b04e69f6..d0ef1bbc8 100644 --- a/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-standalone.yaml +++ b/theodolite-benchmarks/definitions/uc1-kstreams/uc1-benchmark-standalone.yaml @@ -1,19 +1,20 @@ name: "uc1-kstreams" -infrastructure: [] -appResourceSet: - - configMap: - name: "benchmark-resources-uc1-kstreams" - files: - - "uc1-kstreams/uc1-kstreams-deployment.yaml" - - "uc1-kstreams/uc1-kstreams-service.yaml" - - "uc1-kstreams/uc1-jmx-configmap.yaml" - - "uc1-kstreams/uc1-service-monitor.yaml" -loadGenResourceSet: - - configMap: - name: "benchmark-resources-uc1-loadgen" - files: - - "uc1-kstreams/uc1-load-generator-deployment.yaml" - - "uc1-kstreams/uc1-load-generator-service.yaml" +sut: + resources: + - configMap: + name: "benchmark-resources-uc1-kstreams" + files: + - "uc1-kstreams/uc1-kstreams-deployment.yaml" + - "uc1-kstreams/uc1-kstreams-service.yaml" + - "uc1-kstreams/uc1-jmx-configmap.yaml" + - "uc1-kstreams/uc1-service-monitor.yaml" +loadGenerator: + resources: + - configMap: + name: "benchmark-resources-uc1-loadgen" + files: + - "uc1-kstreams/uc1-load-generator-deployment.yaml" + - "uc1-kstreams/uc1-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml index 699053801..c838fb098 100644 --- a/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc2-flink/uc2-flink-benchmark-operator.yaml @@ -3,24 +3,25 @@ kind: benchmark metadata: name: uc2-flink spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc2-flink" - files: - - "uc2-flink/flink-configuration-configmap.yaml" - - "uc2-flink/taskmanager-deployment.yaml" - - "uc2-flink/taskmanager-service.yaml" - - "uc2-flink/service-monitor.yaml" - - "uc2-flink/jobmanager-service.yaml" - - "uc2-flink/jobmanager-deployment.yaml" - #- "uc2-flink/jobmanager-rest-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc2-flink" + files: + - "uc2-flink/flink-configuration-configmap.yaml" + - "uc2-flink/taskmanager-deployment.yaml" + - "uc2-flink/taskmanager-service.yaml" + - "uc2-flink/service-monitor.yaml" + - "uc2-flink/jobmanager-service.yaml" + - "uc2-flink/jobmanager-deployment.yaml" + #- "uc2-flink/jobmanager-rest-service.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc2-loadgen" - files: - - "uc2-kstreams/uc2-load-generator-deployment.yaml" - - "uc2-kstreams/uc2-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc2-loadgen" + files: + - "uc2-kstreams/uc2-load-generator-deployment.yaml" + - "uc2-kstreams/uc2-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-operator.yaml index b97902c07..e94cce184 100644 --- a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-operator.yaml @@ -3,8 +3,8 @@ kind: benchmark metadata: name: uc2-kstreams spec: - infrastructure: [] sut: + resources: - configMap: name: "benchmark-resources-uc2-kstreams" files: @@ -13,11 +13,12 @@ spec: - "uc2-kstreams/uc2-jmx-configmap.yaml" - "uc2-kstreams/uc2-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc2-loadgen" - files: - - "uc2-kstreams/uc2-load-generator-deployment.yaml" - - "uc2-kstreams/uc2-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc2-loadgen" + files: + - "uc2-kstreams/uc2-load-generator-deployment.yaml" + - "uc2-kstreams/uc2-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-standalone.yaml b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-standalone.yaml index 9306b8839..f9e5e2c17 100644 --- a/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-standalone.yaml +++ b/theodolite-benchmarks/definitions/uc2-kstreams/uc2-benchmark-standalone.yaml @@ -1,19 +1,20 @@ name: "uc2-kstreams" -infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc2-kstreams" - files: - - "uc2-kstreams/uc2-kstreams-deployment.yaml" - - "uc2-kstreams/uc2-kstreams-service.yaml" - - "uc2-kstreams/uc2-jmx-configmap.yaml" - - "uc2-kstreams/uc2-service-monitor.yaml" + resources: + - configMap: + name: "benchmark-resources-uc2-kstreams" + files: + - "uc2-kstreams/uc2-kstreams-deployment.yaml" + - "uc2-kstreams/uc2-kstreams-service.yaml" + - "uc2-kstreams/uc2-jmx-configmap.yaml" + - "uc2-kstreams/uc2-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc2-loadgen" - files: - - "uc2-kstreams/uc2-load-generator-deployment.yaml" - - "uc2-kstreams/uc2-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc2-loadgen" + files: + - "uc2-kstreams/uc2-load-generator-deployment.yaml" + - "uc2-kstreams/uc2-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc3-flink/test-exec.yaml b/theodolite-benchmarks/definitions/uc3-flink/test-exec.yaml deleted file mode 100644 index 48151dc3c..000000000 --- a/theodolite-benchmarks/definitions/uc3-flink/test-exec.yaml +++ /dev/null @@ -1,56 +0,0 @@ -apiVersion: theodolite.com/v1 -kind: execution -metadata: - name: uc3-flink-template -spec: - benchmark: "uc3-flink" - load: - loadType: "NumSensors" - loadValues: [100] - resources: - resourceType: "Instances" - resourceValues: [1] - slos: - - sloType: "lag trend percent" - prometheusUrl: "http://prometheus-operated:9090" - offset: 0 - properties: - percent: 0.05 - externalSloUrl: "http://localhost:80/evaluate-slope" - warmup: 60 # in seconds - execution: - strategy: "LinearSearch" - duration: 300 # in seconds - repetitions: 1 - loadGenerationDelay: 30 # in seconds - restrictions: - - "LowerBound" - configOverrides: - - patcher: - type: "ResourceLimitPatcher" - resource: "uc3-flink/jobmanager-deployment.yaml" - properties: - container: "jobmanager" - limitedResource: "cpu" - value: "200m" - - patcher: - type: "ResourceLimitPatcher" - resource: "uc3-flink/jobmanager-deployment.yaml" - properties: - container: "jobmanager" - limitedResource: "memory" - value: "1Gi" - - patcher: - type: "ResourceLimitPatcher" - resource: "uc3-flink/taskmanager-deployment.yaml" - properties: - container: "taskmanager" - limitedResource: "cpu" - value: "200m" - - patcher: - type: "ResourceLimitPatcher" - resource: "uc3-flink/taskmanager-deployment.yaml" - properties: - container: "taskmanager" - limitedResource: "memory" - value: "1Gi" \ No newline at end of file diff --git a/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml index af126fe8b..cd6ee5b9c 100644 --- a/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc3-flink/uc3-flink-benchmark-operator.yaml @@ -3,24 +3,25 @@ kind: benchmark metadata: name: uc3-flink spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc3-flink" - files: - - "uc3-flink/flink-configuration-configmap.yaml" - - "uc3-flink/taskmanager-deployment.yaml" - - "uc3-flink/taskmanager-service.yaml" - - "uc3-flink/service-monitor.yaml" - - "uc3-flink/jobmanager-service.yaml" - - "uc3-flink/jobmanager-deployment.yaml" - #- "uc3-flink/jobmanager-rest-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc3-flink" + files: + - "uc3-flink/flink-configuration-configmap.yaml" + - "uc3-flink/taskmanager-deployment.yaml" + - "uc3-flink/taskmanager-service.yaml" + - "uc3-flink/service-monitor.yaml" + - "uc3-flink/jobmanager-service.yaml" + - "uc3-flink/jobmanager-deployment.yaml" + #- "uc3-flink/jobmanager-rest-service.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc3-loadgen" - files: - - "uc3-kstreams/uc3-load-generator-deployment.yaml" - - "uc3-kstreams/uc3-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc3-loadgen" + files: + - "uc3-kstreams/uc3-load-generator-deployment.yaml" + - "uc3-kstreams/uc3-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-operator.yaml index d51cc9a94..003ce2fae 100644 --- a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-operator.yaml @@ -3,21 +3,22 @@ kind: benchmark metadata: name: uc3-kstreams spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc3-kstreams" - files: - - "uc3-kstreams/uc3-kstreams-deployment.yaml" - - "uc3-kstreams/uc3-kstreams-service.yaml" - - "uc3-kstreams/uc3-jmx-configmap.yaml" - - "uc3-kstreams/uc3-service-monitor.yaml" + resources: + - configMap: + name: "benchmark-resources-uc3-kstreams" + files: + - "uc3-kstreams/uc3-kstreams-deployment.yaml" + - "uc3-kstreams/uc3-kstreams-service.yaml" + - "uc3-kstreams/uc3-jmx-configmap.yaml" + - "uc3-kstreams/uc3-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc3-loadgen" - files: - - "uc3-kstreams/uc3-load-generator-deployment.yaml" - - "uc3-kstreams/uc3-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc3-loadgen" + files: + - "uc3-kstreams/uc3-load-generator-deployment.yaml" + - "uc3-kstreams/uc3-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-standalone.yaml b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-standalone.yaml index 13c499d63..48f250192 100644 --- a/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-standalone.yaml +++ b/theodolite-benchmarks/definitions/uc3-kstreams/uc3-benchmark-standalone.yaml @@ -1,19 +1,20 @@ name: "uc3-kstreams" -infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc3-kstreams" - files: - - "uc3-kstreams/uc3-kstreams-deployment.yaml" - - "uc3-kstreams/uc3-kstreams-service.yaml" - - "uc3-kstreams/uc3-jmx-configmap.yaml" - - "uc3-kstreams/uc3-service-monitor.yaml" + resources: + - configMap: + name: "benchmark-resources-uc3-kstreams" + files: + - "uc3-kstreams/uc3-kstreams-deployment.yaml" + - "uc3-kstreams/uc3-kstreams-service.yaml" + - "uc3-kstreams/uc3-jmx-configmap.yaml" + - "uc3-kstreams/uc3-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc3-loadgen" - files: - - "uc3-kstreams/uc3-load-generator-deployment.yaml" - - "uc3-kstreams/uc3-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc3-loadgen" + files: + - "uc3-kstreams/uc3-load-generator-deployment.yaml" + - "uc3-kstreams/uc3-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml index dd99cfebc..74d445bee 100644 --- a/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc4-flink/uc4-flink-benchmark-operator.yaml @@ -3,24 +3,25 @@ kind: benchmark metadata: name: uc4-flink spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc4-flink" - files: - - "uc4-flink/flink-configuration-configmap.yaml" - - "uc4-flink/taskmanager-deployment.yaml" - - "uc4-flink/taskmanager-service.yaml" - - "uc4-flink/service-monitor.yaml" - - "uc4-flink/jobmanager-service.yaml" - - "uc4-flink/jobmanager-deployment.yaml" - #- "uc4-flink/jobmanager-rest-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc4-flink" + files: + - "uc4-flink/flink-configuration-configmap.yaml" + - "uc4-flink/taskmanager-deployment.yaml" + - "uc4-flink/taskmanager-service.yaml" + - "uc4-flink/service-monitor.yaml" + - "uc4-flink/jobmanager-service.yaml" + - "uc4-flink/jobmanager-deployment.yaml" + #- "uc4-flink/jobmanager-rest-service.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc4-loadgen" - files: - - "uc4-kstreams/uc4-load-generator-deployment.yaml" - - "uc4-kstreams/uc4-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc4-loadgen" + files: + - "uc4-kstreams/uc4-load-generator-deployment.yaml" + - "uc4-kstreams/uc4-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-operator.yaml b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-operator.yaml index ab3b5f95f..6f991eb5e 100644 --- a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-operator.yaml +++ b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-operator.yaml @@ -3,21 +3,22 @@ kind: benchmark metadata: name: uc4-kstreams spec: - infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc4-kstreams" - files: - - "uc4-kstreams/uc4-kstreams-deployment.yaml" - - "uc4-kstreams/uc4-kstreams-service.yaml" - - "uc4-kstreams/uc4-jmx-configmap.yaml" + resources: + - configMap: + name: "benchmark-resources-uc4-kstreams" + files: + - "uc4-kstreams/uc4-kstreams-deployment.yaml" + - "uc4-kstreams/uc4-kstreams-service.yaml" + - "uc4-kstreams/uc4-jmx-configmap.yaml" - "uc4-kstreams/uc4-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc4-loadgen" - files: - - "uc4-kstreams/uc4-load-generator-deployment.yaml" - - "uc4-kstreams/uc4-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc4-loadgen" + files: + - "uc4-kstreams/uc4-load-generator-deployment.yaml" + - "uc4-kstreams/uc4-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-standalone.yaml b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-standalone.yaml index 76ca678d0..b09cd420b 100644 --- a/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-standalone.yaml +++ b/theodolite-benchmarks/definitions/uc4-kstreams/uc4-benchmark-standalone.yaml @@ -1,19 +1,20 @@ name: "uc4-kstreams" -infrastructure: [] sut: - - configMap: - name: "benchmark-resources-uc4-kstreams" - files: - - "uc4-kstreams/uc4-kstreams-deployment.yaml" - - "uc4-kstreams/uc4-kstreams-service.yaml" - - "uc4-kstreams/uc4-jmx-configmap.yaml" - - "uc4-kstreams/uc4-service-monitor.yaml" + resources: + - configMap: + name: "benchmark-resources-uc4-kstreams" + files: + - "uc4-kstreams/uc4-kstreams-deployment.yaml" + - "uc4-kstreams/uc4-kstreams-service.yaml" + - "uc4-kstreams/uc4-jmx-configmap.yaml" + - "uc4-kstreams/uc4-service-monitor.yaml" loadGenerator: - - configMap: - name: "benchmark-resources-uc4-loadgen" - files: - - "uc4-kstreams/uc4-load-generator-deployment.yaml" - - "uc4-kstreams/uc4-load-generator-service.yaml" + resources: + - configMap: + name: "benchmark-resources-uc4-loadgen" + files: + - "uc4-kstreams/uc4-load-generator-deployment.yaml" + - "uc4-kstreams/uc4-load-generator-service.yaml" resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite/crd/crd-benchmark.yaml b/theodolite/crd/crd-benchmark.yaml index c5d08e786..befab6f98 100644 --- a/theodolite/crd/crd-benchmark.yaml +++ b/theodolite/crd/crd-benchmark.yaml @@ -20,110 +20,123 @@ spec: properties: spec: type: object - required: ["infrastructure", "sut", "loadGenerator", "resourceTypes", "loadTypes", "kafkaConfig"] + required: ["sut", "loadGenerator", "resourceTypes", "loadTypes", "kafkaConfig"] properties: name: description: This field exists only for technical reasons and should not be set by the user. The value of the field will be overwritten. type: string infrastructure: - description: A list of file names that reference Kubernetes resources that are deployed on the cluster to create the required infrastructure. - type: array - items: - type: object - oneOf: - - required: [ configMap ] - - required: [ fileSystem ] - properties: - configMap: - description: The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap. - type: object - properties: - name: - description: The name of the configMap - type: string - files: - description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. - type: array - items: - type: string - fileSystem: - description: The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. + description: (Optional) A list of file names that reference Kubernetes resources that are deployed on the cluster to create the required infrastructure. + type: object + default: {} + properties: + resources: + type: array + default: [] + items: type: object + oneOf: + - required: [ configMap ] + - required: [ fileSystem ] properties: - path: - description: The path to the folder which contains the Kubernetes manifests files. - type: string - files: - description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. - type: array - items: - type: string + configMap: + description: The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap. + type: object + properties: + name: + description: The name of the configMap + type: string + files: + description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. + type: array + items: + type: string + fileSystem: + description: The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. + type: object + properties: + path: + description: The path to the folder which contains the Kubernetes manifests files. + type: string + files: + description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. + type: array + items: + type: string sut: description: The appResourceSets specifies all Kubernetes resources required to start the sut. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet. - type: array - items: - type: object - oneOf: - - required: [ configMap ] - - required: [ fileSystem ] - properties: - configMap: - description: The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap. - type: object - properties: - name: - description: The name of the configMap - type: string - files: - description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. - type: array - items: - type: string - fileSystem: - description: The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. + type: object + properties: + resources: + type: array + default: [ ] + items: type: object + oneOf: + - required: [ configMap ] + - required: [ fileSystem ] properties: - path: - description: The path to the folder which contains the Kubernetes manifests files. - type: string - files: - description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. - type: array - items: - type: string + configMap: + description: The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap. + type: object + properties: + name: + description: The name of the configMap + type: string + files: + description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. + type: array + items: + type: string + fileSystem: + description: The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. + type: object + properties: + path: + description: The path to the folder which contains the Kubernetes manifests files. + type: string + files: + description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. + type: array + items: + type: string loadGenerator: description: The loadGenResourceSets specifies all Kubernetes resources required to start the load generator. A resourceSet can be either a configMap resourceSet or a fileSystem resourceSet. - type: array - items: - type: object - oneOf: - - required: [ configMap ] - - required: [ fileSystem ] - properties: - configMap: - description: The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap. - type: object - properties: - name: - description: The name of the configMap - type: string - files: - description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. - type: array - items: - type: string - fileSystem: - description: The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. + type: object + properties: + resources: + type: array + default: [] + items: type: object + oneOf: + - required: [ configMap ] + - required: [ fileSystem ] properties: - path: - description: The path to the folder which contains the Kubernetes manifests files. - type: string - files: - description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. - type: array - items: - type: string + configMap: + description: The configMap resourceSet loads the Kubernetes manifests from an Kubernetes configMap. + type: object + properties: + name: + description: The name of the configMap + type: string + files: + description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. + type: array + items: + type: string + fileSystem: + description: The fileSystem resourceSet loads the Kubernetes manifests from the filesystem. + type: object + properties: + path: + description: The path to the folder which contains the Kubernetes manifests files. + type: string + files: + description: (Optional) Specifies which files from the configMap should be loaded. If this field is not set, all files are loaded. + type: array + items: + type: string resourceTypes: description: A list of resource types that can be scaled for this `benchmark` resource. For each resource type the concrete values are defined in the `execution` object. type: array diff --git a/theodolite/examples/operator/example-benchmark.yaml b/theodolite/examples/operator/example-benchmark.yaml index e9c6b2f33..3452fff9c 100644 --- a/theodolite/examples/operator/example-benchmark.yaml +++ b/theodolite/examples/operator/example-benchmark.yaml @@ -3,18 +3,19 @@ kind: benchmark metadata: name: uc1-kstreams spec: - infrastructure: [] sut: - - configMap: - name: "example-configmap" - files: - - "uc1-kstreams-deployment.yaml" + resources: + - configMap: + name: "example-configmap" + files: + - "uc1-kstreams-deployment.yaml" loadGenerator: - - configMap: - name: "example-configmap" - files: - - uc1-load-generator-service.yaml - - uc1-load-generator-deployment.yaml + resources: + - configMap: + name: "example-configmap" + files: + - uc1-load-generator-service.yaml + - uc1-load-generator-deployment.yaml resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite/examples/resources/test-service.yaml b/theodolite/examples/resources/test-service.yaml deleted file mode 100644 index 2b502810b..000000000 --- a/theodolite/examples/resources/test-service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: test-service - labels: - app: test-service -spec: - type: ClusterIP - clusterIP: None - selector: - app: test - ports: - - name: coordination - port: 5701 - targetPort: 5701 - protocol: TCP diff --git a/theodolite/examples/standalone/example-benchmark.yaml b/theodolite/examples/standalone/example-benchmark.yaml index e9ec8fc15..0d5df81b1 100644 --- a/theodolite/examples/standalone/example-benchmark.yaml +++ b/theodolite/examples/standalone/example-benchmark.yaml @@ -1,16 +1,18 @@ name: "uc1-kstreams" infrastructure: [] sut: - - configMap: - name: "example-configmap" - files: - - "uc1-kstreams-deployment.yaml" + resources: + - configMap: + name: "example-configmap" + files: + - "uc1-kstreams-deployment.yaml" loadGenerator: - - configMap: - name: "example-configmap" - files: - - uc1-load-generator-service.yaml - - uc1-load-generator-deployment.yaml + resources: + - configMap: + name: "example-configmap" + files: + - uc1-load-generator-service.yaml + - uc1-load-generator-deployment.yaml resourceTypes: - typeName: "Instances" patchers: diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index b6eb1d149..5b6f956ec 100644 --- a/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -40,9 +40,9 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { lateinit var resourceTypes: List<TypeName> lateinit var loadTypes: List<TypeName> lateinit var kafkaConfig: KafkaConfig - lateinit var infrastructure: List<ResourceSets> - lateinit var sut: List<ResourceSets> - lateinit var loadGenerator: List<ResourceSets> + lateinit var infrastructure: Resources + lateinit var sut: Resources + lateinit var loadGenerator: Resources var namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE @Transient @@ -59,14 +59,14 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { override fun setupInfrastructure() { val kubernetesManager = K8sManager(this.client) - loadKubernetesResources(this.infrastructure) + loadKubernetesResources(this.infrastructure.resources) .map{it.second} .forEach { kubernetesManager.deploy(it) } } override fun teardownInfrastructure() { val kubernetesManager = K8sManager(this.client) - loadKubernetesResources(this.infrastructure) + loadKubernetesResources(this.infrastructure.resources) .map{it.second} .forEach { kubernetesManager.remove(it) } } @@ -89,8 +89,8 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { ): BenchmarkDeployment { logger.info { "Using $namespace as namespace." } - val appResources = loadKubernetesResources(this.sut) - val loadGenResources = loadKubernetesResources(this.loadGenerator) + val appResources = loadKubernetesResources(this.sut.resources) + val loadGenResources = loadKubernetesResources(this.loadGenerator.resources) val patcherFactory = PatcherFactory() diff --git a/theodolite/src/main/kotlin/theodolite/benchmark/Resources.kt b/theodolite/src/main/kotlin/theodolite/benchmark/Resources.kt new file mode 100644 index 000000000..0187735b8 --- /dev/null +++ b/theodolite/src/main/kotlin/theodolite/benchmark/Resources.kt @@ -0,0 +1,13 @@ +package theodolite.benchmark + +import com.fasterxml.jackson.databind.annotation.JsonDeserialize +import com.fasterxml.jackson.databind.annotation.JsonSerialize +import io.quarkus.runtime.annotations.RegisterForReflection + +@JsonDeserialize +@RegisterForReflection +class Resources { + + lateinit var resources: List<ResourceSets> + +} \ No newline at end of file diff --git a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt index 4f5430eb6..14d131609 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/operator/TheodoliteController.kt @@ -68,8 +68,8 @@ class TheodoliteController( try { val modifier = ConfigOverrideModifier( execution = execution, - resources = benchmark.loadKubernetesResources(benchmark.sut).map { it.first } - + benchmark.loadKubernetesResources(benchmark.loadGenerator).map { it.first } + resources = benchmark.loadKubernetesResources(benchmark.sut.resources).map { it.first } + + benchmark.loadKubernetesResources(benchmark.loadGenerator.resources).map { it.first } ) modifier.setAdditionalLabels( labelValue = execution.name, diff --git a/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt b/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt index a5955e83b..e294ea539 100644 --- a/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt +++ b/theodolite/src/test/kotlin/theodolite/execution/operator/BenchmarkCRDummy.kt @@ -1,6 +1,7 @@ package theodolite.execution.operator import theodolite.benchmark.KubernetesBenchmark +import theodolite.benchmark.Resources import theodolite.model.crd.BenchmarkCRD import theodolite.util.KafkaConfig @@ -24,9 +25,14 @@ class BenchmarkCRDummy(name: String) { benchmarkCR.kind = "Benchmark" benchmarkCR.apiVersion = "v1" - benchmark.infrastructure = emptyList() - benchmark.sut = emptyList() - benchmark.loadGenerator = emptyList() + + benchmark.infrastructure = Resources() + benchmark.sut = Resources() + benchmark.loadGenerator = Resources() + + benchmark.infrastructure.resources = emptyList() + benchmark.sut.resources = emptyList() + benchmark.loadGenerator.resources = emptyList() benchmark.resourceTypes = emptyList() benchmark.loadTypes = emptyList() diff --git a/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml b/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml index 8cd4be5fa..e690aa56d 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-benchmark.yaml @@ -3,7 +3,6 @@ kind: benchmark metadata: name: example-benchmark spec: - infrastructure: [] appResource: - "uc1-kstreams-deployment.yaml" - "aggregation-service.yaml" -- GitLab