-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scheduler: move more to internaltypes.ResourceList #4036
Conversation
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
@@ -182,10 +182,6 @@ type FairSchedulingAlgoContext struct { | |||
Txn *jobdb.Txn | |||
} | |||
|
|||
func (l *FairSchedulingAlgo) NewFairSchedulingAlgoContext(ctx *armadacontext.Context, txn *jobdb.Txn, pool configuration.PoolConfig) (*FairSchedulingAlgoContext, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method NewFairSchedulingAlgoContext
is unused
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
… sched-more-it-rl
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
@@ -266,17 +304,6 @@ func (rl ResourceList) Negate() ResourceList { | |||
return ResourceList{factory: rl.factory, resources: result} | |||
} | |||
|
|||
func (rl ResourceList) Scale(factor float64) ResourceList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scale()
is unused
@@ -389,98 +373,18 @@ func makeConstraintsTest(constraints SchedulingConstraints) *constraintTest { | |||
} | |||
} | |||
|
|||
func TestIsStrictlyLessOrEqual(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
method IsStrictlyLessOrEqual
has been deleted
AllocatedByPriorityClass schedulerobjects.QuantityByTAndResourceType[string] | ||
// Total away resources assigned to the queue across all clusters by priority class. | ||
// Includes away jobs scheduled during this invocation of the scheduler. | ||
AwayAllocatedByPriorityClass schedulerobjects.QuantityByTAndResourceType[string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AwayAllocatedByPriorityClass is unused
return priorityClassConstraint.MaximumResourcesPerQueue | ||
maximumResourceFractionToSchedule := config.MaximumResourceFractionToSchedule | ||
if m, ok := config.MaximumResourceFractionToScheduleByPool[pool]; ok { | ||
// Use pool-specific config is available. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// Use pool-specific config is available. | |
// Use pool-specific config if available. |
@@ -2104,7 +2113,8 @@ func TestPreemptingQueueScheduler(t *testing.T) { | |||
) | |||
} | |||
for queue, qctx := range sctx.QueueSchedulingContexts { | |||
assert.True(t, qctx.AllocatedByPriorityClass.Equal(allocatedByQueueAndPriorityClass[queue])) | |||
m := internaltypes.RlMapFromJobSchedulerObjects(allocatedByQueueAndPriorityClass[queue], testfixtures.TestResourceListFactory) | |||
assert.Equal(t, internaltypes.RlMapRemoveZeros(m), internaltypes.RlMapRemoveZeros(qctx.AllocatedByPriorityClass)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The old schedulerobjects
Equal
methods treat missing and zero as the same. For now, reproduce the old behavior by removing any zero resourcelists from the map
} | ||
return total | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TotalResources is unused
No description provided.