diff --git a/theodolite/crd/crd-execution.yaml b/theodolite/crd/crd-execution.yaml index fd618e0189a47b3829792d355febe00a2ce36bad..89f4c99a86cb5d349ba865440116e0c75b49bfcc 100644 --- a/theodolite/crd/crd-execution.yaml +++ b/theodolite/crd/crd-execution.yaml @@ -20,7 +20,7 @@ spec: properties: spec: type: object - required: ["benchmark", "loads", "resources", "execution", "configOverrides"] + required: ["benchmark", "load", "resources", "execution"] 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. @@ -29,7 +29,7 @@ spec: benchmark: description: The name of the benchmark this execution is referring to. type: string - loads: # definition of the load dimension + load: # definition of the load dimension description: Specifies the load values that are benchmarked. type: object required: ["loadType", "loadValues"] @@ -130,6 +130,7 @@ spec: default: {} value: type: string + default: [] status: type: object properties: diff --git a/theodolite/examples/operator/example-execution.yaml b/theodolite/examples/operator/example-execution.yaml index 1d889398e1d018ed9b496ad568f79fd8e38aed44..d0c47eaa4bc9e1f600d37021b46a3caaec478f91 100644 --- a/theodolite/examples/operator/example-execution.yaml +++ b/theodolite/examples/operator/example-execution.yaml @@ -4,7 +4,7 @@ metadata: name: theodolite-example-execution spec: benchmark: "example-benchmark" - loads: + load: loadType: "NumSensors" loadValues: [25000, 50000, 75000, 100000, 125000, 150000] resources: diff --git a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/TheodoliteExecutor.kt b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/TheodoliteExecutor.kt index 69615522ba9bbd5ef0944528eacbf1dce318caf9..9df19388015d336018766fd5e8ae182c655be936 100644 --- a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/TheodoliteExecutor.kt +++ b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/TheodoliteExecutor.kt @@ -58,7 +58,7 @@ class TheodoliteExecutor( val loadDimensionPatcherDefinition = PatcherDefinitionFactory().createPatcherDefinition( - benchmarkExecution.loads.loadType, + benchmarkExecution.load.loadType, this.benchmark.loadTypes ) @@ -81,11 +81,11 @@ class TheodoliteExecutor( waitForResourcesEnabled = this.benchmark.waitForResourcesEnabled ) - if (benchmarkExecution.loads.loadValues != benchmarkExecution.loads.loadValues.sorted()) { - benchmarkExecution.loads.loadValues = benchmarkExecution.loads.loadValues.sorted() + if (benchmarkExecution.load.loadValues != benchmarkExecution.load.loadValues.sorted()) { + benchmarkExecution.load.loadValues = benchmarkExecution.load.loadValues.sorted() logger.info { "Load values are not sorted correctly, Theodolite sorts them in ascending order." + - "New order is: ${benchmarkExecution.loads.loadValues}" + "New order is: ${benchmarkExecution.load.loadValues}" } } @@ -98,7 +98,7 @@ class TheodoliteExecutor( } return Config( - loads = benchmarkExecution.loads.loadValues, + loads = benchmarkExecution.load.loadValues, resources = benchmarkExecution.resources.resourceValues, searchStrategy = strategyFactory.createSearchStrategy(experimentRunner, benchmarkExecution.execution.strategy.name, benchmarkExecution.execution.strategy.searchStrategy, benchmarkExecution.execution.strategy.restrictions, diff --git a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/model/BenchmarkExecution.kt b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/model/BenchmarkExecution.kt index 167423ec911cd740b0ee0246e8512dde8402f1e9..9c02b7e2743012776db9c117804cab054a274321 100644 --- a/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/model/BenchmarkExecution.kt +++ b/theodolite/src/main/kotlin/rocks/theodolite/kubernetes/model/BenchmarkExecution.kt @@ -12,7 +12,7 @@ import kotlin.properties.Delegates * A BenchmarkExecution consists of: * - A [name]. * - The [benchmark] that should be executed. - * - The [loads]s that should be checked in the benchmark. + * - The [load]s that should be checked in the benchmark. * - The [resources] that should be checked in the benchmark. * - The [slos] further restrict the Benchmark SLOs for the evaluation of the experiments. * - An [execution] that encapsulates: the strategy, the duration, and the restrictions @@ -28,7 +28,7 @@ class BenchmarkExecution : KubernetesResource { var executionId: Int = 0 lateinit var name: String lateinit var benchmark: String - lateinit var loads: LoadDefinition + lateinit var load: LoadDefinition lateinit var resources: ResourceDefinition lateinit var slos: List<SloConfiguration> lateinit var execution: Execution diff --git a/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/CRDExecutionTest.kt b/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/CRDExecutionTest.kt index a7de76acfe7aac9b92628e87b9911599a13ab438..4b9176693fcb9183796af1c30094088bacbd2c44 100644 --- a/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/CRDExecutionTest.kt +++ b/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/CRDExecutionTest.kt @@ -69,8 +69,8 @@ internal class CRDExecutionTest { assertEquals("uc1-kstreams", execution.benchmark) assertEquals(mutableListOf<ConfigurationOverride?>(), execution.configOverrides) - assertEquals("NumSensors", execution.loads.loadType) - assertEquals(listOf(25000, 50000, 75000, 100000, 125000, 150000),execution.loads.loadValues) + assertEquals("NumSensors", execution.load.loadType) + assertEquals(listOf(25000, 50000, 75000, 100000, 125000, 150000), execution.load.loadValues) assertEquals("Instances", execution.resources.resourceType) assertEquals(listOf(1, 2, 3, 4, 5), execution.resources.resourceValues) diff --git a/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/ExecutionCRDummy.kt b/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/ExecutionCRDummy.kt index 871471ee941f5cf2d254fb2bd70556f161d8d4de..8181404a51b68afbf04a8bd83346053d6550e192 100644 --- a/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/ExecutionCRDummy.kt +++ b/theodolite/src/test/kotlin/rocks/theodolite/kubernetes/model/crd/ExecutionCRDummy.kt @@ -33,12 +33,12 @@ class ExecutionCRDummy(name: String, benchmark: String) { resourceDef.resourceType = "" resourceDef.resourceValues = emptyList() - val strat = BenchmarkExecution.Strategy() - strat.name = "" - strat.restrictions = emptyList() - strat.guessStrategy = "" - strat.searchStrategy = "" - + val strategy = BenchmarkExecution.Strategy().apply { + this.name = "" + this.restrictions = emptyList() + this.guessStrategy = "" + this.searchStrategy = "" + } val exec = BenchmarkExecution.Execution() exec.afterTeardownDelay = 0 @@ -46,11 +46,11 @@ class ExecutionCRDummy(name: String, benchmark: String) { exec.loadGenerationDelay = 0 exec.repetitions = 1 exec.metric = "" - exec.strategy = strat + exec.strategy = strategy execution.benchmark = benchmark - execution.loads = loadType + execution.load = loadType execution.resources = resourceDef execution.slos = emptyList() execution.execution = exec diff --git a/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml b/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml index b758e9b9b1e39a9722ad9c0d6513f36b9a4961da..49fdd14fddf3ddc89100d5165e737d4b0aae0257 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-execution-1.yaml @@ -5,7 +5,7 @@ metadata: spec: name: test benchmark: "uc1-kstreams" - loads: + load: loadType: "NumSensors" loadValues: [25000, 50000, 75000, 100000, 125000, 150000] resources: @@ -13,11 +13,8 @@ spec: resourceValues: [1, 2, 3, 4, 5] slos: - name: "lag trend" - threshold: 2000 - prometheusUrl: "http://prometheus-operated:9090" - externalSloUrl: "http://localhost:80/evaluate-slope" - offset: 0 - warmup: 60 # in seconds + properties: + threshold: 2000 execution: strategy: name: "RestrictionSearch" diff --git a/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml b/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml index ccfd0160fc407863544e5b735e595b86a2669eea..2f58db5b45d139131204937d68fee4e141ad1883 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-execution-update.yaml @@ -5,7 +5,7 @@ metadata: spec: name: test benchmark: "uc1-kstreams-update" - loads: + load: loadType: "NumSensors" loadValues: [25000, 50000, 75000, 100000, 125000, 150000] resources: diff --git a/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml b/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml index 78c01c9e8e241c92a897dc00d024d92ecd9e82d6..8d274275ac6617ff6b2e3b0c448487e7a845e42b 100644 --- a/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml +++ b/theodolite/src/test/resources/k8s-resource-files/test-execution.yaml @@ -5,7 +5,7 @@ metadata: spec: name: test benchmark: "uc1-kstreams" - loads: + load: loadType: "NumSensors" loadValues: [25000, 50000, 75000, 100000, 125000, 150000] resources: