summaryrefslogtreecommitdiff
path: root/simulator/opendc-experiments/opendc-experiments-sc18
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-07 15:44:36 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-07 16:13:16 +0100
commit9bb91897404bbeac1d5f7a7f890abd3a9d5d9084 (patch)
tree9e492df044306b6230444b73f2c3db59ef45440e /simulator/opendc-experiments/opendc-experiments-sc18
parentdfbca195cbe1d6c4eebe7ccd4cc707c84ac43e79 (diff)
compute: Move ComputeService implementation in service module
This change introduces the ComputeService interface (previously VirtProvisioningService) and provides a central implementation in opendc-compute-service. Previously, the implementation of this interface was bound to the simulator package, which meant that independent business logic could not be re-used without importing the simulator code.
Diffstat (limited to 'simulator/opendc-experiments/opendc-experiments-sc18')
-rw-r--r--simulator/opendc-experiments/opendc-experiments-sc18/src/main/kotlin/org/opendc/experiments/sc18/UnderspecificationExperiment.kt20
1 files changed, 11 insertions, 9 deletions
diff --git a/simulator/opendc-experiments/opendc-experiments-sc18/src/main/kotlin/org/opendc/experiments/sc18/UnderspecificationExperiment.kt b/simulator/opendc-experiments/opendc-experiments-sc18/src/main/kotlin/org/opendc/experiments/sc18/UnderspecificationExperiment.kt
index 6e888a3e..66fdfb41 100644
--- a/simulator/opendc-experiments/opendc-experiments-sc18/src/main/kotlin/org/opendc/experiments/sc18/UnderspecificationExperiment.kt
+++ b/simulator/opendc-experiments/opendc-experiments-sc18/src/main/kotlin/org/opendc/experiments/sc18/UnderspecificationExperiment.kt
@@ -25,8 +25,9 @@ package org.opendc.experiments.sc18
import kotlinx.coroutines.*
import kotlinx.coroutines.test.TestCoroutineScope
import org.opendc.compute.core.metal.service.ProvisioningService
-import org.opendc.compute.simulator.SimVirtProvisioningService
-import org.opendc.compute.simulator.allocation.NumberOfActiveServersAllocationPolicy
+import org.opendc.compute.service.ComputeService
+import org.opendc.compute.service.scheduler.NumberOfActiveServersAllocationPolicy
+import org.opendc.compute.simulator.SimHostProvisioner
import org.opendc.format.environment.sc18.Sc18EnvironmentReader
import org.opendc.format.trace.gwf.GwfTraceReader
import org.opendc.harness.dsl.Experiment
@@ -91,16 +92,17 @@ public class UnderspecificationExperiment : Experiment("underspecification") {
// Wait for the bare metal nodes to be spawned
delay(10)
- val provisioner = SimVirtProvisioningService(
- testScope,
+ val provisioner = SimHostProvisioner(testScope.coroutineContext, bareMetal, SimSpaceSharedHypervisorProvider())
+ val hosts = provisioner.provisionAll()
+ val compute = ComputeService(
+ testScope.coroutineContext,
clock,
- bareMetal,
- NumberOfActiveServersAllocationPolicy(),
tracer,
- SimSpaceSharedHypervisorProvider(),
- schedulingQuantum = 1000
+ NumberOfActiveServersAllocationPolicy(),
)
+ hosts.forEach { compute.addHost(it) }
+
// Wait for the hypervisors to be spawned
delay(10)
@@ -108,7 +110,7 @@ public class UnderspecificationExperiment : Experiment("underspecification") {
testScope,
clock,
tracer,
- provisioner.newClient(),
+ compute.newClient(),
mode = WorkflowSchedulerMode.Batch(100),
jobAdmissionPolicy = NullJobAdmissionPolicy,
jobOrderPolicy = SubmissionTimeJobOrderPolicy(),