Skip to content

Commit

Permalink
Remove UnifiedSchedulingByPool Config Flag (#3402)
Browse files Browse the repository at this point in the history
* remove non-unified pool scheduling

Signed-off-by: Chris Martin <[email protected]>

* put back test

Signed-off-by: Chris Martin <[email protected]>

---------

Signed-off-by: Chris Martin <[email protected]>
Co-authored-by: Chris Martin <[email protected]>
  • Loading branch information
d80tb7 and d80tb7 authored Feb 16, 2024
1 parent e24d65d commit 355d15c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 36 deletions.
5 changes: 1 addition & 4 deletions internal/armada/configuration/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,7 @@ type SchedulingConfig struct {
DisableScheduling bool
// Set to true to enable scheduler assertions. This results in some performance loss.
EnableAssertions bool
// If true, schedule jobs across all executors in the same pool in a unified manner.
// Otherwise, schedule each executor separately.
UnifiedSchedulingByPool bool
Preemption PreemptionConfig
Preemption PreemptionConfig
// Number of jobs to load from the database at a time.
MaxQueueLookback uint
// In each invocation of the scheduler, no more jobs are scheduled once this limit has been exceeded.
Expand Down
21 changes: 6 additions & 15 deletions internal/scheduler/scheduling_algo.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,21 +200,12 @@ func (l *FairSchedulingAlgo) Schedule(
}

func (l *FairSchedulingAlgo) groupExecutors(executors []*schedulerobjects.Executor) map[string][]*schedulerobjects.Executor {
if l.schedulingConfig.UnifiedSchedulingByPool {
return armadaslices.GroupByFunc(
executors,
func(executor *schedulerobjects.Executor) string {
return executor.Pool
},
)
} else {
return armadaslices.GroupByFunc(
executors,
func(executor *schedulerobjects.Executor) string {
return executor.Id
},
)
}
return armadaslices.GroupByFunc(
executors,
func(executor *schedulerobjects.Executor) string {
return executor.Pool
},
)
}

type JobQueueIteratorAdapter struct {
Expand Down
14 changes: 2 additions & 12 deletions internal/scheduler/scheduling_algo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,8 @@ func TestSchedule(t *testing.T) {
},
expectedScheduledIndices: []int{0},
},
"UnifiedSchedulingByPool": {
schedulingConfig: testfixtures.WithUnifiedSchedulingByPoolConfig(testfixtures.TestSchedulingConfig()),
executors: []*schedulerobjects.Executor{
testfixtures.Test1Node32CoreExecutor("executor1"),
testfixtures.Test1Node32CoreExecutor("executor2"),
},
queues: []*database.Queue{testfixtures.TestDbQueue()},
queuedJobs: testfixtures.N16Cpu128GiJobs(testfixtures.TestQueue, testfixtures.PriorityClass3, 10),
expectedScheduledIndices: []int{0, 1, 2, 3},
},
"UnifiedSchedulingByPool schedule gang job over multiple executors": {
schedulingConfig: testfixtures.WithUnifiedSchedulingByPoolConfig(testfixtures.TestSchedulingConfig()),
"Schedule gang job over multiple executors": {
schedulingConfig: testfixtures.TestSchedulingConfig(),
executors: []*schedulerobjects.Executor{
testfixtures.Test1Node32CoreExecutor("executor1"),
testfixtures.Test1Node32CoreExecutor("executor2"),
Expand Down
5 changes: 0 additions & 5 deletions internal/scheduler/testfixtures/testfixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,6 @@ func TestSchedulingConfig() configuration.SchedulingConfig {
}
}

func WithUnifiedSchedulingByPoolConfig(config configuration.SchedulingConfig) configuration.SchedulingConfig {
config.UnifiedSchedulingByPool = true
return config
}

func WithMaxUnacknowledgedJobsPerExecutorConfig(v uint, config configuration.SchedulingConfig) configuration.SchedulingConfig {
config.MaxUnacknowledgedJobsPerExecutor = v
return config
Expand Down

0 comments on commit 355d15c

Please sign in to comment.