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

correct order of actions

parent 72edf7c9
No related branches found
No related tags found
1 merge request!201Introduce action commands
Pipeline #5831 passed
...@@ -46,15 +46,15 @@ class KubernetesBenchmarkDeployment( ...@@ -46,15 +46,15 @@ class KubernetesBenchmarkDeployment(
* - Deploy the needed resources. * - Deploy the needed resources.
*/ */
override fun setup() { override fun setup() {
sutBeforeActions.forEach { it.exec(client = client) }
val kafkaTopics = this.topics.filter { !it.removeOnly } val kafkaTopics = this.topics.filter { !it.removeOnly }
.map { NewTopic(it.name, it.numPartitions, it.replicationFactor) } .map { NewTopic(it.name, it.numPartitions, it.replicationFactor) }
kafkaController.createTopics(kafkaTopics) kafkaController.createTopics(kafkaTopics)
sutBeforeActions.forEach { it.exec(client = client) }
appResources.forEach { kubernetesManager.deploy(it) } appResources.forEach { kubernetesManager.deploy(it) }
logger.info { "Wait ${this.loadGenerationDelay} seconds before starting the load generator." } logger.info { "Wait ${this.loadGenerationDelay} seconds before starting the load generator." }
Thread.sleep(Duration.ofSeconds(this.loadGenerationDelay).toMillis()) Thread.sleep(Duration.ofSeconds(this.loadGenerationDelay).toMillis())
loadGenResources.forEach { kubernetesManager.deploy(it) }
loadGenBeforeActions.forEach { it.exec(client = client) } loadGenBeforeActions.forEach { it.exec(client = client) }
loadGenResources.forEach { kubernetesManager.deploy(it) }
} }
...@@ -66,14 +66,14 @@ class KubernetesBenchmarkDeployment( ...@@ -66,14 +66,14 @@ class KubernetesBenchmarkDeployment(
*/ */
override fun teardown() { override fun teardown() {
loadGenResources.forEach { kubernetesManager.remove(it) } loadGenResources.forEach { kubernetesManager.remove(it) }
loadGenAfterActions.forEach { it.exec(client = client) }
appResources.forEach { kubernetesManager.remove(it) } appResources.forEach { kubernetesManager.remove(it) }
sutAfterActions.forEach { it.exec(client = client) }
kafkaController.removeTopics(this.topics.map { topic -> topic.name }) kafkaController.removeTopics(this.topics.map { topic -> topic.name })
ResourceByLabelHandler(client).removePods( ResourceByLabelHandler(client).removePods(
labelName = LAG_EXPORTER_POD_LABEL_NAME, labelName = LAG_EXPORTER_POD_LABEL_NAME,
labelValue = LAG_EXPORTER_POD_LABEL_VALUE labelValue = LAG_EXPORTER_POD_LABEL_VALUE
) )
sutAfterActions.forEach { it.exec(client = client) }
loadGenAfterActions.forEach { it.exec(client = client) }
logger.info { "Teardown complete. Wait $afterTeardownDelay ms to let everything come down." } logger.info { "Teardown complete. Wait $afterTeardownDelay ms to let everything come down." }
Thread.sleep(Duration.ofSeconds(afterTeardownDelay).toMillis()) Thread.sleep(Duration.ofSeconds(afterTeardownDelay).toMillis())
} }
......
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