diff --git a/helm/README.md b/helm/README.md index 40651d605a020c74fc75650c4709ca5a2dd41a50..078c9c9a2b3f896d5cf5a30e7c2540a36f8057e4 100644 --- a/helm/README.md +++ b/helm/README.md @@ -44,7 +44,7 @@ helm install theodolite . -f preconfigs/one-broker-values.yaml ## Uninstall this Chart -To uninstall/delete the `theodolite` deployment: +To uninstall/delete the `theodolite` deployment (by default Helm will be install all CRDs (`execution` and `benchmark`) automatically. If Helm should not install these CRDs, use the flag `--skip-crds`) ```sh helm uninstall theodolite diff --git a/helm/crds/benchmark.yaml b/helm/crds/benchmark.yaml new file mode 120000 index 0000000000000000000000000000000000000000..fb100de7a1407462bfb6488a54b7f70014a58474 --- /dev/null +++ b/helm/crds/benchmark.yaml @@ -0,0 +1 @@ +./../../theodolite/crd/crd-benchmark.yaml \ No newline at end of file diff --git a/helm/crds/execution.yaml b/helm/crds/execution.yaml new file mode 120000 index 0000000000000000000000000000000000000000..62d268c23c391cd7bbfbaffeaee8af1697dc446a --- /dev/null +++ b/helm/crds/execution.yaml @@ -0,0 +1 @@ +./../../theodolite/crd/crd-execution.yaml \ No newline at end of file diff --git a/helm/templates/theodolite/crd-benchmark.yaml b/helm/templates/theodolite/crd-benchmark.yaml deleted file mode 100644 index 084480e1f9e2ef827fb145cd823bbd2f68a20bac..0000000000000000000000000000000000000000 --- a/helm/templates/theodolite/crd-benchmark.yaml +++ /dev/null @@ -1,119 +0,0 @@ -{{- if .Values.operator.benchmarkCRD.create -}} -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: benchmarks.theodolite.com -spec: - group: theodolite.com - names: - kind: benchmark - plural: benchmarks - shortNames: - - bench - versions: - - name: v1 - served: true - storage: true - schema: - openAPIV3Schema: - type: object - required: ["spec"] - properties: - spec: - type: object - required: [] - properties: - name: - type: string - appResource: - type: array - minItems: 1 - items: - type: string - loadGenResource: - type: array - minItems: 1 - items: - type: string - resourceTypes: - type: array - minItems: 1 - items: - type: object - properties: - typeName: - type: string - patchers: - type: array - minItems: 1 - items: - type: object - properties: - type: - type: string - default: "" - resource: - type: string - default: "" - properties: - type: object - additionalProperties: true - x-kubernetes-map-type: "granular" - default: {} - loadTypes: - type: array - minItems: 1 - items: - type: object - properties: - typeName: - type: string - patchers: - type: array - minItems: 1 - items: - type: object - properties: - type: - type: string - default: "" - resource: - type: string - default: "" - properties: - type: object - additionalProperties: true - x-kubernetes-map-type: "granular" - default: {} - kafkaConfig: - type: object - properties: - bootstrapServer: - type: string - topics: - type: array - minItems: 1 - items: - type: object - required: [] - properties: - name: - type: string - default: "" - numPartitions: - type: integer - default: 0 - replicationFactor: - type: integer - default: 0 - removeOnly: - type: boolean - default: false - additionalPrinterColumns: - - name: Age - type: date - jsonPath: .metadata.creationTimestamp - subresources: - status: {} - scope: Namespaced -{{- end }} diff --git a/helm/templates/theodolite/crd-execution.yaml b/helm/templates/theodolite/crd-execution.yaml deleted file mode 100644 index 163835e9b37aca774983d4f019cc61d4bde06510..0000000000000000000000000000000000000000 --- a/helm/templates/theodolite/crd-execution.yaml +++ /dev/null @@ -1,133 +0,0 @@ -{{- if .Values.operator.executionCRD.create -}} -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - name: executions.theodolite.com -spec: - group: theodolite.com - names: - kind: execution - plural: executions - shortNames: - - exec - versions: - - name: v1 - served: true - storage: true - schema: - openAPIV3Schema: - type: object - required: ["spec"] - properties: - spec: - type: object - required: ["benchmark", "load", "resources", "slos", "execution", "configOverrides"] - properties: - name: - type: string - default: "" - benchmark: - type: string - load: # definition of the load dimension - type: object - required: ["loadType", "loadValues"] - properties: - loadType: - type: string - loadValues: - type: array - items: - type: integer - resources: # definition of the resource dimension - type: object - required: ["resourceType", "resourceValues"] - properties: - resourceType: - type: string - resourceValues: - type: array - items: - type: integer - slos: # def of service level objectives - type: array - items: - type: object - required: ["sloType", "prometheusUrl", "offset"] - properties: - sloType: - description: The type of the SLO. It must match 'lag trend'. - type: string - prometheusUrl: - description: Connection string for Promehteus. - type: string - offset: - description: Hours by which the start and end timestamp will be shifted (for different timezones). - type: integer - properties: - description: (Optional) SLO specific additional arguments. - type: object - additionalProperties: true - x-kubernetes-map-type: "granular" - default: {} - execution: # def execution config - type: object - required: ["strategy", "duration", "repetitions", "restrictions"] - properties: - strategy: - type: string - duration: - type: integer - repetitions: - type: integer - loadGenerationDelay: - type: integer - restrictions: - type: array - items: - type: string - configOverrides: - type: array - items: - type: object - properties: - patcher: - type: object - properties: - type: - type: string - default: "" - resource: - type: string - default: "" - properties: - type: object - additionalProperties: true - x-kubernetes-map-type: "granular" - default: {} - value: - type: string - status: - type: object - properties: - executionState: - description: "" - type: string - executionDuration: - description: "Duration of the execution in seconds" - type: string - additionalPrinterColumns: - - name: STATUS - type: string - description: State of the execution - jsonPath: .status.executionState - - name: Duration - type: string - description: Duration of the execution - jsonPath: .status.executionDuration - - name: Age - type: date - jsonPath: .metadata.creationTimestamp - subresources: - status: {} - scope: Namespaced -{{- end }} diff --git a/helm/values.yaml b/helm/values.yaml index 917ec5cdbda7541b56b366aff2412ccf7d856f3b..571cdd629c382a88ca8d4b22234d2d0907fa5fae 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -250,11 +250,6 @@ operator: imageTag: latest imagePullPolicy: Always - executionCRD: - create: true - benchmarkCRD: - create: true - sloChecker: lagTrend: enabled: true diff --git a/theodolite-benchmarks/kstreams-commons/build.gradle b/theodolite-benchmarks/kstreams-commons/build.gradle index e177aa5c4770c1a77fc21084a7766741fdb9bdec..c5a880acd4377056cc0b0f06b33a2d74c9f87c4e 100644 --- a/theodolite-benchmarks/kstreams-commons/build.gradle +++ b/theodolite-benchmarks/kstreams-commons/build.gradle @@ -7,6 +7,9 @@ repositories { maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } + maven { + url 'https://packages.confluent.io/maven/' + } } dependencies { diff --git a/theodolite/crd/crd-benchmark.yaml b/theodolite/crd/crd-benchmark.yaml index 9de29fc031e26b9e4e16517492740b0805fd4af9..7a861276a651af520ccec853b65cb57009a45cc5 100644 --- a/theodolite/crd/crd-benchmark.yaml +++ b/theodolite/crd/crd-benchmark.yaml @@ -118,7 +118,7 @@ spec: minItems: 1 items: type: object - required: ["name", "numPartitions", "replicationFactor"] + required: ["name"] properties: name: description: The name of the topic. diff --git a/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt b/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt index 76b158a580102e209b13e247864dd7481b557638..93e8e6180f5a99486e500af022869d896067d128 100644 --- a/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt +++ b/theodolite/src/main/kotlin/theodolite/evaluation/SloCheckerFactory.kt @@ -22,13 +22,13 @@ class SloCheckerFactory { * - `warmup`: time from the beginning to skip in the analysis. * * - * ### `lag trend percent` + * ### `lag trend ratio` * Creates an [ExternalSloChecker] with defined parameters. - * The required threshold is computed using a percentage and the load of the experiment. + * The required threshold is computed using a ratio and the load of the experiment. * * The properties map needs the following fields: * - `externalSlopeURL`: Url to the concrete SLO checker service. - * - `percent`: of the executed load that is accepted for the slope. + * - `ratio`: of the executed load that is accepted for the slope. * - `warmup`: time from the beginning to skip in the analysis. * * @param sloType Type of the [SloChecker]. @@ -50,18 +50,15 @@ class SloCheckerFactory { threshold = properties["threshold"]?.toInt() ?: throw IllegalArgumentException("threshold expected"), warmup = properties["warmup"]?.toInt() ?: throw IllegalArgumentException("warmup expected") ) - "lag trend percent" -> { - if (!properties["loadType"].equals("NumSensors")) { - throw IllegalArgumentException("Percent Threshold is only allowed with load type NumSensors") - } - var thresholdPercent = - properties["percent"]?.toDouble() - ?: throw IllegalArgumentException("percent for threshold expected") - if (thresholdPercent < 0.0 || thresholdPercent > 1.0) { - throw IllegalArgumentException("Threshold percent need to be an Double in the range between 0.0 and 1.0 (inclusive)") + "lag trend ratio" -> { + var thresholdRatio = + properties["ratio"]?.toDouble() + ?: throw IllegalArgumentException("ratio for threshold expected") + if (thresholdRatio < 0.0) { + throw IllegalArgumentException("Threshold ratio needs to be an Double greater or equal 0.0") } // cast to int, as rounding is not really necessary - var threshold = (load.get() * thresholdPercent).toInt() + var threshold = (load.get() * thresholdRatio).toInt() ExternalSloChecker( externalSlopeURL = properties["externalSloUrl"] diff --git a/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt b/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt index bc9371763c30e4cef913a368b64e9989e7f2286b..f5054dc2d8c3525562118b559ab8987215dc4ea1 100644 --- a/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt +++ b/theodolite/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt @@ -55,9 +55,6 @@ class TheodoliteExecutor( this.kubernetesBenchmark.loadTypes ) - // Add load type to check if the percentage lag trend is applicable - config.slos.forEach { it.properties["loadType"] = config.load.loadType } - executor = BenchmarkExecutorImpl( benchmark = kubernetesBenchmark,