diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteCRDExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteCRDExecutor.kt new file mode 100644 index 0000000000000000000000000000000000000000..55b9765c51dd49772f8ad28a45213c7747a96994 --- /dev/null +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteCRDExecutor.kt @@ -0,0 +1,25 @@ +package theodolite.execution + +import io.fabric8.kubernetes.client.DefaultKubernetesClient +import io.quarkus.runtime.annotations.QuarkusMain +import mu.KotlinLogging +import kotlin.system.exitProcess + +private var DEFAULT_NAMESPACE = "default" +private val logger = KotlinLogging.logger {} + +@QuarkusMain(name = "TheodoliteCRDExecutor") +object TheodoliteCRDExecutor { + @JvmStatic + fun main(args: Array<String>) { + + val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE + logger.info { "Using $namespace as namespace." } + + val client = DefaultKubernetesClient().inNamespace(namespace) + + println("hello there") + + exitProcess(0) + } +} diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt index d5f73338718af26c49ff86d63c16a4fa5a903646..c3a98ef63a9a4755133580aeefb59688e8cc3460 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteYamlExecutor.kt @@ -7,6 +7,7 @@ import theodolite.benchmark.KubernetesBenchmark import theodolite.util.YamlParser import kotlin.system.exitProcess +private var DEFAULT_NAMESPACE = "default" private val logger = KotlinLogging.logger {} @QuarkusMain(name = "TheodoliteYamlExecutor") diff --git a/theodolite-quarkus/src/main/resources/application.properties b/theodolite-quarkus/src/main/resources/application.properties index 869bd94cea974d0303a6f6a9f12f2f084f1d7c7e..397f64e02d59e0619db5da05d44f37096450c960 100644 --- a/theodolite-quarkus/src/main/resources/application.properties +++ b/theodolite-quarkus/src/main/resources/application.properties @@ -1 +1 @@ -quarkus.package.main-class=TheodoliteYamlExecutor \ No newline at end of file +quarkus.package.main-class=TheodoliteCRDExecutor \ No newline at end of file diff --git a/theodolite-quarkus/src/main/resources/yaml/BenchmarkExecutionCRD.yaml b/theodolite-quarkus/src/main/resources/yaml/BenchmarkExecutionCRD.yaml new file mode 100644 index 0000000000000000000000000000000000000000..a91d123628a03bb7fd82821d6f34d7bf1239c154 --- /dev/null +++ b/theodolite-quarkus/src/main/resources/yaml/BenchmarkExecutionCRD.yaml @@ -0,0 +1,46 @@ +name: "Theodolite Test Context" +benchmark: "benchmarkType" +load: + loadType: "NumSensors" + loadValues: + - 50000 +resources: + resourceType: "Instances" + resourceValues: + - 1 +slos: + - sloType: "lag trend" + threshold: 1000 + prometheusUrl: "http://localhost:32656" + externalSloUrl: "http://localhost:80/evaluate-slope" + offset: 0 + warmup: 0 +execution: + strategy: "LinearSearch" + duration: 60 + repetitions: 1 + restrictions: + - "LowerBound" +configOverrides: + - patcher: + type: "NodeSelectorPatcher" + resource: "uc1-load-generator-deployment.yaml" + variableName: "env" + value: "prod" + - patcher: + type: "NodeSelectorPatcher" + resource: "uc1-kstreams-deployment.yaml" + variableName: "env" + value: "prod" + - patcher: + type: "ResourceLimitPatcher" + resource: "uc1-kstreams-deployment.yaml" + container: "uc-application" + variableName: "cpu" + value: "1000m" + - patcher: + type: "ResourceLimitPatcher" + resource: "uc1-kstreams-deployment.yaml" + container: "uc-application" + variableName: "memory" + value: "2Gi" \ No newline at end of file diff --git a/theodolite-quarkus/src/main/resources/yaml/BenchmarkExecutionCRDShema.yaml b/theodolite-quarkus/src/main/resources/yaml/BenchmarkExecutionCRDShema.yaml new file mode 100644 index 0000000000000000000000000000000000000000..6ad7993a1c914053d4543ff4f6289e0d11ba8ade --- /dev/null +++ b/theodolite-quarkus/src/main/resources/yaml/BenchmarkExecutionCRDShema.yaml @@ -0,0 +1,51 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: Theodolite-Test-Context +spec: + name: string + benchmark: string + load: + loadType: string + loadValues: + - 50000 + resources: + resourceType: "Instances" + resourceValues: + - 1 + slos: + - sloType: "lag trend" + threshold: 1000 + prometheusUrl: "http://localhost:32656" + externalSloUrl: "http://localhost:80/evaluate-slope" + offset: 0 + warmup: 0 + execution: + strategy: "LinearSearch" + duration: 60 + repetitions: 1 + restrictions: + - "LowerBound" + configOverrides: + - patcher: + type: "NodeSelectorPatcher" + resource: "uc1-load-generator-deployment.yaml" + variableName: "env" + value: "prod" + - patcher: + type: "NodeSelectorPatcher" + resource: "uc1-kstreams-deployment.yaml" + variableName: "env" + value: "prod" + - patcher: + type: "ResourceLimitPatcher" + resource: "uc1-kstreams-deployment.yaml" + container: "uc-application" + variableName: "cpu" + value: "1000m" + - patcher: + type: "ResourceLimitPatcher" + resource: "uc1-kstreams-deployment.yaml" + container: "uc-application" + variableName: "memory" + value: "2Gi" \ No newline at end of file