Skip to content

Commit

Permalink
wip (#3454)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Martin <[email protected]>
Co-authored-by: Chris Martin <[email protected]>
  • Loading branch information
d80tb7 and d80tb7 authored Mar 12, 2024
1 parent 267aa14 commit 721a060
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
6 changes: 1 addition & 5 deletions internal/scheduler/scheduling_algo.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,7 @@ func (l *FairSchedulingAlgo) newFairSchedulingAlgoContext(ctx *armadacontext.Con
}
priorityFactorByQueue := make(map[string]float64)
for _, queue := range queues {
weight := 0.0
if queue.PriorityFactor != 0 {
weight = 1 / float64(queue.PriorityFactor)
}
priorityFactorByQueue[queue.Name] = weight
priorityFactorByQueue[queue.Name] = float64(queue.PriorityFactor)
}

// Get the total capacity available across executors.
Expand Down
22 changes: 22 additions & 0 deletions internal/scheduler/scheduling_algo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,28 @@ func TestSchedule(t *testing.T) {
queuedJobs: testfixtures.N16Cpu128GiJobs(testfixtures.TestQueue, testfixtures.PriorityClass3, 10),
expectedScheduledIndices: []int{0, 1, 2, 3},
},
"Fair share": {
schedulingConfig: testfixtures.TestSchedulingConfig(),
executors: []*schedulerobjects.Executor{
testfixtures.Test1Node32CoreExecutor("executor1"),
testfixtures.Test1Node32CoreExecutor("executor2"),
},
queues: []queue.Queue{
{
Name: "testQueueA",
PriorityFactor: 100,
},
{
Name: "testQueueB",
PriorityFactor: 300,
},
},
queuedJobs: append(
testfixtures.N16Cpu128GiJobs("testQueueA", testfixtures.PriorityClass3, 10),
testfixtures.N16Cpu128GiJobs("testQueueB", testfixtures.PriorityClass3, 10)...,
),
expectedScheduledIndices: []int{0, 1, 2, 10},
},
"do not schedule onto stale executors": {
schedulingConfig: testfixtures.TestSchedulingConfig(),
executors: []*schedulerobjects.Executor{
Expand Down
2 changes: 1 addition & 1 deletion internal/scheduler/testfixtures/testfixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ func Test1Node32CoreExecutor(executorId string) *schedulerobjects.Executor {
func MakeTestQueue() queue.Queue {
return queue.Queue{
Name: TestQueue,
PriorityFactor: 0.01,
PriorityFactor: 100,
}
}

Expand Down

0 comments on commit 721a060

Please sign in to comment.