Skip to content
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

Merged
merged 13 commits into from
Nov 8, 2024

Conversation

robertdavidsmith
Copy link
Collaborator

No description provided.

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>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
@robertdavidsmith robertdavidsmith marked this pull request as draft November 7, 2024 16:21
@@ -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) {
Copy link
Collaborator Author

@robertdavidsmith robertdavidsmith Nov 7, 2024

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>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
Signed-off-by: Robert Smith <robertdavidsmith@yahoo.com>
@robertdavidsmith robertdavidsmith marked this pull request as ready for review November 8, 2024 13:57
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 {
Copy link
Collaborator Author

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) {
Copy link
Collaborator Author

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]
Copy link
Collaborator Author

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 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))
Copy link
Collaborator Author

@robertdavidsmith robertdavidsmith Nov 8, 2024

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
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TotalResources is unused

@robertdavidsmith robertdavidsmith merged commit 43f8573 into master Nov 8, 2024
20 checks passed
@robertdavidsmith robertdavidsmith deleted the sched-more-it-rl branch November 8, 2024 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants