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