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: enhance ReservationNominator to support preemption #1804

Merged

Conversation

eahydra
Copy link
Member

@eahydra eahydra commented Dec 28, 2023

Ⅰ. Describe what this PR does

The ReservationNominator interface and its implementation have been enhanced to support preemption scenarios.

When performing preemption at the job granularity level, many Pods will initiate preemption in the PostFilter stage. As each Pod secures resources, the ReservationNominator.NominateReservation method is called to elect a Reservation. The ReservationNominator.AddNominatedReservation and PreFilterExtension.AddPod methods are then used to record the Request quantity. This ensures that the preemption results of one Pod can be perceived by the next Pod during its preemption process.

When a new scheduling cycle begins, there is a possibility that a Pod awaiting scheduling may trigger the PreFilterExtension.AddPod again. Since the AddNominatedReservation method has already recorded that the Pod has reserved resources on a certain node, it ensures that this reserved resource will not be taken by lower-priority Pods.

Ⅱ. Does this pull request fix one issue?

Ⅲ. Describe how to verify it

Ⅳ. Special notes for reviews

V. Checklist

  • I have written necessary docs and comments
  • I have added necessary unit tests and integration tests
  • All checks passed in make test

@eahydra
Copy link
Member Author

eahydra commented Dec 28, 2023

/hold need more testing

Copy link

codecov bot commented Dec 28, 2023

Codecov Report

Attention: 33 lines in your changes are missing coverage. Please review.

Comparison is base (82e71dc) 66.48% compared to head (95a8b5e) 66.50%.
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/scheduler/frameworkext/framework_extender.go 6.66% 13 Missing and 1 partial ⚠️
.../frameworkext/eventhandlers/reservation_handler.go 10.00% 8 Missing and 1 partial ⚠️
pkg/scheduler/plugins/reservation/nominator.go 87.50% 4 Missing and 1 partial ⚠️
...heduler/frameworkext/framework_extender_factory.go 20.00% 4 Missing ⚠️
pkg/scheduler/plugins/reservation/plugin.go 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1804      +/-   ##
==========================================
+ Coverage   66.48%   66.50%   +0.02%     
==========================================
  Files         396      395       -1     
  Lines       43754    43820      +66     
==========================================
+ Hits        29088    29144      +56     
- Misses      12510    12516       +6     
- Partials     2156     2160       +4     
Flag Coverage Δ
unittests 66.50% <69.44%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eahydra eahydra requested review from hormes and removed request for yihuifeng December 28, 2023 16:02
@eahydra eahydra force-pushed the fix_reservation_preemption_s4 branch from fe492c8 to c2c9e49 Compare January 2, 2024 02:44
@eahydra eahydra requested a review from buptcozy January 2, 2024 02:46
@eahydra eahydra force-pushed the fix_reservation_preemption_s4 branch from c2c9e49 to 10bcfb1 Compare January 2, 2024 03:02
@eahydra eahydra force-pushed the fix_reservation_preemption_s4 branch from 10bcfb1 to 03882c7 Compare January 2, 2024 03:12
@eahydra eahydra force-pushed the fix_reservation_preemption_s4 branch from 03882c7 to cb1b22e Compare January 2, 2024 12:13
Signed-off-by: Joseph <joseph.t.lee@outlook.com>
@eahydra eahydra force-pushed the fix_reservation_preemption_s4 branch from cb1b22e to 95a8b5e Compare January 2, 2024 15:08
@eahydra
Copy link
Member Author

eahydra commented Jan 2, 2024

/hold cancel

Copy link
Contributor

@buptcozy buptcozy left a comment

Choose a reason for hiding this comment

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

/lgtm

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: buptcozy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@koordinator-bot koordinator-bot bot merged commit 70df535 into koordinator-sh:main Jan 3, 2024
20 checks passed
ls-2018 pushed a commit to ls-2018/koordinator that referenced this pull request Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants