From ac6734857b729d2b0585098e6678c110f9d47f1a Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Mon, 15 Nov 2021 14:23:15 +0100 Subject: [PATCH] Update the example for running Theodolite --- theodolite/README.md | 26 +++++++++++--- .../examples/operator/example-benchmark.yaml | 3 -- .../resources/uc1-kstreams-deployment.yaml | 34 +++++++++++++++++++ .../uc1-load-generator-deployment.yaml | 32 +++++++++++++++++ .../resources/uc1-load-generator-service.yaml | 16 +++++++++ .../standalone/example-benchmark.yaml | 5 +-- 6 files changed, 104 insertions(+), 12 deletions(-) create mode 100644 theodolite/examples/resources/uc1-kstreams-deployment.yaml create mode 100644 theodolite/examples/resources/uc1-load-generator-deployment.yaml create mode 100644 theodolite/examples/resources/uc1-load-generator-service.yaml diff --git a/theodolite/README.md b/theodolite/README.md index 40f648d0b..e0d7b9b46 100644 --- a/theodolite/README.md +++ b/theodolite/README.md @@ -101,21 +101,37 @@ docker run -i --rm theodolite-native When running Theodolite from within IntelliJ via [Run Configurations](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#gradle_run_config), set the *Environment variables* field to: +Set the following environment variables to run the example in the `standalone` mode within the IDE: + +```sh +THEODOLITE_BENCHMARK=./../../../../examples/standalone/example-benchmark.yaml;THEODOLITE_EXECUTION=./../../../../examples/standalone/example-execution.yaml;THEODOLITE_APP_RESOURCES=./../../../../examples/resources; +``` + +Alternative: + +``` sh +export THEODOLITE_BENCHMARK=./../../../../examples/standalone/example-benchmark.yaml +export THEODOLITE_APP_RESOURCES=./../../../../examples/resources; +export THEODOLITE_EXECUTION=./../../../../examples/standalone/example-execution.yaml +./gradlew quarkusDev +``` + +Set the following environment variables to run the example in the `operator` mode within the IDE: + ```sh -NAMESPACE=default;THEODOLITE_BENCHMARK=./../../../../config/BenchmarkType.yaml;THEODOLITE_APP_RESOURCES=./../../../../config;THEODOLITE_EXECUTION=./../../../../config/BenchmarkExecution.yaml;MODE=operator +THEODOLITE_APP_RESOURCES=./../../../../examples/resources;MODE=operator ``` Alternative: ``` sh -export NAMESPACE=default -export THEODOLITE_BENCHMARK=./../../../../config/BenchmarkType.yaml -export THEODOLITE_APP_RESOURCES=./../../../../config -export THEODOLITE_EXECUTION=./../../../../config/BenchmarkExecution.yaml +export THEODOLITE_APP_RESOURCES=./../../../../examples/resources; export MODE=operator ./gradlew quarkusDev ``` +Additionally, the benchmark and execution resources must be installed. + ### Install Detekt Code analysis Plugin Install <https://plugins.jetbrains.com/plugin/10761-detekt> diff --git a/theodolite/examples/operator/example-benchmark.yaml b/theodolite/examples/operator/example-benchmark.yaml index 91d9f8f1f..2bd75f329 100644 --- a/theodolite/examples/operator/example-benchmark.yaml +++ b/theodolite/examples/operator/example-benchmark.yaml @@ -5,9 +5,6 @@ metadata: spec: 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" diff --git a/theodolite/examples/resources/uc1-kstreams-deployment.yaml b/theodolite/examples/resources/uc1-kstreams-deployment.yaml new file mode 100644 index 000000000..fdd1ff867 --- /dev/null +++ b/theodolite/examples/resources/uc1-kstreams-deployment.yaml @@ -0,0 +1,34 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: titan-ccp-aggregation +spec: + selector: + matchLabels: + app: titan-ccp-aggregation + replicas: 1 + template: + metadata: + labels: + app: titan-ccp-aggregation + spec: + terminationGracePeriodSeconds: 0 + containers: + - name: uc-application + image: ghcr.io/cau-se/theodolite-uc1-kstreams-app:latest + ports: + - containerPort: 5555 + name: jmx + env: + - name: KAFKA_BOOTSTRAP_SERVERS + value: "theodolite-cp-kafka:9092" + - name: SCHEMA_REGISTRY_URL + value: "http://theodolite-cp-schema-registry:8081" + - name: JAVA_OPTS + value: "-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.port=5555" + - name: COMMIT_INTERVAL_MS # Set as default for the applications + value: "100" + resources: + limits: + memory: 4Gi + cpu: 1000m \ No newline at end of file diff --git a/theodolite/examples/resources/uc1-load-generator-deployment.yaml b/theodolite/examples/resources/uc1-load-generator-deployment.yaml new file mode 100644 index 000000000..9f9ccc6ae --- /dev/null +++ b/theodolite/examples/resources/uc1-load-generator-deployment.yaml @@ -0,0 +1,32 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: titan-ccp-load-generator +spec: + selector: + matchLabels: + app: titan-ccp-load-generator + replicas: 1 + template: + metadata: + labels: + app: titan-ccp-load-generator + spec: + terminationGracePeriodSeconds: 0 + containers: + - name: workload-generator + image: ghcr.io/cau-se/theodolite-uc1-workload-generator:latest + ports: + - containerPort: 5701 + name: coordination + env: + - name: KUBERNETES_NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + - name: KUBERNETES_DNS_NAME + value: "titan-ccp-load-generator.$(KUBERNETES_NAMESPACE).svc.cluster.local" + - name: KAFKA_BOOTSTRAP_SERVERS + value: "theodolite-cp-kafka:9092" + - name: SCHEMA_REGISTRY_URL + value: "http://theodolite-cp-schema-registry:8081" diff --git a/theodolite/examples/resources/uc1-load-generator-service.yaml b/theodolite/examples/resources/uc1-load-generator-service.yaml new file mode 100644 index 000000000..f8b26b3f6 --- /dev/null +++ b/theodolite/examples/resources/uc1-load-generator-service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: titan-ccp-load-generator + labels: + app: titan-ccp-load-generator +spec: + type: ClusterIP + clusterIP: None + selector: + app: titan-ccp-load-generator + ports: + - name: coordination + port: 5701 + targetPort: 5701 + protocol: TCP diff --git a/theodolite/examples/standalone/example-benchmark.yaml b/theodolite/examples/standalone/example-benchmark.yaml index 83edce938..e3b37a348 100644 --- a/theodolite/examples/standalone/example-benchmark.yaml +++ b/theodolite/examples/standalone/example-benchmark.yaml @@ -1,9 +1,6 @@ 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" @@ -25,7 +22,7 @@ loadTypes: properties: loadGenMaxRecords: "15000" kafkaConfig: - bootstrapServer: "localhost:31290" + bootstrapServer: "theodolite-cp-kafka:9092" topics: - name: "input" numPartitions: 40 -- GitLab