Skip to content
Snippets Groups Projects
Commit 67aca149 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

intrdocde infrastructure field in the benchmark crd

parent be45d0f5
No related branches found
No related tags found
1 merge request!197Add support for long-running infrastructure components
Showing
with 435 additions and 397 deletions
# API Reference
Packages:
- [theodolite.com/v1](#theodolitecomv1)
# theodolite.com/v1
Resource Types:
- [benchmark](#benchmark)
## benchmark
<sup><sup>[↩ Parent](#theodolitecomv1 )</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>apiVersion</b></td>
<td>string</td>
<td>theodolite.com/v1</td>
<td>true</td>
</tr>
<tr>
<td><b>kind</b></td>
<td>string</td>
<td>benchmark</td>
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspec">spec</a></b></td>
<td>object</td>
<td>
<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec
<sup><sup>[↩ Parent](#benchmark)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>name</b></td>
<td>string</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/>
</td>
<td>false</td>
</tr><tr>
<td><b>appResource</b></td>
<td>[]string</td>
<td>
A list of file names that reference Kubernetes resources that are deployed on the cluster for the system under test (SUT).<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspeckafkaconfig">kafkaConfig</a></b></td>
<td>object</td>
<td>
Contains the Kafka configuration.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>loadGenResource</b></td>
<td>[]string</td>
<td>
A list of file names that reference Kubernetes resources that are deployed on the cluster for the load generator.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspecloadtypesindex">loadTypes</a></b></td>
<td>[]object</td>
<td>
A list of load types that can be scaled for this benchmark. For each load type the concrete values are defined in the execution object.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspecresourcetypesindex">resourceTypes</a></b></td>
<td>[]object</td>
<td>
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.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.kafkaConfig
<sup><sup>[↩ Parent](#benchmarkspec)</sup></sup>
Contains the Kafka configuration.
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>bootstrapServer</b></td>
<td>string</td>
<td>
The bootstrap servers connection string.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspeckafkaconfigtopicsindex">topics</a></b></td>
<td>[]object</td>
<td>
List of topics to be created for each experiment. Alternative theodolite offers the possibility to remove certain topics after each experiment.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.kafkaConfig.topics[index]
<sup><sup>[↩ Parent](#benchmarkspeckafkaconfig)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>removeOnly</b></td>
<td>boolean</td>
<td>
Determines if this topic should only be deleted after each experiement. For removeOnly topics the name can be a RegEx describing the topic.<br/>
<br/>
<i>Default</i>: false<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>name</b></td>
<td>string</td>
<td>
The name of the topic.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr><tr>
<td><b>numPartitions</b></td>
<td>integer</td>
<td>
The number of partitions of the topic.<br/>
<br/>
<i>Default</i>: 0<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>replicationFactor</b></td>
<td>integer</td>
<td>
The replication factor of the topic.<br/>
<br/>
<i>Default</i>: 0<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.loadTypes[index]
<sup><sup>[↩ Parent](#benchmarkspec)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b><a href="#benchmarkspecloadtypesindexpatchersindex">patchers</a></b></td>
<td>[]object</td>
<td>
List of patchers used to scale this resource type.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>typeName</b></td>
<td>string</td>
<td>
Name of the load type.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.loadTypes[index].patchers[index]
<sup><sup>[↩ Parent](#benchmarkspecloadtypesindex)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>properties</b></td>
<td>object</td>
<td>
(Optional) Patcher specific additional arguments.<br/>
<br/>
<i>Default</i>: map[]<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>resource</b></td>
<td>string</td>
<td>
Specifies the Kubernetes resource to be patched.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr><tr>
<td><b>type</b></td>
<td>string</td>
<td>
Type of the Patcher.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.resourceTypes[index]
<sup><sup>[↩ Parent](#benchmarkspec)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b><a href="#benchmarkspecresourcetypesindexpatchersindex">patchers</a></b></td>
<td>[]object</td>
<td>
List of patchers used to scale this resource type.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>typeName</b></td>
<td>string</td>
<td>
Name of the resource type.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.resourceTypes[index].patchers[index]
<sup><sup>[↩ Parent](#benchmarkspecresourcetypesindex)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>properties</b></td>
<td>object</td>
<td>
(Optional) Patcher specific additional arguments.<br/>
<br/>
<i>Default</i>: map[]<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>resource</b></td>
<td>string</td>
<td>
Specifies the Kubernetes resource to be patched.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr><tr>
<td><b>type</b></td>
<td>string</td>
<td>
Type of the patcher.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr></tbody>
</table>
\ No newline at end of file
...@@ -8,11 +8,380 @@ Packages: ...@@ -8,11 +8,380 @@ Packages:
Resource Types: Resource Types:
- [benchmark](#benchmark)
- [execution](#execution) - [execution](#execution)
## benchmark
<sup><sup>[↩ Parent](#theodolitecomv1 )</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>apiVersion</b></td>
<td>string</td>
<td>theodolite.com/v1</td>
<td>true</td>
</tr>
<tr>
<td><b>kind</b></td>
<td>string</td>
<td>benchmark</td>
<td>true</td>
</tr>
<tr>
<td><b><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#objectmeta-v1-meta">metadata</a></b></td>
<td>object</td>
<td>Refer to the Kubernetes API documentation for the fields of the `metadata` field.</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspec">spec</a></b></td>
<td>object</td>
<td>
<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec
<sup><sup>[↩ Parent](#benchmark)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>infrastructure</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/>
</td>
<td>false</td>
</tr><tr>
<td><b>name</b></td>
<td>string</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/>
</td>
<td>false</td>
</tr><tr>
<td><b>appResource</b></td>
<td>[]string</td>
<td>
A list of file names that reference Kubernetes resources that are deployed on the cluster for the system under test (SUT).<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspeckafkaconfig">kafkaConfig</a></b></td>
<td>object</td>
<td>
Contains the Kafka configuration.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>loadGenResource</b></td>
<td>[]string</td>
<td>
A list of file names that reference Kubernetes resources that are deployed on the cluster for the load generator.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspecloadtypesindex">loadTypes</a></b></td>
<td>[]object</td>
<td>
A list of load types that can be scaled for this benchmark. For each load type the concrete values are defined in the execution object.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspecresourcetypesindex">resourceTypes</a></b></td>
<td>[]object</td>
<td>
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.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.kafkaConfig
<sup><sup>[↩ Parent](#benchmarkspec)</sup></sup>
Contains the Kafka configuration.
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>bootstrapServer</b></td>
<td>string</td>
<td>
The bootstrap servers connection string.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b><a href="#benchmarkspeckafkaconfigtopicsindex">topics</a></b></td>
<td>[]object</td>
<td>
List of topics to be created for each experiment. Alternative theodolite offers the possibility to remove certain topics after each experiment.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.kafkaConfig.topics[index]
<sup><sup>[↩ Parent](#benchmarkspeckafkaconfig)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>numPartitions</b></td>
<td>integer</td>
<td>
The number of partitions of the topic.<br/>
<br/>
<i>Default</i>: 0<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>removeOnly</b></td>
<td>boolean</td>
<td>
Determines if this topic should only be deleted after each experiement. For removeOnly topics the name can be a RegEx describing the topic.<br/>
<br/>
<i>Default</i>: false<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>replicationFactor</b></td>
<td>integer</td>
<td>
The replication factor of the topic.<br/>
<br/>
<i>Default</i>: 0<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>name</b></td>
<td>string</td>
<td>
The name of the topic.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.loadTypes[index]
<sup><sup>[↩ Parent](#benchmarkspec)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b><a href="#benchmarkspecloadtypesindexpatchersindex">patchers</a></b></td>
<td>[]object</td>
<td>
List of patchers used to scale this resource type.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>typeName</b></td>
<td>string</td>
<td>
Name of the load type.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.loadTypes[index].patchers[index]
<sup><sup>[↩ Parent](#benchmarkspecloadtypesindex)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>properties</b></td>
<td>map[string]string</td>
<td>
(Optional) Patcher specific additional arguments.<br/>
<br/>
<i>Default</i>: map[]<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>resource</b></td>
<td>string</td>
<td>
Specifies the Kubernetes resource to be patched.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr><tr>
<td><b>type</b></td>
<td>string</td>
<td>
Type of the Patcher.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.resourceTypes[index]
<sup><sup>[↩ Parent](#benchmarkspec)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b><a href="#benchmarkspecresourcetypesindexpatchersindex">patchers</a></b></td>
<td>[]object</td>
<td>
List of patchers used to scale this resource type.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>typeName</b></td>
<td>string</td>
<td>
Name of the resource type.<br/>
</td>
<td>true</td>
</tr></tbody>
</table>
### benchmark.spec.resourceTypes[index].patchers[index]
<sup><sup>[↩ Parent](#benchmarkspecresourcetypesindex)</sup></sup>
<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
</tr>
</thead>
<tbody><tr>
<td><b>properties</b></td>
<td>map[string]string</td>
<td>
(Optional) Patcher specific additional arguments.<br/>
<br/>
<i>Default</i>: map[]<br/>
</td>
<td>false</td>
</tr><tr>
<td><b>resource</b></td>
<td>string</td>
<td>
Specifies the Kubernetes resource to be patched.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr><tr>
<td><b>type</b></td>
<td>string</td>
<td>
Type of the patcher.<br/>
<br/>
<i>Default</i>: <br/>
</td>
<td>true</td>
</tr></tbody>
</table>
## execution ## execution
<sup><sup>[↩ Parent](#theodolitecomv1 )</sup></sup> <sup><sup>[↩ Parent](#theodolitecomv1 )</sup></sup>
...@@ -224,7 +593,7 @@ Patcher used to patch a resource ...@@ -224,7 +593,7 @@ Patcher used to patch a resource
</thead> </thead>
<tbody><tr> <tbody><tr>
<td><b>properties</b></td> <td><b>properties</b></td>
<td>object</td> <td>map[string]string</td>
<td> <td>
(Optional) Patcher specific additional arguments.<br/> (Optional) Patcher specific additional arguments.<br/>
<br/> <br/>
...@@ -369,7 +738,7 @@ Specifies the scaling resource that is benchmarked. ...@@ -369,7 +738,7 @@ Specifies the scaling resource that is benchmarked.
<td><b>resourceValues</b></td> <td><b>resourceValues</b></td>
<td>[]integer</td> <td>[]integer</td>
<td> <td>
<br/> List of resource values for the specified resource type.<br/>
</td> </td>
<td>true</td> <td>true</td>
</tr></tbody> </tr></tbody>
...@@ -393,12 +762,14 @@ Specifies the scaling resource that is benchmarked. ...@@ -393,12 +762,14 @@ Specifies the scaling resource that is benchmarked.
</tr> </tr>
</thead> </thead>
<tbody><tr> <tbody><tr>
<td><b>externalSloUrl</b></td> <td><b>properties</b></td>
<td>string</td> <td>map[string]string</td>
<td> <td>
Connection string for a external slo analysis.<br/> (Optional) SLO specific additional arguments.<br/>
<br/>
<i>Default</i>: map[]<br/>
</td> </td>
<td>true</td> <td>false</td>
</tr><tr> </tr><tr>
<td><b>offset</b></td> <td><b>offset</b></td>
<td>integer</td> <td>integer</td>
...@@ -420,19 +791,5 @@ Specifies the scaling resource that is benchmarked. ...@@ -420,19 +791,5 @@ Specifies the scaling resource that is benchmarked.
The type of the SLO. It must match 'lag trend'.<br/> The type of the SLO. It must match 'lag trend'.<br/>
</td> </td>
<td>true</td> <td>true</td>
</tr><tr>
<td><b>threshold</b></td>
<td>integer</td>
<td>
The threshold the SUT should meet for a sucessful experiment.<br/>
</td>
<td>true</td>
</tr><tr>
<td><b>warmup</b></td>
<td>integer</td>
<td>
Seconds of time that are ignored in the analysis.<br/>
</td>
<td>true</td>
</tr></tbody> </tr></tbody>
</table> </table>
\ No newline at end of file
...@@ -25,6 +25,12 @@ spec: ...@@ -25,6 +25,12 @@ spec:
name: 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. 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 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
minItems: 1
items:
type: string
appResource: appResource:
description: A list of file names that reference Kubernetes resources that are deployed on the cluster for the system under test (SUT). description: A list of file names that reference Kubernetes resources that are deployed on the cluster for the system under test (SUT).
type: array type: array
......
...@@ -3,6 +3,7 @@ kind: benchmark ...@@ -3,6 +3,7 @@ kind: benchmark
metadata: metadata:
name: uc1-kstreams name: uc1-kstreams
spec: spec:
infrastructure: []
appResource: appResource:
- "uc1-kstreams-deployment.yaml" - "uc1-kstreams-deployment.yaml"
loadGenResource: loadGenResource:
......
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
...@@ -14,6 +14,9 @@ import theodolite.util.Resource ...@@ -14,6 +14,9 @@ import theodolite.util.Resource
@RegisterForReflection @RegisterForReflection
interface Benchmark { interface Benchmark {
fun setupInfrastructure()
fun teardownInfrastructure()
/** /**
* Builds a Deployment that can be deployed. * Builds a Deployment that can be deployed.
* @return a BenchmarkDeployment. * @return a BenchmarkDeployment.
......
...@@ -7,8 +7,7 @@ package theodolite.benchmark ...@@ -7,8 +7,7 @@ package theodolite.benchmark
interface BenchmarkDeployment { interface BenchmarkDeployment {
/** /**
* Setup a benchmark. This method is responsible for deploying the resources * Setup a benchmark. This method is responsible for deploying the resources of a benchmark.
* and organize the needed infrastructure.
*/ */
fun setup() fun setup()
......
...@@ -3,8 +3,10 @@ package theodolite.benchmark ...@@ -3,8 +3,10 @@ package theodolite.benchmark
import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import io.fabric8.kubernetes.api.model.KubernetesResource import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import io.quarkus.runtime.annotations.RegisterForReflection import io.quarkus.runtime.annotations.RegisterForReflection
import mu.KotlinLogging import mu.KotlinLogging
import theodolite.k8s.K8sManager
import theodolite.k8s.K8sResourceLoader import theodolite.k8s.K8sResourceLoader
import theodolite.patcher.PatcherFactory import theodolite.patcher.PatcherFactory
import theodolite.util.* import theodolite.util.*
...@@ -36,11 +38,14 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { ...@@ -36,11 +38,14 @@ class KubernetesBenchmark : KubernetesResource, Benchmark {
lateinit var name: String lateinit var name: String
lateinit var appResource: List<String> lateinit var appResource: List<String>
lateinit var loadGenResource: List<String> lateinit var loadGenResource: List<String>
lateinit var infrastructure: List<String>
lateinit var resourceTypes: List<TypeName> lateinit var resourceTypes: List<TypeName>
lateinit var loadTypes: List<TypeName> lateinit var loadTypes: List<TypeName>
lateinit var kafkaConfig: KafkaConfig lateinit var kafkaConfig: KafkaConfig
var namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE var namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE
@Transient
private val client: NamespacedKubernetesClient = DefaultKubernetesClient().inNamespace(namespace)
/** /**
* Loads [KubernetesResource]s. * Loads [KubernetesResource]s.
...@@ -62,6 +67,20 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { ...@@ -62,6 +67,20 @@ class KubernetesBenchmark : KubernetesResource, Benchmark {
} }
} }
override fun setupInfrastructure() {
val kubernetesManager = K8sManager(this.client)
loadKubernetesResources(this.infrastructure)
.map{it.second}
.forEach { kubernetesManager.deploy(it) }
}
override fun teardownInfrastructure() {
val kubernetesManager = K8sManager(this.client)
loadKubernetesResources(this.infrastructure)
.map{it.second}
.forEach { kubernetesManager.remove(it) }
}
/** /**
* Builds a deployment. * Builds a deployment.
* First loads all required resources and then patches them to the concrete load and resources for the experiment. * First loads all required resources and then patches them to the concrete load and resources for the experiment.
...@@ -106,7 +125,7 @@ class KubernetesBenchmark : KubernetesResource, Benchmark { ...@@ -106,7 +125,7 @@ class KubernetesBenchmark : KubernetesResource, Benchmark {
afterTeardownDelay = afterTeardownDelay, afterTeardownDelay = afterTeardownDelay,
kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer), kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapServer),
topics = kafkaConfig.topics, topics = kafkaConfig.topics,
client = DefaultKubernetesClient().inNamespace(namespace) client = this.client
) )
} }
} }
...@@ -113,6 +113,8 @@ class TheodoliteExecutor( ...@@ -113,6 +113,8 @@ class TheodoliteExecutor(
* execution and benchmark objects. * execution and benchmark objects.
*/ */
fun run() { fun run() {
kubernetesBenchmark.setupInfrastructure()
val ioHandler = IOHandler() val ioHandler = IOHandler()
val resultsFolder = ioHandler.getResultFolderURL() val resultsFolder = ioHandler.getResultFolderURL()
this.config.executionId = getAndIncrementExecutionID(resultsFolder + "expID.txt") this.config.executionId = getAndIncrementExecutionID(resultsFolder + "expID.txt")
...@@ -136,6 +138,7 @@ class TheodoliteExecutor( ...@@ -136,6 +138,7 @@ class TheodoliteExecutor(
"${resultsFolder}exp${this.config.executionId}-result" "${resultsFolder}exp${this.config.executionId}-result"
) )
} }
kubernetesBenchmark.teardownInfrastructure()
} }
private fun getAndIncrementExecutionID(fileURL: String): Int { private fun getAndIncrementExecutionID(fileURL: String): Int {
......
...@@ -8,6 +8,12 @@ import theodolite.util.Resource ...@@ -8,6 +8,12 @@ import theodolite.util.Resource
class TestBenchmark : Benchmark { class TestBenchmark : Benchmark {
override fun setupInfrastructure() {
}
override fun teardownInfrastructure() {
}
override fun buildDeployment( override fun buildDeployment(
load: LoadDimension, load: LoadDimension,
res: Resource, res: Resource,
......
...@@ -24,6 +24,7 @@ class BenchmarkCRDummy(name: String) { ...@@ -24,6 +24,7 @@ class BenchmarkCRDummy(name: String) {
benchmarkCR.kind = "Benchmark" benchmarkCR.kind = "Benchmark"
benchmarkCR.apiVersion = "v1" benchmarkCR.apiVersion = "v1"
benchmark.infrastructure = emptyList()
benchmark.appResource = emptyList() benchmark.appResource = emptyList()
benchmark.loadGenResource = emptyList() benchmark.loadGenResource = emptyList()
benchmark.resourceTypes = emptyList() benchmark.resourceTypes = emptyList()
......
...@@ -3,6 +3,7 @@ kind: benchmark ...@@ -3,6 +3,7 @@ kind: benchmark
metadata: metadata:
name: example-benchmark name: example-benchmark
spec: spec:
infrastructure: []
appResource: appResource:
- "uc1-kstreams-deployment.yaml" - "uc1-kstreams-deployment.yaml"
- "aggregation-service.yaml" - "aggregation-service.yaml"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment