diff --git a/theodolite-quarkus/0-benchmark-configuration b/theodolite-quarkus/0-benchmark-configuration new file mode 100644 index 0000000000000000000000000000000000000000..0e624f024a4d069e094f873319a268fcc3595df5 --- /dev/null +++ b/theodolite-quarkus/0-benchmark-configuration @@ -0,0 +1,103 @@ +{ + "name": "uc1-kstreams", + "appResource": [ + "uc1-kstreams-deployment.yaml", + "aggregation-service.yaml", + "jmx-configmap.yaml", + "uc1-service-monitor.yaml" + ], + "loadGenResource": [ + "uc1-load-generator-deployment.yaml", + "uc1-load-generator-service.yaml" + ], + "resourceTypes": [ + { + "typeName": "Instances", + "patchers": [ + { + "type": "ReplicaPatcher", + "resource": "uc1-kstreams-deployment.yaml" + } + ] + } + ], + "loadTypes": [ + { + "typeName": "NumSensors", + "patchers": [ + { + "type": "EnvVarPatcher", + "resource": "uc1-load-generator-deployment.yaml", + "container": "workload-generator", + "variableName": "NUM_SENSORS" + }, + { + "type": "NumSensorsLoadGeneratorReplicaPatcher", + "resource": "uc1-load-generator-deployment.yaml" + } + ] + } + ], + "kafkaConfig": { + "bootstrapServer": "theodolite-cp-kafka:9092", + "topics": [ + { + "name": "input", + "numPartitions$delegate": { + "value": 40 + }, + "replicationFactor$delegate": { + "value": 1 + } + } + ] + }, + "namespace": "titan-she", + "path": "./../../../../config", + "kind": "benchmark", + "apiVersion": "theodolite.com/v1alpha1", + "metadata": { + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"theodolite.com/v1alpha1\",\"appResource\":[\"uc1-kstreams-deployment.yaml\",\"aggregation-service.yaml\",\"jmx-configmap.yaml\",\"uc1-service-monitor.yaml\"],\"kafkaConfig\":{\"bootstrapServer\":\"theodolite-cp-kafka:9092\",\"topics\":[{\"name\":\"input\",\"numPartitions\":40,\"replicationFactor\":1}]},\"kind\":\"benchmark\",\"loadGenResource\":[\"uc1-load-generator-deployment.yaml\",\"uc1-load-generator-service.yaml\"],\"loadTypes\":[{\"patchers\":[{\"container\":\"workload-generator\",\"resource\":\"uc1-load-generator-deployment.yaml\",\"type\":\"EnvVarPatcher\",\"variableName\":\"NUM_SENSORS\"},{\"resource\":\"uc1-load-generator-deployment.yaml\",\"type\":\"NumSensorsLoadGeneratorReplicaPatcher\"}],\"typeName\":\"NumSensors\"}],\"metadata\":{\"annotations\":{},\"name\":\"uc1-kstreams\",\"namespace\":\"titan-she\"},\"resourceTypes\":[{\"patchers\":[{\"resource\":\"uc1-kstreams-deployment.yaml\",\"type\":\"ReplicaPatcher\"}],\"typeName\":\"Instances\"}]}\n" + }, + "creationTimestamp": "2021-04-16T10:49:55Z", + "finalizers": [], + "generation": 2, + "managedFields": [ + { + "apiVersion": "theodolite.com/v1alpha1", + "fieldsType": "FieldsV1", + "fieldsV1": { + "additionalProperties": { + "f:resourceTypes": {}, + "f:loadGenResource": {}, + "f:loadTypes": {}, + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + } + }, + "f:kafkaConfig": { + ".": {}, + "f:bootstrapServer": {}, + "f:topics": {} + }, + "f:appResource": {} + } + }, + "manager": "kubectl-client-side-apply", + "operation": "Update", + "time": "2021-04-16T13:54:59Z", + "additionalProperties": {} + } + ], + "name": "uc1-kstreams", + "namespace": "titan-she", + "ownerReferences": [], + "resourceVersion": "82508519", + "selfLink": "/apis/theodolite.com/v1alpha1/namespaces/titan-she/benchmarks/uc1-kstreams", + "uid": "5efaec01-ed9b-4b9e-95b1-af78b7b8d761", + "additionalProperties": {} + } +} diff --git a/theodolite-quarkus/0-execution-configuration b/theodolite-quarkus/0-execution-configuration new file mode 100644 index 0000000000000000000000000000000000000000..882b5e96d5d473e318a55316d2a595b0916a82cd --- /dev/null +++ b/theodolite-quarkus/0-execution-configuration @@ -0,0 +1,144 @@ +{ + "executionId": 0, + "name": "example-execution-3", + "benchmark": "uc1-kstreams", + "load": { + "loadType": "NumSensors", + "loadValues": [ + 100000, + 200000, + 300000, + 400000, + 500000, + 600000 + ] + }, + "resources": { + "resourceType": "Instances", + "resourceValues": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20 + ] + }, + "slos": [ + { + "sloType": "lag trend", + "threshold$delegate": { + "value": 2000 + }, + "prometheusUrl": "http://prometheus-operated:9090", + "externalSloUrl": "http://localhost:80/evaluate-slope", + "offset$delegate": { + "value": 0 + }, + "warmup$delegate": { + "value": 60 + } + } + ], + "execution": { + "strategy": "LinearSearch", + "duration$delegate": { + "value": 300 + }, + "repetitions$delegate": { + "value": 1 + }, + "restrictions": [ + "LowerBound" + ] + }, + "configOverrides": [ + { + "patcher": { + "type": "NodeSelectorPatcher", + "resource": "uc1-load-generator-deployment.yaml", + "variableName": "env" + }, + "value": "dev" + }, + { + "patcher": { + "type": "NodeSelectorPatcher", + "resource": "uc1-kstreams-deployment.yaml", + "variableName": "env" + }, + "value": "dev" + } + ], + "kind": "execution", + "apiVersion": "theodolite.com/v1alpha1", + "metadata": { + "annotations": { + "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"theodolite.com/v1alpha1\",\"benchmark\":\"uc1-kstreams\",\"configOverrides\":[{\"patcher\":{\"resource\":\"uc1-load-generator-deployment.yaml\",\"type\":\"NodeSelectorPatcher\",\"variableName\":\"env\"},\"value\":\"dev\"},{\"patcher\":{\"resource\":\"uc1-kstreams-deployment.yaml\",\"type\":\"NodeSelectorPatcher\",\"variableName\":\"env\"},\"value\":\"dev\"}],\"execution\":{\"duration\":300,\"repetitions\":1,\"restrictions\":[\"LowerBound\"],\"strategy\":\"LinearSearch\"},\"kind\":\"execution\",\"load\":{\"loadType\":\"NumSensors\",\"loadValues\":[100000,200000,300000,400000,500000,600000]},\"metadata\":{\"annotations\":{},\"name\":\"example-execution-3\",\"namespace\":\"titan-she\"},\"resources\":{\"resourceType\":\"Instances\",\"resourceValues\":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]},\"slos\":[{\"externalSloUrl\":\"http://localhost:80/evaluate-slope\",\"offset\":0,\"prometheusUrl\":\"http://prometheus-operated:9090\",\"sloType\":\"lag trend\",\"threshold\":2000,\"warmup\":60}]}\n" + }, + "creationTimestamp": "2021-04-17T18:09:25Z", + "finalizers": [], + "generation": 1, + "managedFields": [ + { + "apiVersion": "theodolite.com/v1alpha1", + "fieldsType": "FieldsV1", + "fieldsV1": { + "additionalProperties": { + "f:metadata": { + "f:annotations": { + ".": {}, + "f:kubectl.kubernetes.io/last-applied-configuration": {} + } + }, + "f:slos": {}, + "f:load": { + ".": {}, + "f:loadType": {}, + "f:loadValues": {} + }, + "f:benchmark": {}, + "f:configOverrides": {}, + "f:resources": { + ".": {}, + "f:resourceType": {}, + "f:resourceValues": {} + }, + "f:execution": { + ".": {}, + "f:duration": {}, + "f:repetitions": {}, + "f:restrictions": {}, + "f:strategy": {} + } + } + }, + "manager": "kubectl-client-side-apply", + "operation": "Update", + "time": "2021-04-17T18:09:25Z", + "additionalProperties": {} + } + ], + "name": "example-execution-3", + "namespace": "titan-she", + "ownerReferences": [], + "resourceVersion": "82932660", + "selfLink": "/apis/theodolite.com/v1alpha1/namespaces/titan-she/executions/example-execution-3", + "uid": "1aea99f5-0584-49c8-8541-45307af38a16", + "additionalProperties": {} + } +} diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt index 1474040d3c64a24abfd5a7d863171c76e3a86865..90c2cb8a9c810aa524b6608a558d31e15587719e 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/k8s/TopicManager.kt @@ -31,10 +31,11 @@ class TopicManager(private val kafkaConfig: Map<String, Any>) { result.all().get() // wait for the future to be completed } catch (e: Exception) { + logger.warn(e) { "Error during topic creation." } + logger.debug { e } // TODO remove? + logger.info { "Remove existing topics." } delete(newTopics.map { topic -> topic.name() }, kafkaAdmin) - logger.warn { "Error during topic creation." } - logger.debug { e } - logger.warn { "Will retry the topic creation after 2 seconds" } + logger.info { "Will retry the topic creation in $RETRY_TIME seconds." } sleep(RETRY_TIME) retryCreation = true } @@ -73,8 +74,8 @@ class TopicManager(private val kafkaConfig: Map<String, Any>) { }" } } catch (e: Exception) { - logger.error { "Error while removing topics: $e" } - logger.debug { "Existing topics are: ${kafkaAdmin.listTopics()}." } + logger.error(e) { "Error while removing topics: $e" } + logger.info { "Existing topics are: ${kafkaAdmin.listTopics()}." } } val toDelete = topics.filter { topic -> @@ -84,7 +85,7 @@ class TopicManager(private val kafkaConfig: Map<String, Any>) { if (toDelete.isNullOrEmpty()) { deleted = true } else { - logger.info { "Deletion of kafka topics failed retrying in 2 seconds" } + logger.info { "Deletion of kafka topics failed, will retry in $RETRY_TIME seconds." } sleep(RETRY_TIME) } }