-
Notifications
You must be signed in to change notification settings - Fork 924
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
priority scheduling: add priority queue #6149
base: master
Are you sure you want to change the base?
priority scheduling: add priority queue #6149
Conversation
@whitewindmills: GitHub didn't allow me to request PR reviews from the following users: wengyao04, zclyne, LeonZh0u. Note that only karmada-io members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
7ef5e18
to
3199c80
Compare
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.
/assign
@whitewindmills Can you take care of the failing tests?
yeah, I'm working on it. |
3199c80
to
e5d5e1a
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
4594093
to
140f5b5
Compare
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #6149 +/- ##
==========================================
- Coverage 48.10% 47.98% -0.13%
==========================================
Files 668 674 +6
Lines 55316 55760 +444
==========================================
+ Hits 26611 26757 +146
- Misses 26970 27259 +289
- Partials 1735 1744 +9
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: whitewindmills <[email protected]>
140f5b5
to
c04fcd6
Compare
ready to review. |
Shall we have a quick chat at today's community meeting? |
@RainbowMango |
// ExplicitPriority returns the explicit priority declared | ||
// by '.spec.SchedulePriority.Priority'. | ||
func (s *ResourceBindingSpec) ExplicitPriority() int32 { | ||
if s.SchedulePriority == nil { | ||
return 0 | ||
} | ||
return s.SchedulePriority.Priority | ||
} |
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.
// ExplicitPriority returns the explicit priority declared | |
// by '.spec.SchedulePriority.Priority'. | |
func (s *ResourceBindingSpec) ExplicitPriority() int32 { | |
if s.SchedulePriority == nil { | |
return 0 | |
} | |
return s.SchedulePriority.Priority | |
} | |
// SchedulePriorityValue returns the scheduling priority declared | |
// by '.spec.SchedulePriority.Priority'. | |
func (s *ResourceBindingSpec) SchedulePriorityValue() int32 { | |
if s.SchedulePriority == nil { | |
return 0 | |
} | |
return s.SchedulePriority.Priority | |
} |
Given that ResourceBinding may introduce another priority other than the schedule aspect, I'd like to give it a more straightforward name.
@@ -239,7 +238,7 @@ func NewScheduler(dynamicClient dynamic.Interface, karmadaClient karmadaclientse | |||
for _, opt := range opts { | |||
opt(&options) | |||
} | |||
queue := workqueue.NewTypedRateLimitingQueueWithConfig(ratelimiterflag.DefaultControllerRateLimiter[any](options.RateLimiterOptions), workqueue.TypedRateLimitingQueueConfig[any]{Name: "scheduler-queue"}) | |||
queue := internalqueue.NewSchedulingQueue(internalqueue.WithRateLimitingOptions(options.RateLimiterOptions)) |
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.
Can we use the legacy queue if the feature gate is disabled?
if !features.FeatureGate.Enabled(features.PriorityBasedScheduling) { | ||
return &rateLimitingSchedulingQueue{ | ||
delegate: workqueue.NewTypedRateLimitingQueueWithConfig(ratelimiterflag.DefaultControllerRateLimiter[*QueuedBindingInfo](options.rateLimitingOptions), | ||
workqueue.TypedRateLimitingQueueConfig[*QueuedBindingInfo]{Name: "scheduler-queue"}), |
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.
@RainbowMango we use the legacy queue here if the feature gate is disabled
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
part of #5961
Special notes for your reviewer:
Does this PR introduce a user-facing change?: