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

Cleanup + fix dockerfile + enhance default configs

parent 63094c85
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!106Introduce a Theodolite operator,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
...@@ -41,7 +41,7 @@ RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \ ...@@ -41,7 +41,7 @@ RUN microdnf install curl ca-certificates ${JAVA_PACKAGE} \
&& echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security && echo "securerandom.source=file:/dev/urandom" >> /etc/alternatives/jre/lib/security/java.security
# Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size. # Configure the JAVA_OPTIONS, you can add -XshowSettings:vm to also display the heap size.
ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dquarkus.package.main-class=TheodoliteOperator"
COPY build/lib/* /deployments/lib/ COPY build/lib/* /deployments/lib/
COPY build/*-runner.jar /deployments/app.jar COPY build/*-runner.jar /deployments/app.jar
COPY config/ /deployments/config/ COPY config/ /deployments/config/
......
...@@ -30,6 +30,10 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced { ...@@ -30,6 +30,10 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced {
namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE
logger.info { "Using $namespace as namespace." } logger.info { "Using $namespace as namespace." }
path = System.getenv("THEODOLITE_APP_RESOURCES") ?: "./config"
logger.info { "Using $path as path for resources." }
val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(namespace)) val loader = K8sResourceLoader(DefaultKubernetesClient().inNamespace(namespace))
return resources return resources
.map { resource -> .map { resource ->
...@@ -62,7 +66,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced { ...@@ -62,7 +66,7 @@ class KubernetesBenchmark : Benchmark, CustomResource(), Namespaced {
patcherFactory.createPatcher(it.patcher, resources).patch(override.value) patcherFactory.createPatcher(it.patcher, resources).patch(override.value)
} }
} }
return KubernetesBenchmarkDeployment( return KubernetesBenchmarkDeployment(
namespace = namespace, namespace = namespace,
resources = resources.map { r -> r.second }, resources = resources.map { r -> r.second },
......
...@@ -2,10 +2,13 @@ package theodolite.execution ...@@ -2,10 +2,13 @@ package theodolite.execution
import io.fabric8.kubernetes.client.DefaultKubernetesClient import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext import io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext
import io.fabric8.kubernetes.internal.KubernetesDeserializer
import io.quarkus.runtime.annotations.QuarkusMain import io.quarkus.runtime.annotations.QuarkusMain
import mu.KotlinLogging import mu.KotlinLogging
import theodolite.benchmark.* import theodolite.benchmark.BenchmarkExecution
import io.fabric8.kubernetes.internal.KubernetesDeserializer import theodolite.benchmark.BenchmarkExecutionList
import theodolite.benchmark.KubernetesBenchmark
import theodolite.benchmark.KubernetesBenchmarkList
private var DEFAULT_NAMESPACE = "default" private var DEFAULT_NAMESPACE = "default"
...@@ -19,6 +22,7 @@ object TheodoliteOperator { ...@@ -19,6 +22,7 @@ object TheodoliteOperator {
val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE val namespace = System.getenv("NAMESPACE") ?: DEFAULT_NAMESPACE
logger.info { "Using $namespace as namespace." } logger.info { "Using $namespace as namespace." }
val client = DefaultKubernetesClient().inNamespace(namespace) val client = DefaultKubernetesClient().inNamespace(namespace)
KubernetesDeserializer.registerCustomKind( KubernetesDeserializer.registerCustomKind(
...@@ -49,19 +53,21 @@ object TheodoliteOperator { ...@@ -49,19 +53,21 @@ object TheodoliteOperator {
val informerFactory = client.informers() val informerFactory = client.informers()
val informerBenchmarkExecution = informerFactory.sharedIndexInformerForCustomResource( val informerBenchmarkExecution = informerFactory.sharedIndexInformerForCustomResource(
executionContext, BenchmarkExecution::class.java, executionContext, BenchmarkExecution::class.java,
BenchmarkExecutionList::class.java, 10 * 60 * 1000.toLong() BenchmarkExecutionList::class.java, 10 * 60 * 1000.toLong()
) )
val informerBenchmarkType = informerFactory.sharedIndexInformerForCustomResource( val informerBenchmarkType = informerFactory.sharedIndexInformerForCustomResource(
typeContext, KubernetesBenchmark::class.java, typeContext, KubernetesBenchmark::class.java,
KubernetesBenchmarkList::class.java, 10 * 60 * 1000.toLong() KubernetesBenchmarkList::class.java, 10 * 60 * 1000.toLong()
) )
val controller = TheodoliteController(client = client, val controller = TheodoliteController(
client = client,
informerBenchmarkExecution = informerBenchmarkExecution, informerBenchmarkExecution = informerBenchmarkExecution,
informerBenchmarkType = informerBenchmarkType, informerBenchmarkType = informerBenchmarkType,
executionContext = executionContext) executionContext = executionContext
)
controller.create() controller.create()
informerFactory.startAllRegisteredInformers() informerFactory.startAllRegisteredInformers()
......
quarkus.package.main-class=TheodoliteYamlExecutor quarkus.package.main-class=TheodoliteOperator
quarkus.native.additional-build-args=\ quarkus.native.additional-build-args=\
--initialize-at-run-time=io.fabric8.kubernetes.client.internal.CertUtils,\ --initialize-at-run-time=io.fabric8.kubernetes.client.internal.CertUtils,\
--report-unsupported-elements-at-runtime --report-unsupported-elements-at-runtime
\ No newline at end of file
...@@ -22,7 +22,7 @@ loadTypes: ...@@ -22,7 +22,7 @@ loadTypes:
container: "workload-generator" container: "workload-generator"
variableName: "NUM_SENSORS" variableName: "NUM_SENSORS"
kafkaConfig: kafkaConfig:
bootstrapServer: "localhost:31290" bootstrapServer: "my-confluent-cp-kafka:9092"
topics: topics:
- name: "input" - name: "input"
numPartitions: 40 numPartitions: 40
......
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