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

Merge branch 'theodolite-kotlin' of git.se.informatik.uni-kiel.de:she/spesb...

Merge branch 'theodolite-kotlin' of git.se.informatik.uni-kiel.de:she/spesb into feature/214-add-yaml-docs
parents ad49e7dd a10e11de
No related branches found
No related tags found
4 merge requests!159Re-implementation of Theodolite with Kotlin/Quarkus,!157Update Graal Image in CI pipeline,!125Add dokumentation for benchmark and execution,!83WIP: Re-implementation of Theodolite with Kotlin/Quarkus
Showing
with 30 additions and 23 deletions
...@@ -7,7 +7,8 @@ import kotlin.math.pow ...@@ -7,7 +7,8 @@ import kotlin.math.pow
private const val NUM_SENSORS = 4.0 private const val NUM_SENSORS = 4.0
private const val LOAD_GEN_MAX_RECORDS = 150000 private const val LOAD_GEN_MAX_RECORDS = 150000
class NumNestedGroupsLoadGeneratorReplicaPatcher(private val k8sResource: KubernetesResource) : AbstractPatcher(k8sResource) { class NumNestedGroupsLoadGeneratorReplicaPatcher(private val k8sResource: KubernetesResource) :
AbstractPatcher(k8sResource) {
override fun <String> patch(value: String) { override fun <String> patch(value: String) {
if (k8sResource is Deployment) { if (k8sResource is Deployment) {
if (value is kotlin.String) { if (value is kotlin.String) {
......
...@@ -5,7 +5,8 @@ import io.fabric8.kubernetes.api.model.apps.Deployment ...@@ -5,7 +5,8 @@ import io.fabric8.kubernetes.api.model.apps.Deployment
private const val LOAD_GEN_MAX_RECORDS = 150000 private const val LOAD_GEN_MAX_RECORDS = 150000
class NumSensorsLoadGeneratorReplicaPatcher(private val k8sResource: KubernetesResource) : AbstractPatcher(k8sResource) { class NumSensorsLoadGeneratorReplicaPatcher(private val k8sResource: KubernetesResource) :
AbstractPatcher(k8sResource) {
override fun <String> patch(value: String) { override fun <String> patch(value: String) {
if (k8sResource is Deployment) { if (k8sResource is Deployment) {
if (value is kotlin.String) { if (value is kotlin.String) {
......
...@@ -6,7 +6,6 @@ import io.fabric8.kubernetes.api.model.Quantity ...@@ -6,7 +6,6 @@ import io.fabric8.kubernetes.api.model.Quantity
import io.fabric8.kubernetes.api.model.ResourceRequirements import io.fabric8.kubernetes.api.model.ResourceRequirements
import io.fabric8.kubernetes.api.model.apps.Deployment import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.api.model.apps.StatefulSet import io.fabric8.kubernetes.api.model.apps.StatefulSet
import java.lang.IllegalArgumentException
/** /**
* The Resource limit [Patcher] set resource limits for deployments and statefulSets. * The Resource limit [Patcher] set resource limits for deployments and statefulSets.
......
...@@ -6,7 +6,6 @@ import io.fabric8.kubernetes.api.model.Quantity ...@@ -6,7 +6,6 @@ import io.fabric8.kubernetes.api.model.Quantity
import io.fabric8.kubernetes.api.model.ResourceRequirements import io.fabric8.kubernetes.api.model.ResourceRequirements
import io.fabric8.kubernetes.api.model.apps.Deployment import io.fabric8.kubernetes.api.model.apps.Deployment
import io.fabric8.kubernetes.api.model.apps.StatefulSet import io.fabric8.kubernetes.api.model.apps.StatefulSet
import java.lang.IllegalArgumentException
/** /**
* The Resource request [Patcher] set resource limits for deployments and statefulSets. * The Resource request [Patcher] set resource limits for deployments and statefulSets.
......
...@@ -4,8 +4,8 @@ import io.fabric8.kubernetes.api.model.KubernetesResource ...@@ -4,8 +4,8 @@ import io.fabric8.kubernetes.api.model.KubernetesResource
import io.fabric8.kubernetes.api.model.apps.Deployment import io.fabric8.kubernetes.api.model.apps.Deployment
/** /**
* The Scheduler name [Patcher] make it possible to set the scheduler which should be used to deploy the given deployment. * The Scheduler name [Patcher] make it possible to set the scheduler which should
* * be used to deploy the given deployment.
* @param k8sResource Kubernetes resource to be patched. * @param k8sResource Kubernetes resource to be patched.
*/ */
class SchedulerNamePatcher(private val k8sResource: KubernetesResource) : Patcher { class SchedulerNamePatcher(private val k8sResource: KubernetesResource) : Patcher {
......
...@@ -10,7 +10,7 @@ import theodolite.util.Resource ...@@ -10,7 +10,7 @@ import theodolite.util.Resource
* Composite strategy that combines a SearchStrategy and a set of RestrictionStrategy. * Composite strategy that combines a SearchStrategy and a set of RestrictionStrategy.
* *
* @param searchStrategy the [SearchStrategy] that is executed as part of this [CompositeStrategy]. * @param searchStrategy the [SearchStrategy] that is executed as part of this [CompositeStrategy].
* @param restrictionStrategies the set of [RestrictionStrategy] that are connected conjuntively to restrict the [Resource] * @param restrictionStrategies the set of [RestrictionStrategy] that are connected conjunctive to restrict the [Resource]
* @param benchmarkExecutor Benchmark executor which runs the individual benchmarks. * @param benchmarkExecutor Benchmark executor which runs the individual benchmarks.
*/ */
@RegisterForReflection @RegisterForReflection
......
...@@ -18,7 +18,7 @@ private val logger = KotlinLogging.logger {} ...@@ -18,7 +18,7 @@ private val logger = KotlinLogging.logger {}
class FullSearch(benchmarkExecutor: BenchmarkExecutor) : SearchStrategy(benchmarkExecutor) { class FullSearch(benchmarkExecutor: BenchmarkExecutor) : SearchStrategy(benchmarkExecutor) {
override fun findSuitableResource(load: LoadDimension, resources: List<Resource>): Resource? { override fun findSuitableResource(load: LoadDimension, resources: List<Resource>): Resource? {
var minimalSuitableResources: Resource? = null; var minimalSuitableResources: Resource? = null
for (res in resources) { for (res in resources) {
logger.info { "Running experiment with load '${load.get()}' and resources '${res.get()}'" } logger.info { "Running experiment with load '${load.get()}' and resources '${res.get()}'" }
val result = this.benchmarkExecutor.runExperiment(load, res) val result = this.benchmarkExecutor.runExperiment(load, res)
......
...@@ -2,7 +2,7 @@ package theodolite.util ...@@ -2,7 +2,7 @@ package theodolite.util
import com.fasterxml.jackson.databind.annotation.JsonDeserialize import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import io.quarkus.runtime.annotations.RegisterForReflection import io.quarkus.runtime.annotations.RegisterForReflection
import org.apache.kafka.clients.admin.NewTopic import theodolite.util.KafkaConfig.TopicWrapper
import kotlin.properties.Delegates import kotlin.properties.Delegates
import kotlin.reflect.KProperty import kotlin.reflect.KProperty
...@@ -60,6 +60,7 @@ class DelegatesFalse { ...@@ -60,6 +60,7 @@ class DelegatesFalse {
operator fun getValue(thisRef: Any?, property: KProperty<*>): Boolean { operator fun getValue(thisRef: Any?, property: KProperty<*>): Boolean {
return state return state
} }
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Boolean) { operator fun setValue(thisRef: Any?, property: KProperty<*>, value: Boolean) {
state = value state = value
} }
......
...@@ -22,6 +22,7 @@ execution: ...@@ -22,6 +22,7 @@ execution:
strategy: "LinearSearch" strategy: "LinearSearch"
duration: 60 duration: 60
repetitions: 1 repetitions: 1
delay: 30 # in seconds
restrictions: restrictions:
- "LowerBound" - "LowerBound"
configOverrides: configOverrides:
......
...@@ -31,7 +31,7 @@ class CompositeStrategyTest { ...@@ -31,7 +31,7 @@ class CompositeStrategyTest {
val results = Results() val results = Results()
val benchmark = TestBenchmark() val benchmark = TestBenchmark()
val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo() val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo()
val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker, 0) val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker, 0, 0)
val linearSearch = LinearSearch(benchmarkExecutor) val linearSearch = LinearSearch(benchmarkExecutor)
val lowerBoundRestriction = LowerBoundRestriction(results) val lowerBoundRestriction = LowerBoundRestriction(results)
val strategy = val strategy =
...@@ -65,7 +65,7 @@ class CompositeStrategyTest { ...@@ -65,7 +65,7 @@ class CompositeStrategyTest {
val benchmark = TestBenchmark() val benchmark = TestBenchmark()
val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo() val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo()
val benchmarkExecutorImpl = val benchmarkExecutorImpl =
TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker, 0) TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker, 0, 0)
val binarySearch = BinarySearch(benchmarkExecutorImpl) val binarySearch = BinarySearch(benchmarkExecutorImpl)
val lowerBoundRestriction = LowerBoundRestriction(results) val lowerBoundRestriction = LowerBoundRestriction(results)
val strategy = val strategy =
...@@ -98,7 +98,7 @@ class CompositeStrategyTest { ...@@ -98,7 +98,7 @@ class CompositeStrategyTest {
val results = Results() val results = Results()
val benchmark = TestBenchmark() val benchmark = TestBenchmark()
val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo() val sloChecker: BenchmarkExecution.Slo = BenchmarkExecution.Slo()
val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker, 0) val benchmarkExecutor = TestBenchmarkExecutorImpl(mockResults, benchmark, results, sloChecker, 0, 0)
val binarySearch = BinarySearch(benchmarkExecutor) val binarySearch = BinarySearch(benchmarkExecutor)
val lowerBoundRestriction = LowerBoundRestriction(results) val lowerBoundRestriction = LowerBoundRestriction(results)
val strategy = val strategy =
......
...@@ -11,7 +11,8 @@ class TestBenchmark : Benchmark { ...@@ -11,7 +11,8 @@ class TestBenchmark : Benchmark {
override fun buildDeployment( override fun buildDeployment(
load: LoadDimension, load: LoadDimension,
res: Resource, res: Resource,
configurationOverrides: List<ConfigurationOverride?> configurationOverrides: List<ConfigurationOverride?>,
loadGenerationDelay: Long
): BenchmarkDeployment { ): BenchmarkDeployment {
return TestBenchmarkDeployment() return TestBenchmarkDeployment()
} }
......
...@@ -13,7 +13,8 @@ class TestBenchmarkExecutorImpl( ...@@ -13,7 +13,8 @@ class TestBenchmarkExecutorImpl(
benchmark: Benchmark, benchmark: Benchmark,
results: Results, results: Results,
slo: BenchmarkExecution.Slo, slo: BenchmarkExecution.Slo,
executionId: Int executionId: Int,
loadGenerationDelay: Long
) : ) :
BenchmarkExecutor( BenchmarkExecutor(
benchmark, benchmark,
...@@ -21,7 +22,8 @@ class TestBenchmarkExecutorImpl( ...@@ -21,7 +22,8 @@ class TestBenchmarkExecutorImpl(
executionDuration = Duration.ofSeconds(1), executionDuration = Duration.ofSeconds(1),
configurationOverrides = emptyList(), configurationOverrides = emptyList(),
slo = slo, slo = slo,
executionId = executionId executionId = executionId,
loadGenerationDelay = loadGenerationDelay
) { ) {
override fun runExperiment(load: LoadDimension, res: Resource): Boolean { override fun runExperiment(load: LoadDimension, res: Resource): Boolean {
......
package theodolite.strategies.restriction package theodolite.strategies.restriction
import org.junit.jupiter.api.Assertions.* import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Disabled import org.junit.jupiter.api.Disabled
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
import theodolite.util.LoadDimension import theodolite.util.LoadDimension
...@@ -111,6 +112,7 @@ internal class LowerBoundRestrictionTest { ...@@ -111,6 +112,7 @@ internal class LowerBoundRestrictionTest {
buildLoadDimension(load), buildLoadDimension(load),
buildResourcesDimension(resources) buildResourcesDimension(resources)
), ),
successful) successful
)
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment