diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2021-04-08 20:46:39 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-08 20:46:39 +0200 |
| commit | 3820ac4d31d6eb04034b85a1b53667d64ce6ba89 (patch) | |
| tree | a7506b631770d6032eddc5a8252931b03c6e1796 /simulator/opendc-workflow/opendc-workflow-service/src | |
| parent | 5fdbfbe7d340bc10f8b9eebd5aa23bdfd7dc4e18 (diff) | |
| parent | 4f80e79b567b7d91b1086dcd74ef35616d7177f2 (diff) | |
compute: Implement filter scheduler
This pull request implements the filter scheduler modeled after the scheduler
from [OpenStack](https://docs.openstack.org/nova/latest/user/filter-scheduler.html).
The scheduler is functionally equivalent to the old allocation policies, but is more
flexible and allows policies to be combined.
* A new interface, `ComputeScheduler` is introduced, which is used by the
`ComputeServiceImpl` to pick hosts to schedule on.
* `FilterScheduler` is implemented, which works by filtering and weighing the available hosts.
**Breaking API Changes**
* Removal of the `AllocationPolicy` interface and its implementations.
Users should migrate to the filter scheduler which offers the same functionality and more.
Diffstat (limited to 'simulator/opendc-workflow/opendc-workflow-service/src')
| -rw-r--r-- | simulator/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceIntegrationTest.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/simulator/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceIntegrationTest.kt b/simulator/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceIntegrationTest.kt index 46c0d835..be59c8d2 100644 --- a/simulator/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceIntegrationTest.kt +++ b/simulator/opendc-workflow/opendc-workflow-service/src/test/kotlin/org/opendc/workflow/service/WorkflowServiceIntegrationTest.kt @@ -35,7 +35,10 @@ import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertAll import org.opendc.compute.service.ComputeService -import org.opendc.compute.service.scheduler.NumberOfActiveServersAllocationPolicy +import org.opendc.compute.service.scheduler.FilterScheduler +import org.opendc.compute.service.scheduler.filters.ComputeCapabilitiesFilter +import org.opendc.compute.service.scheduler.filters.ComputeFilter +import org.opendc.compute.service.scheduler.weights.ProvisionedCoresWeigher import org.opendc.compute.simulator.SimHost import org.opendc.format.environment.sc18.Sc18EnvironmentReader import org.opendc.format.trace.gwf.GwfTraceReader @@ -84,7 +87,11 @@ internal class WorkflowServiceIntegrationTest { } val meter = MeterProvider.noop().get("opendc-compute") - val compute = ComputeService(coroutineContext, clock, meter, NumberOfActiveServersAllocationPolicy(), schedulingQuantum = 1000) + val computeScheduler = FilterScheduler( + filters = listOf(ComputeFilter(), ComputeCapabilitiesFilter()), + weighers = listOf(ProvisionedCoresWeigher() to -1.0) + ) + val compute = ComputeService(coroutineContext, clock, meter, computeScheduler, schedulingQuantum = 1000) hosts.forEach { compute.addHost(it) } |
