summaryrefslogtreecommitdiff
path: root/opendc-experiments
diff options
context:
space:
mode:
authormjkwiatkowski <mati.rewa@gmail.com>2026-06-18 23:38:00 +0200
committermjkwiatkowski <mati.rewa@gmail.com>2026-06-18 23:38:00 +0200
commit54f94861da743cbd72d9755c2fbe4223176d90f4 (patch)
treea4c2eddb01662e00a1c17514e9fb1218e8515efc /opendc-experiments
parent4562f52c9b540944200b33d4ffbd60b3cbc5ee79 (diff)
feat: complete system redesign: KafkaComputeMonitor stays, SmartScheduler is working and only HTTPClient remains, the rest will be moved to Python scriptsHEADmaster
Diffstat (limited to 'opendc-experiments')
-rw-r--r--opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/ExperimentSpec.kt7
-rw-r--r--opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/experiment/specs/allocation/AllocationPolicySpec.kt6
-rw-r--r--opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentCli.kt17
-rw-r--r--opendc-experiments/opendc-experiments-base/src/main/kotlin/org/opendc/experiments/base/runner/ExperimentListener.kt20
4 files changed, 12 insertions, 38 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..0e190df0 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") {
@@ -56,17 +55,3 @@ internal class ExperimentCommand : CliktCommand(name = "experiment") {
}
}
}
-/**
- * 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()
-}