diff options
Diffstat (limited to 'opendc-experiments/opendc-experiments-base')
4 files changed, 13 insertions, 39 deletions
diff --git a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/ExperimentSpec.kt b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/ExperimentSpec.kt index 71ab4002..e3497cc4 100644 --- a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/ExperimentSpec.kt +++ b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/ExperimentSpec.kt @@ -40,6 +40,11 @@ import java.util.UUID * @property initialSeed * @property runs * be included in the output files. + * + * The allocation policy is hardcoded here regardless of the input in experiemnt.json. + * I did not design this, it was like that before. + * + * @author Mateusz Kwiatkowski */ @Serializable @@ -50,7 +55,7 @@ public data class ExperimentSpec( val runs: Int = 1, val topologies: Set<ScenarioTopologySpec>, val workloads: Set<WorkloadSpec>, - val allocationPolicies: Set<AllocationPolicySpec> = setOf(PrefabAllocationPolicySpec(ComputeSchedulerEnum.Mem)), + val allocationPolicies: Set<AllocationPolicySpec> = setOf(PrefabAllocationPolicySpec(ComputeSchedulerEnum.Smart)), val failureModels: Set<FailureModelSpec?> = setOf(null), val maxNumFailures: Set<Int> = setOf(10), val checkpointModels: Set<CheckpointModelSpec?> = setOf(null), diff --git a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/allocation/AllocationPolicySpec.kt b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/allocation/AllocationPolicySpec.kt index afe15032..3972b53f 100644 --- a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/allocation/AllocationPolicySpec.kt +++ b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/allocation/AllocationPolicySpec.kt @@ -41,10 +41,14 @@ import kotlin.coroutines.CoroutineContext @Serializable public sealed interface AllocationPolicySpec +/* This has to be changed in order to enforce the scheduler policy to Smart. + * + * @author: Mateusz Kwiatkowski + */ @Serializable @SerialName("prefab") public data class PrefabAllocationPolicySpec( - val policyName: ComputeSchedulerEnum = ComputeSchedulerEnum.Mem, + val policyName: ComputeSchedulerEnum = ComputeSchedulerEnum.Smart, ) : AllocationPolicySpec { public val name: String = policyName.toString() } diff --git a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentCli.kt b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentCli.kt index 55aed21b..df62924b 100644 --- a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentCli.kt +++ b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentCli.kt @@ -37,8 +37,7 @@ import java.io.IOException * Main entrypoint of the application. */ public fun main(args: Array<String>) { - if(args.size == 2) ExperimentCommand().main(args) - else ExperimentListener().main(args) + ExperimentCommand().main(args) } internal class ExperimentCommand : CliktCommand(name = "experiment") { @@ -49,24 +48,10 @@ internal class ExperimentCommand : CliktCommand(name = "experiment") { override fun run() { try { val experiment = getExperiment(experimentPath) - //HTTPClient.getInstance()?.sendExperiment(experimentPath) + HTTPClient.getInstance()?.sendExperiment(experimentPath) runExperiment(experiment) } catch (e: IOException) { println("${e.message}") } } } -/** - * Entry point to the digital twin. - * - * @author Mateusz Kwiatkowski - */ -internal class ExperimentListener: CliktCommand(name = "listener") { - override fun run() { - try { - runListener() - } catch (e: IOException) { - println("${e.message}") - } - } -} diff --git a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentListener.kt b/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentListener.kt deleted file mode 100644 index c221543d..00000000 --- a/opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentListener.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.opendc.experiments.base.runner - -import org.opendc.common.utils.JavalinRunner -import org.opendc.common.utils.PostgresqlDB -import org.opendc.common.utils.Redis - -/** - * Established a connection with PostgreSQL. - * Creates a Javalin HTTP server and listens for requests. - * - * @author Mateusz Kwiatkowski - * - * @see <a href=https://javalin.io/documentation>https://javalin.io/documentation</a> - */ -public fun runListener() { - PostgresqlDB() - val redisClient = Redis.getInstance() - redisClient?.readOne() - JavalinRunner() -} |
