Skip to content
Snippets Groups Projects
Commit b37a85a8 authored by Simon Ehrenstein's avatar Simon Ehrenstein
Browse files

Add @RegisterForReflection annotation for compatibility with native images

parent d4ead8a5
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!108Feature/185 Make Paths Configurable,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Showing
with 34 additions and 3 deletions
......@@ -2,4 +2,5 @@
!build/*-runner
!build/*-runner.jar
!build/lib/*
!build/quarkus-app/*
\ No newline at end of file
!build/quarkus-app/*
!config/*
\ No newline at end of file
......@@ -20,6 +20,7 @@ RUN chown 1001 /work \
&& chmod "g+rwX" /work \
&& chown 1001:root /work
COPY --chown=1001:root build/*-runner /work/application
COPY config/ /work/config/
EXPOSE 8080
USER 1001
......
package theodolite.benchmark
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.util.ConfigurationOverride
import theodolite.util.LoadDimension
import theodolite.util.Resource
@RegisterForReflection
interface Benchmark {
fun buildDeployment(
load: LoadDimension,
......
package theodolite.benchmark
import io.quarkus.runtime.annotations.RegisterForReflection
import theodolite.util.ConfigurationOverride
import kotlin.properties.Delegates
@RegisterForReflection
class BenchmarkExecution {
lateinit var name: String
lateinit var benchmark: String
......@@ -12,6 +14,7 @@ class BenchmarkExecution {
lateinit var execution: Execution
lateinit var configOverrides: List<ConfigurationOverride>
@RegisterForReflection
class Execution {
lateinit var strategy: String
var duration by Delegates.notNull<Long>()
......@@ -19,6 +22,7 @@ class BenchmarkExecution {
lateinit var restrictions: List<String>
}
@RegisterForReflection
class Slo {
lateinit var sloType: String
var threshold by Delegates.notNull<Int>()
......@@ -28,11 +32,13 @@ class BenchmarkExecution {
var warmup by Delegates.notNull<Int>()
}
@RegisterForReflection
class LoadDefinition {
lateinit var loadType: String
lateinit var loadValues: List<Int>
}
@RegisterForReflection
class ResourceDefinition {
lateinit var resourceType: String
lateinit var resourceValues: List<Int>
......
......@@ -2,6 +2,7 @@ package theodolite.benchmark
import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.client.DefaultKubernetesClient
import io.quarkus.runtime.annotations.RegisterForReflection
import mu.KotlinLogging
import theodolite.k8s.K8sResourceLoader
import theodolite.patcher.PatcherManager
......@@ -11,6 +12,7 @@ private val logger = KotlinLogging.logger {}
private var DEFAULT_NAMESPACE = "default"
@RegisterForReflection
class KubernetesBenchmark : Benchmark {
lateinit var name: String
lateinit var appResource: List<String>
......
......@@ -5,6 +5,7 @@ import mu.KotlinLogging
import theodolite.benchmark.BenchmarkExecution
import theodolite.benchmark.KubernetesBenchmark
import theodolite.util.YamlParser
import java.nio.file.Paths
import kotlin.system.exitProcess
private val logger = KotlinLogging.logger {}
......@@ -14,13 +15,17 @@ object TheodoliteYamlExecutor {
@JvmStatic
fun main(args: Array<String>) {
logger.info { "Theodolite started" }
val path = Paths.get("").toAbsolutePath().toString()
logger.info{ path }
// load the BenchmarkExecution and the BenchmarkType
val parser = YamlParser()
val benchmarkExecution =
parser.parse("./../../../resources/main/yaml/BenchmarkExecution.yaml", BenchmarkExecution::class.java)!!
parser.parse("./config/BenchmarkExecution.yaml", BenchmarkExecution::class.java)!!
val benchmark =
parser.parse("./../../../resources/main/yaml/BenchmarkType.yaml", KubernetesBenchmark::class.java)!!
parser.parse("./config/BenchmarkType.yaml", KubernetesBenchmark::class.java)!!
logger.info { benchmark.name.toString() }
val executor = TheodoliteExecutor(benchmarkExecution, benchmark)
executor.run()
......
package theodolite.patcher
import io.quarkus.runtime.annotations.RegisterForReflection
@RegisterForReflection
interface Patcher {
fun <T> patch(value: T)
}
package theodolite.util
import io.quarkus.runtime.annotations.RegisterForReflection
@RegisterForReflection
class ConfigurationOverride {
lateinit var patcher: PatcherDefinition
lateinit var value: String
......
package theodolite.util
import io.quarkus.runtime.annotations.RegisterForReflection
import org.apache.kafka.clients.admin.NewTopic
import kotlin.properties.Delegates
@RegisterForReflection
class KafkaConfig {
lateinit var bootstrapServer: String
lateinit var topics: List<TopicWrapper>
......
package theodolite.util
import io.quarkus.runtime.annotations.RegisterForReflection
@RegisterForReflection
class PatcherDefinition {
lateinit var type: String
lateinit var resource: String
......
package theodolite.util
import io.quarkus.runtime.annotations.RegisterForReflection
@RegisterForReflection
class TypeName {
lateinit var typeName: String
lateinit var patchers: List<PatcherDefinition>
......
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