-
Notifications
You must be signed in to change notification settings - Fork 337
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
feat: add NodeResourcesFitPlus and ScarceResourceAvoidance plugin #2302
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2302 +/- ##
==========================================
+ Coverage 66.02% 66.04% +0.02%
==========================================
Files 458 460 +2
Lines 53868 54147 +279
==========================================
+ Hits 35564 35764 +200
- Misses 15749 15807 +58
- Partials 2555 2576 +21
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
4e607ff
to
fc5493b
Compare
pkg/scheduler/plugins/scarceresourceavoidance/scarce_resource_avoidance.go
Outdated
Show resolved
Hide resolved
…lugis Signed-off-by: LY-today <[email protected]>
c3328a1
to
507a5b5
Compare
Expressing benefit, NodeResourcesFit is indeed very limited in some scenarios, especially in non-traditional CPU and Memory clusters, expensive resources like GPU do require special treatment. |
pkg/scheduler/plugins/noderesourcefitplus/node_resources_fit_plus.go
Outdated
Show resolved
Hide resolved
Signed-off-by: LY-today <[email protected]>
|
||
func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error) { | ||
|
||
sampleArgs2, ok := args.(*config.NodeResourcesFitPlusArgs) |
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.
please rename it
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.
get
return 0, framework.NewStatus(framework.Error, fmt.Sprintf("get State node %q from PreScore: %v", nodeName, err)) | ||
} | ||
|
||
podRequest, _ := fitsRequest(scoreState.Resource, nodeInfo) |
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.
why does it mean fitsRequest and why we need it
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.
refer to:k8s.io/[email protected]/pkg/scheduler/framework/plugins/noderesources/fit.go:fitsRequest
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.
Resource types used to sense pods and nodes
return 0, framework.NewStatus(framework.Error, err.Error()) | ||
} | ||
|
||
resourceScore, status := fit.(framework.ScorePlugin).Score(ctx, state, p, nodeName) |
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.
I recommend you just copy the upstream code and update the license "Copyright 2022 The Koordinator Authors" to "Copyright 2022 The Kubernetes Authors"
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.
Do you mean to suggest duplicating MostAllocated and LeastAllocated's implementation of Score? Rather than suggesting this form of encapsulating score?
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.
The purpose of encapsulation here is to reduce the implementation of repeated logic. Don't quite understand the advantages of copying existing logic?
|
||
func New(args runtime.Object, handle framework.Handle) (framework.Plugin, error) { | ||
|
||
sampleArgs2, ok := args.(*config.ScarceResourceAvoidanceArgs) |
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.
please rename it
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.
get
What is your proposal:
The NodeResourcesFit plug-in of native k8s can only adopt a type of strategy for all resources, such as MostRequestedPriority and LeastRequestedPriority. However, in industrial practice, this design does not apply to some scenarios. For example: In AI scenarios, businesses that apply for GPUs prefer to occupy the entire GPU machine first to prevent GPU fragmentation; businesses that apply for CPU & MEM are prioritized and dispersed to non-GPU machines to prevent excessive consumption of CPU & MEM on GPU machines, resulting in real tasks of applying for GPUs. Pending due to insufficient non-GPU resources
. It is therefore hoped that both strategies can be extended to address this business need.
Why is this needed:
There are related descriptions above
Is there a suggested solution, if so, please add it:
plugin-one
config:
config description:
node score:
plugin-two
config:
config description:
node score: