From ebc717f637f8c38bcf889103765ca7738febb68e Mon Sep 17 00:00:00 2001 From: lorenz <stu203404@mail.uni-kiel.de> Date: Wed, 3 Feb 2021 17:09:19 +0100 Subject: [PATCH] Debuuging --- .../execution/TheodoliteExecutor.kt | 8 +++---- .../kotlin/theodolite/k8s/UC1Benchmark.kt | 23 +++++++++++++------ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt index 73a527bcb..2e6a02eb7 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/execution/TheodoliteExecutor.kt @@ -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, diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt index 42e7d2b67..bf535d3b8 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/UC1Benchmark.kt @@ -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 +} -- GitLab