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

Fix worloadGen url and add config map

parent ebc717f6
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"
...@@ -25,8 +25,9 @@ class TheodoliteExecutor() { ...@@ -25,8 +25,9 @@ class TheodoliteExecutor() {
ucDeploymentPath = path + "/aggregation-deployment.yaml", ucDeploymentPath = path + "/aggregation-deployment.yaml",
ucServicePath = path + "/aggregation-service.yaml", ucServicePath = path + "/aggregation-service.yaml",
wgDeploymentPath = path + "/workloadGenerator.yaml", wgDeploymentPath = path + "/workloadGenerator.yaml",
configMapPath = path + "jmx-configmap",
ucImageURL = "ghcr.io/cau-se/theodolite-uc1-kstreams-app:latest", ucImageURL = "ghcr.io/cau-se/theodolite-uc1-kstreams-app:latest",
wgImageURL = "ghcr.io/cau-se/theodolite-uc1-kstreams-workload-generator:latest" wgImageURL = "ghcr.io/cau-se/theodolite-uc1-workload-generator:theodolite-kotlin-latest"
) )
) )
val results: Results = Results() val results: Results = Results()
......
package theodolite.k8s package theodolite.k8s
import io.fabric8.kubernetes.api.model.ConfigMap
import io.fabric8.kubernetes.api.model.Service import io.fabric8.kubernetes.api.model.Service
import io.fabric8.kubernetes.api.model.apps.Deployment import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.client.DefaultKubernetesClient import io.fabric8.kubernetes.client.DefaultKubernetesClient
...@@ -20,9 +21,11 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { ...@@ -20,9 +21,11 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
val yamlLoader: YamlLoader val yamlLoader: YamlLoader
val deploymentManager: DeploymentManager val deploymentManager: DeploymentManager
val serviceManager: ServiceManager val serviceManager: ServiceManager
val configMapManager: ConfigMapManager
var ucDeployment: Deployment var ucDeployment: Deployment
var ucService: Service var ucService: Service
var wgDeployment: Deployment var wgDeployment: Deployment
var configMap: ConfigMap
init { init {
...@@ -32,9 +35,11 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { ...@@ -32,9 +35,11 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
this.yamlLoader = YamlLoader(this.kubernetesClient) this.yamlLoader = YamlLoader(this.kubernetesClient)
this.deploymentManager = DeploymentManager(this.kubernetesClient) this.deploymentManager = DeploymentManager(this.kubernetesClient)
this.serviceManager = ServiceManager(this.kubernetesClient) this.serviceManager = ServiceManager(this.kubernetesClient)
this.configMapManager = ConfigMapManager(this.kubernetesClient)
ucDeployment = this.yamlLoader.loadDeployment(this.config.ucDeploymentPath) ucDeployment = this.yamlLoader.loadDeployment(this.config.ucDeploymentPath)
ucService = this.yamlLoader.loadService(this.config.ucServicePath) ucService = this.yamlLoader.loadService(this.config.ucServicePath)
wgDeployment = this.yamlLoader.loadDeployment(this.config.wgDeploymentPath) wgDeployment = this.yamlLoader.loadDeployment(this.config.wgDeploymentPath)
configMap = this.yamlLoader.loadConfigmap(this.config.configMapPath)
} }
override fun clearClusterEnvironment() { override fun clearClusterEnvironment() {
...@@ -70,13 +75,15 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { ...@@ -70,13 +75,15 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
this.deploymentManager.setReplica(ucDeployment, resources.get()) this.deploymentManager.setReplica(ucDeployment, resources.get())
this.deploymentManager.setWorkloadEnv(ucDeployment, "uc-application", environmentVariables) this.deploymentManager.setWorkloadEnv(ucDeployment, "uc-application", environmentVariables)
// create kubernetes resources // create kubernetes resources
this.deploymentManager.deploy(ucDeployment) this.deploymentManager.deploy(ucDeployment)
this.serviceManager.deploy(ucService) this.serviceManager.deploy(ucService)
this.configMapManager.deploy(configMap)
} }
override fun startWorkloadGenerator(load: LoadDimension) { override fun startWorkloadGenerator(load: LoadDimension) {
this.deploymentManager.setImageName(ucDeployment, "workload-generator", this.config.wgImageURL) this.deploymentManager.setImageName(wgDeployment, "workload-generator", this.config.wgImageURL)
// TODO ("calculate number of required instances") // TODO ("calculate number of required instances")
...@@ -86,13 +93,13 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { ...@@ -86,13 +93,13 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
environmentVariables.put("ZK_HOST", this.config.zookeeperConnectionString.split(":")[0]) environmentVariables.put("ZK_HOST", this.config.zookeeperConnectionString.split(":")[0])
environmentVariables.put("ZK_PORT", this.config.zookeeperConnectionString.split(":")[1]) environmentVariables.put("ZK_PORT", this.config.zookeeperConnectionString.split(":")[1])
environmentVariables.put("NUM_SENSORS", load.get().toString()) environmentVariables.put("NUM_SENSORS", load.get().toString())
environmentVariables.put("NUM_INSTANCES", requiredInstances.toString()) environmentVariables.put("INSTANCES", requiredInstances.toString())
logger.info { environmentVariables.toString() } logger.info { this.config.toString() }
logger.info { this.wgDeployment.toString() }
this.deploymentManager.setWorkloadEnv(this.wgDeployment, "workload-generator", environmentVariables) this.deploymentManager.setWorkloadEnv(this.wgDeployment, "workload-generator", environmentVariables)
logger.info { this.wgDeployment.toString() }
logger.info { this.wgDeployment. }
this.deploymentManager.deploy(this.wgDeployment) this.deploymentManager.deploy(this.wgDeployment)
} }
...@@ -105,6 +112,7 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) { ...@@ -105,6 +112,7 @@ class UC1Benchmark(config: UC1BenchmarkConfig) : Benchmark(config) {
val kafkaPartition: Int, val kafkaPartition: Int,
val ucDeploymentPath: String, val ucDeploymentPath: String,
val ucServicePath: String, val ucServicePath: String,
val configMapPath: String,
val wgDeploymentPath: String, val wgDeploymentPath: String,
val ucImageURL: String, val ucImageURL: String,
val wgImageURL: String val wgImageURL: String
......
...@@ -14,25 +14,21 @@ spec: ...@@ -14,25 +14,21 @@ spec:
spec: spec:
terminationGracePeriodSeconds: 0 terminationGracePeriodSeconds: 0
containers: containers:
- name: workload-generator - name: workload-generator
image: workload-generator:latest image: workload-generator:latest
env: env:
# Order need to be preserved for run_uc.py # Order need to be preserved for run_uc.py
- name: NUM_SENSORS - name: NUM_SENSORS
value: "25000" value: "25000"
- name: INSTANCES - name: INSTANCES
value: "1" value: "1"
- name: NUM_NESTED_GROUPS - name: NUM_NESTED_GROUPS
value: "5" value: "5"
- name: ZK_HOST - name: ZK_HOST
value: "my-confluent-cp-zookeeper" value: "my-confluent-cp-zookeeper"
- name: ZK_PORT - name: ZK_PORT
value: "2181" value: "2181"
- name: KAFKA_BOOTSTRAP_SERVERS - name: KAFKA_BOOTSTRAP_SERVERS
value: "my-confluent-cp-kafka:9092" value: "my-confluent-cp-kafka:9092"
- name: SCHEMA_REGISTRY_URL - name: SCHEMA_REGISTRY_URL
value: "http://my-confluent-cp-schema-registry:8081" value: "http://my-confluent-cp-schema-registry:8081"
- name: POD_NAME \ No newline at end of file
valueFrom:
fieldRef:
fieldPath: metadata.name
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