Skip to content
Snippets Groups Projects
Commit 94dc4d34 authored by Benedikt Wetzel's avatar Benedikt Wetzel
Browse files

Read basic configuration for Kafka and Zookeeper

parent 9bac7e0d
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!85Introduce new Benchmark class and Patcher,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
...@@ -2,12 +2,11 @@ package theodolite.benchmark ...@@ -2,12 +2,11 @@ package theodolite.benchmark
import io.fabric8.kubernetes.api.model.KubernetesResource import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient import io.fabric8.kubernetes.client.DefaultKubernetesClient
import org.apache.kafka.clients.admin.NewTopic
import theodolite.k8s.YamlLoader import theodolite.k8s.YamlLoader
import theodolite.patcher.PatcherManager import theodolite.patcher.PatcherManager
import theodolite.util.LoadDimension import theodolite.util.*
import theodolite.util.OverridePatcherDefinition import java.util.*
import theodolite.util.Resource
import theodolite.util.TypeName
class KubernetesBenchmark(): Benchmark { class KubernetesBenchmark(): Benchmark {
lateinit var name: String lateinit var name: String
...@@ -15,6 +14,8 @@ class KubernetesBenchmark(): Benchmark { ...@@ -15,6 +14,8 @@ class KubernetesBenchmark(): Benchmark {
lateinit var loadGenResource: List<String> lateinit var loadGenResource: List<String>
lateinit var resourceTypes: List<TypeName> lateinit var resourceTypes: List<TypeName>
lateinit var loadTypes: List<TypeName> lateinit var loadTypes: List<TypeName>
lateinit var kafkaConfig: KafkaConfig
lateinit var zookeeperConfig: HashMap<String,String>
...@@ -45,9 +46,13 @@ class KubernetesBenchmark(): Benchmark { ...@@ -45,9 +46,13 @@ class KubernetesBenchmark(): Benchmark {
// patch overrides // patch overrides
overrides.forEach {override -> patcherManager.applyPatcher(override, resources)} overrides.forEach {override -> patcherManager.applyPatcher(override, resources)}
println(zookeeperConfig["server"] !! )
resources.forEach {x -> println(x)} return KubernetesBenchmarkDeployment(
resources.map { r -> r.second },
return KubernetesBenchmarkDeployment(emptyList(), hashMapOf<String, Any>(), "", emptyList()) kafkaConfig = hashMapOf("bootstrap.servers" to kafkaConfig.bootstrapSever),
zookeeperConfig = zookeeperConfig["server"].toString() !!,
topics = kafkaConfig.topics.map { topic -> NewTopic(topic.name, topic.partition, topic.replication ) })
} }
} }
...@@ -6,6 +6,7 @@ import org.apache.kafka.clients.admin.NewTopic ...@@ -6,6 +6,7 @@ import org.apache.kafka.clients.admin.NewTopic
import theodolite.k8s.K8sManager import theodolite.k8s.K8sManager
import theodolite.k8s.TopicManager import theodolite.k8s.TopicManager
import theodolite.k8s.WorkloadGeneratorStateCleaner import theodolite.k8s.WorkloadGeneratorStateCleaner
import java.util.*
class KubernetesBenchmarkDeployment( class KubernetesBenchmarkDeployment(
val resources: List<KubernetesResource>, // List of already patched resources val resources: List<KubernetesResource>, // List of already patched resources
......
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
...@@ -15,4 +15,12 @@ loadTypes: ...@@ -15,4 +15,12 @@ loadTypes:
- type: "EnvVarPatcher" - type: "EnvVarPatcher"
resource: "workloadGenerator.yaml" resource: "workloadGenerator.yaml"
container: "workload-generator" container: "workload-generator"
variableName: "NUM_SENSORS" variableName: "NUM_SENSORS"
\ No newline at end of file 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
...@@ -21,4 +21,4 @@ configOverrides: ...@@ -21,4 +21,4 @@ configOverrides:
container: "workload-generator" container: "workload-generator"
overrides: overrides:
overrideTestA: "8888" overrideTestA: "8888"
overrideTestB: "6666" overrideTestB: "6666"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment