Skip to content
Snippets Groups Projects
Commit ebc717f6 authored by Lorenz Boguhn's avatar Lorenz Boguhn
Browse files

Debuuging

parent fa0af504
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus,!78Resolve "Implement Quarkus/Kotlin protype"
......@@ -15,8 +15,8 @@ class TheodoliteExecutor() {
private fun loadConfig(): Config {
val benchmark: UC1Benchmark = UC1Benchmark(
UC1Benchmark.UC1BenchmarkConfig( // use port forward 2181 -> 2181
zookeeperConnectionString = "127.0.0.1:2181", //"my-confluent-cp-zookeeper:2181", //localhost:2181.
kafkaIPConnectionString = "localhost:9093",//"my-confluent-cp-kafka:","178.18.0."
zookeeperConnectionString = "localhost:2181", //"my-confluent-cp-zookeeper:2181", //localhost:2181.
kafkaIPConnectionString = "localhost:9092",//"my-confluent-cp-kafka:","178.18.0."
schemaRegistryConnectionString = "http://my-confluent-cp-schema-registry:8081",
kafkaPartition = 40,
kafkaReplication = 1,
......@@ -37,8 +37,8 @@ class TheodoliteExecutor() {
val searchStrategy = LinearSearch(executor, results)
return Config(
loads = (0..6).map { number -> LoadDimension(number) },
resources = (0..6).map { number -> Resource(number) },
loads = (1..6).map { number -> LoadDimension(number) },
resources = (1..6).map { number -> Resource(number) },
compositeStrategy = CompositeStrategy(
executor,
searchStrategy,
......
......@@ -4,10 +4,13 @@ import io.fabric8.kubernetes.api.model.Service
import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.NamespacedKubernetesClient
import mu.KotlinLogging
import theodolite.util.Benchmark
import theodolite.util.LoadDimension
import theodolite.util.Resource
private val logger = KotlinLogging.logger {}
class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
val workloadGeneratorStateCleaner: WorkloadGeneratorStateCleaner
val topicManager: TopicManager
......@@ -19,6 +22,7 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
val serviceManager: ServiceManager
var ucDeployment: Deployment
var ucService: Service
var wgDeployment: Deployment
init {
......@@ -30,6 +34,7 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
this.serviceManager = ServiceManager(this.kubernetesClient)
ucDeployment = this.yamlLoader.loadDeployment(this.config.ucDeploymentPath)
ucService = this.yamlLoader.loadService(this.config.ucServicePath)
wgDeployment = this.yamlLoader.loadDeployment(this.config.wgDeploymentPath)
}
override fun clearClusterEnvironment() {
......@@ -37,6 +42,7 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
this.topicManager.deleteTopics(this.config.kafkaTopics)
this.deploymentManager.delete(this.ucDeployment)
this.serviceManager.delete(this.ucService)
this.deploymentManager.delete(this.wgDeployment)
}
override fun initializeClusterEnvironment() {
......@@ -71,20 +77,23 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
override fun startWorkloadGenerator(load: LoadDimension) {
this.deploymentManager.setImageName(ucDeployment, "workload-generator", this.config.wgImageURL)
val wgDeployment = this.yamlLoader.loadDeployment(this.config.wgDeploymentPath)
// TODO ("calculate number of required instances")
val requiredInstances: Int = 1
val environmentVariables: MutableMap<String, String> = mutableMapOf()
environmentVariables.put("KAFKA_BOOTSTRAP_SERVERS", this.config.kafkaIPConnectionString)
environmentVariables.put("ZK_HOST", this.config.schemaRegistryConnectionString.split(":")[0])
environmentVariables.put("ZK_PORT", this.config.schemaRegistryConnectionString.split(":")[1])
environmentVariables.put("ZK_HOST", this.config.zookeeperConnectionString.split(":")[0])
environmentVariables.put("ZK_PORT", this.config.zookeeperConnectionString.split(":")[1])
environmentVariables.put("NUM_SENSORS", load.get().toString())
environmentVariables.put("NUM_INSTANCES", requiredInstances.toString())
this.deploymentManager.setWorkloadEnv(wgDeployment, "workload-generator", environmentVariables)
logger.info { environmentVariables.toString() }
this.deploymentManager.setWorkloadEnv(this.wgDeployment, "workload-generator", environmentVariables)
logger.info { this.wgDeployment. }
this.deploymentManager.deploy(this.wgDeployment)
}
data class UC1BenchmarkConfig(
......@@ -100,4 +109,4 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
val ucImageURL: String,
val wgImageURL: String
) {}
}
\ 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