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-manager: revise node resource framework #1101

Merged

Conversation

saintube
Copy link
Member

@saintube saintube commented Mar 9, 2023

Ⅰ. Describe what this PR does

Revise node resource framework:

  1. Add a sequence of the plugins' execution by the registered order.
  2. Make the degraded resource calculation private in each ResourceCalculatePlugin.
  3. Use structural logs in the node-resource controller.

Ⅱ. Does this pull request fix one issue?

fixes #1060

Ⅲ. 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 Mar 9, 2023

Codecov Report

Patch coverage: 71.20% and no project coverage change.

Comparison is base (b3bb7de) 66.65% compared to head (6c2e0e2) 66.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1101   +/-   ##
=======================================
  Coverage   66.65%   66.66%           
=======================================
  Files         266      268    +2     
  Lines       29210    29257   +47     
=======================================
+ Hits        19470    19503   +33     
- Misses       8355     8364    +9     
- Partials     1385     1390    +5     
Flag Coverage Δ
unittests 66.66% <71.20%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...-controller/noderesource/framework/noderesource.go 12.96% <0.00%> (+0.46%) ⬆️
...controller/noderesource/noderesource_controller.go 39.39% <54.54%> (-1.15%) ⬇️
...ntroller/noderesource/framework/extender_plugin.go 44.77% <56.41%> (-2.69%) ⬇️
...oller/noderesource/plugins/batchresource/plugin.go 68.57% <60.00%> (-1.43%) ⬇️
...slo-controller/noderesource/resource_calculator.go 81.81% <71.42%> (-3.19%) ⬇️
.../slo-controller/noderesource/framework/registry.go 92.68% <92.68%> (ø)
...ontroller/noderesource/nodemetric_event_handler.go 90.90% <100.00%> (ø)
pkg/slo-controller/noderesource/plugins_profile.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@saintube saintube force-pushed the revise-noderesource-framework branch from 937bac7 to 608dfe8 Compare March 10, 2023 02:10
@saintube saintube force-pushed the revise-noderesource-framework branch from 608dfe8 to 65cf44b Compare March 10, 2023 11:50
@saintube saintube requested review from jasonliu747 and zwzhang0107 and removed request for jasonliu747 March 10, 2023 11:52
@hormes
Copy link
Member

hormes commented Mar 13, 2023

Setting the priority on the plugin will make understanding very complicated, because the logic is scattered in different files, it is difficult to add a plugin to know where it should be placed. If there is a strong order dependency between plugins, then we should have a place to register each plugin uniformly and arrange their order here.

@hormes
Copy link
Member

hormes commented Mar 13, 2023

I see that priority has been removed, and some comments and functions have not been removed

@saintube saintube force-pushed the revise-noderesource-framework branch from 65cf44b to 5b71464 Compare March 13, 2023 02:39
@saintube
Copy link
Member Author

I see that priority has been removed, and some comments and functions have not been removed

Fixed.

@saintube saintube force-pushed the revise-noderesource-framework branch from 5b71464 to f091d63 Compare March 13, 2023 02:43
@saintube saintube force-pushed the revise-noderesource-framework branch from f091d63 to e02b3b2 Compare March 13, 2023 04:14
@hormes hormes added the lgtm label Mar 13, 2023
@saintube saintube force-pushed the revise-noderesource-framework branch from e02b3b2 to f47427f Compare March 13, 2023 13:13
@koordinator-bot koordinator-bot bot removed the lgtm label Mar 13, 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
others PTAL @hormes @zwzhang0107

@zwzhang0107
Copy link
Contributor

/lgtm
/hold until local branch is ready

Signed-off-by: saintube <saintube@foxmail.com>
@saintube saintube force-pushed the revise-noderesource-framework branch from f47427f to 6c2e0e2 Compare March 17, 2023 05:30
@koordinator-bot koordinator-bot bot removed the lgtm label Mar 17, 2023
@zwzhang0107
Copy link
Contributor

/hold cancel
/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: zwzhang0107

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

@zwzhang0107
Copy link
Contributor

/lgtm

@koordinator-bot koordinator-bot bot added the lgtm label Mar 20, 2023
@koordinator-bot koordinator-bot bot merged commit 1b425ce into koordinator-sh:main Mar 20, 2023
@zwzhang0107 zwzhang0107 added this to the v1.2 milestone Apr 6, 2023
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.

[proposal] noderesource controller supports resource calculator extenders
4 participants