From a71d4885efcf01850bc236d3e9f77ab3f44b48aa Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Fri, 8 Jan 2021 18:18:43 +0100 Subject: Convert to pull-based workload model This change converts the low-level workload model to be pull-based. This reduces the overhead that we experienced with our previous co-routine based approach. --- .../main/kotlin/org/opendc/workflows/service/StageWorkflowService.kt | 2 +- .../opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'simulator/opendc-workflows') diff --git a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/StageWorkflowService.kt b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/StageWorkflowService.kt index 2c8d9a0b..e04c8a4c 100644 --- a/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/StageWorkflowService.kt +++ b/simulator/opendc-workflows/src/main/kotlin/org/opendc/workflows/service/StageWorkflowService.kt @@ -340,7 +340,7 @@ public class StageWorkflowService( } } - private suspend fun finishJob(job: JobState) { + private fun finishJob(job: JobState) { activeJobs -= job tracer.commit(WorkflowEvent.JobFinished(this, job.job)) rootListener.jobFinished(job) diff --git a/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt b/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt index b97cb915..8727ea2e 100644 --- a/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt +++ b/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt @@ -59,7 +59,7 @@ internal class StageWorkflowSchedulerIntegrationTest { * A large integration test where we check whether all tasks in some trace are executed correctly. */ @Test - fun `should execute all tasks in trace`() { + fun testTrace() { var jobsSubmitted = 0L var jobsStarted = 0L var jobsFinished = 0L -- cgit v1.2.3 From 9dbb7bbcc2202955c715aaa3b28c70641a2fbd5b Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 11 Jan 2021 16:33:15 +0100 Subject: Add support for hypervisor selection This change allows users to select the hypervisor scheduler to use when deploying hypervisors onto bare-metal machines. --- simulator/opendc-workflows/build.gradle.kts | 1 + .../opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'simulator/opendc-workflows') diff --git a/simulator/opendc-workflows/build.gradle.kts b/simulator/opendc-workflows/build.gradle.kts index 4346efcc..e9c85de5 100644 --- a/simulator/opendc-workflows/build.gradle.kts +++ b/simulator/opendc-workflows/build.gradle.kts @@ -41,6 +41,7 @@ dependencies { exclude("org.jetbrains.kotlin", module = "kotlin-reflect") } testImplementation(kotlin("reflect")) + testRuntimeOnly("org.slf4j:slf4j-simple:${Library.SLF4J}") testImplementation("org.junit.jupiter:junit-jupiter-api:${Library.JUNIT_JUPITER}") testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${Library.JUNIT_JUPITER}") testImplementation("org.junit.platform:junit-platform-launcher:${Library.JUNIT_PLATFORM}") diff --git a/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt b/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt index 8727ea2e..2bfcba35 100644 --- a/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt +++ b/simulator/opendc-workflows/src/test/kotlin/org/opendc/workflows/service/StageWorkflowSchedulerIntegrationTest.kt @@ -41,6 +41,7 @@ import org.opendc.compute.simulator.SimVirtProvisioningService import org.opendc.compute.simulator.allocation.NumberOfActiveServersAllocationPolicy import org.opendc.format.environment.sc18.Sc18EnvironmentReader import org.opendc.format.trace.gwf.GwfTraceReader +import org.opendc.simulator.compute.SimSpaceSharedHypervisorProvider import org.opendc.simulator.utils.DelayControllerClockAdapter import org.opendc.trace.core.EventTracer import org.opendc.workflows.service.stage.job.NullJobAdmissionPolicy @@ -79,7 +80,7 @@ internal class StageWorkflowSchedulerIntegrationTest { // Wait for the bare metal nodes to be spawned delay(10) - val provisioner = SimVirtProvisioningService(testScope, clock, bareMetal, NumberOfActiveServersAllocationPolicy(), tracer, schedulingQuantum = 1000) + val provisioner = SimVirtProvisioningService(testScope, clock, bareMetal, NumberOfActiveServersAllocationPolicy(), tracer, SimSpaceSharedHypervisorProvider(), schedulingQuantum = 1000) // Wait for the hypervisors to be spawned delay(10) -- cgit v1.2.3