diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt index 61a8dcfc27dc6e3cb97b5a7756a6ec5fcff64fda..8f08bf282d3eca4987be23df73b0821b80253d78 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmark.kt @@ -2,12 +2,11 @@ package theodolite.benchmark import io.fabric8.kubernetes.api.model.KubernetesResource import io.fabric8.kubernetes.client.DefaultKubernetesClient +import org.apache.kafka.clients.admin.NewTopic import theodolite.k8s.YamlLoader import theodolite.patcher.PatcherManager -import theodolite.util.LoadDimension -import theodolite.util.OverridePatcherDefinition -import theodolite.util.Resource -import theodolite.util.TypeName +import theodolite.util.* +import java.util.* class KubernetesBenchmark(): Benchmark { lateinit var name: String @@ -15,6 +14,8 @@ class KubernetesBenchmark(): Benchmark { lateinit var loadGenResource: List<String> lateinit var resourceTypes: List<TypeName> lateinit var loadTypes: List<TypeName> + lateinit var kafkaConfig: KafkaConfig + lateinit var zookeeperConfig: HashMap<String,String> @@ -45,9 +46,13 @@ class KubernetesBenchmark(): Benchmark { // patch overrides overrides.forEach {override -> patcherManager.applyPatcher(override, resources)} + println(zookeeperConfig["server"] !! ) - resources.forEach {x -> println(x)} - - return KubernetesBenchmarkDeployment(emptyList(), hashMapOf<String, Any>(), "", emptyList()) + return KubernetesBenchmarkDeployment( + resources.map { r -> r.second }, + kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapSever), + zookeeperConfig = zookeeperConfig["server"].toString() !!, + topics = kafkaConfig.topics.map { topic -> NewTopic(topic.name, topic.partition, topic.replication ) }) } } + diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt index ac7ab1b010cec0419c460d47658861967a96ae1f..3c14736915d5bd99d56d1e03b3da9feea0d3a3ed 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/benchmark/KubernetesBenchmarkDeployment.kt @@ -6,6 +6,7 @@ import org.apache.kafka.clients.admin.NewTopic import theodolite.k8s.K8sManager import theodolite.k8s.TopicManager import theodolite.k8s.WorkloadGeneratorStateCleaner +import java.util.* class KubernetesBenchmarkDeployment( val resources: List<KubernetesResource>, // List of already patched resources diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt new file mode 100644 index 0000000000000000000000000000000000000000..dd6471d59439f865d4f51c71a143d3a0fb4b139c --- /dev/null +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/KafkaConfig.kt @@ -0,0 +1,16 @@ +package theodolite.util + +import kotlin.properties.Delegates + + +class KafkaConfig() { + lateinit var bootstrapSever: String + lateinit var topics: List<Topic> + + class Topic() { + lateinit var name: String + var partition by Delegates.notNull<Int>() + var replication by Delegates.notNull<Short>() + + } +} \ No newline at end of file diff --git a/theodolite-quarkus/src/main/resources/yaml/testBenchmarkType.yaml b/theodolite-quarkus/src/main/resources/yaml/testBenchmarkType.yaml index f8c9d3fffd61b29f0e56ddbb7e7963f3ccdd62c4..dfc19f96727a860309ae679a7574a0b8d8e4ed9d 100644 --- a/theodolite-quarkus/src/main/resources/yaml/testBenchmarkType.yaml +++ b/theodolite-quarkus/src/main/resources/yaml/testBenchmarkType.yaml @@ -15,4 +15,12 @@ loadTypes: - type: "EnvVarPatcher" resource: "workloadGenerator.yaml" container: "workload-generator" - variableName: "NUM_SENSORS" \ No newline at end of file + variableName: "NUM_SENSORS" +kafkaConfig: + bootstrapSever: "my-confluent-cp-kafka:9092" + topics: + - name: "test" + partition: "1" + replication: "1" +zookeeperConfig: + server: "my-confluent-cp-zookeeper:2181" \ No newline at end of file diff --git a/theodolite-quarkus/src/main/resources/yaml/testContext.yaml b/theodolite-quarkus/src/main/resources/yaml/testContext.yaml index 6073f8de61df312aa2a33544ca2afd45f84ddd53..46ba710c810df9afb3eccf66edc2591047a02e8b 100644 --- a/theodolite-quarkus/src/main/resources/yaml/testContext.yaml +++ b/theodolite-quarkus/src/main/resources/yaml/testContext.yaml @@ -21,4 +21,4 @@ configOverrides: container: "workload-generator" overrides: overrideTestA: "8888" - overrideTestB: "6666" + overrideTestB: "6666" \ No newline at end of file