From 7e3847a3b0638fd36c3df5c2cc7f56736708d0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Henning?= <soeren.henning@email.uni-kiel.de> Date: Fri, 15 Jul 2022 18:28:39 +0200 Subject: [PATCH] Revert `loads` to `load` --- theodolite/crd/crd-execution.yaml | 5 +++-- .../examples/operator/example-execution.yaml | 2 +- .../theodolite/kubernetes/TheodoliteExecutor.kt | 10 +++++----- .../kubernetes/model/BenchmarkExecution.kt | 4 ++-- .../kubernetes/model/crd/CRDExecutionTest.kt | 4 ++-- .../kubernetes/model/crd/ExecutionCRDummy.kt | 16 ++++++++-------- .../k8s-resource-files/test-execution-1.yaml | 9 +++------ .../test-execution-update.yaml | 2 +- .../k8s-resource-files/test-execution.yaml | 2 +- 9 files changed, 26 insertions(+), 28 deletions(-) diff --git a/theodolite/crd/crd-execution.yaml b/theodolite/crd/crd-execution.yaml index fd618e018..89f4c99a8 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 1d889398e..d0c47eaa4 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 69615522b..9df193880 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 167423ec9..9c02b7e27 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 a7de76acf..4b9176693 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 871471ee9..8181404a5 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 b758e9b9b..49fdd14fd 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 ccfd0160f..2f58db5b4 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 78c01c9e8..8d274275a 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: -- GitLab