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

koord-scheduler: implement PreBindExtensions to support one-time apply patches #1317

Merged
merged 1 commit into from May 23, 2023

Conversation

eahydra
Copy link
Member

@eahydra eahydra commented May 21, 2023

Ⅰ. Describe what this PR does

Optimize the Patch behavior of the koord-scheduler custom plugins:

  1. Added the DefaultPrebind plugin to initiate a Patch request. The plugin implements the new interface PreBindExtensions.
  2. DefaultPreBind will be added to KubeSchedulerConfig by default. The plugin can be disabled by setting the Disabled parameter, but after disabling, a new plugin implementation of PreBindExtensions needs to be provided.
  3. Custom plugins such as NodeNUMAResources and DeviceShare only modify Pods during PreBind and do not initiate Patch requests.
  4. In this way, multiple Patch requests can be converted into one. And it can support custom implementation of different Patch strategies.

Ⅱ. 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

@codecov
Copy link

codecov bot commented May 21, 2023

Codecov Report

Patch coverage: 60.74% and no project coverage change.

Comparison is base (9449d56) 64.75% compared to head (d817eeb) 64.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1317   +/-   ##
=======================================
  Coverage   64.75%   64.75%           
=======================================
  Files         319      322    +3     
  Lines       33244    33306   +62     
=======================================
+ Hits        21527    21568   +41     
- Misses      10145    10174   +29     
+ Partials     1572     1564    -8     
Flag Coverage Δ
unittests 64.75% <60.74%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
pkg/scheduler/frameworkext/interface.go 83.33% <ø> (ø)
pkg/util/utils.go 28.73% <ø> (-25.96%) ⬇️
pkg/scheduler/plugins/defaultprebind/plugin.go 40.42% <40.42%> (ø)
pkg/scheduler/plugins/deviceshare/plugin.go 66.86% <50.00%> (+<0.01%) ⬆️
pkg/scheduler/frameworkext/framework_extender.go 66.29% <74.19%> (+0.59%) ⬆️
pkg/scheduler/plugins/nodenumaresource/plugin.go 62.16% <75.00%> (-0.18%) ⬇️
...g/scheduler/frameworkext/defaultprofile/profile.go 80.95% <80.95%> (ø)
...uler/controllers/migration/evictor/evictor_soft.go 89.28% <100.00%> (ø)
pkg/scheduler/plugins/reservation/plugin.go 83.05% <100.00%> (+0.91%) ⬆️

... and 6 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eahydra eahydra changed the title koord-scheduler: implemented PreBindExtensions to support one-time apply patches koord-scheduler: implement PreBindExtensions to support one-time apply patches May 21, 2023
@eahydra eahydra closed this May 21, 2023
@eahydra eahydra reopened this May 22, 2023
@hormes
Copy link
Member

hormes commented May 22, 2023

/lgtm

@koordinator-bot koordinator-bot bot added the lgtm label May 22, 2023
@hormes hormes added this to the v1.3 milestone May 22, 2023
Copy link
Member

@jasonliu747 jasonliu747 left a comment

Choose a reason for hiding this comment

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

/lgtm

Copy link
Member

@saintube saintube left a comment

Choose a reason for hiding this comment

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

/lgtm

@@ -270,6 +283,8 @@ func (ext *frameworkExtenderImpl) RunPreBindPlugins(ctx context.Context, state *
reservation = reservation.DeepCopy()
reservation.Status.NodeName = nodeName

original := reservation
reservation = reservation.DeepCopy()
Copy link
Member

Choose a reason for hiding this comment

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

Is there any way to avoid deepcopy the reservation twice?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

…mmit patches

Signed-off-by: Joseph <joseph.t.lee@outlook.com>
Copy link
Member

@FillZpp FillZpp left a comment

Choose a reason for hiding this comment

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

/lgtm

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.

/arrove

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: buptcozy, FillZpp, jasonliu747

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 4a53f32 into koordinator-sh:main May 23, 2023
16 checks passed
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

6 participants