-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add callback func bestNodeFn for plugins to attach nodeScores. #785
Conversation
Travis tests have failedHey @jiangkaihua, TravisBuddy Request Identifier: fa380b70-8f3f-11ea-b91d-fdb092ef3eb4 |
@@ -203,7 +207,7 @@ func (alloc *allocateAction) Execute(ssn *framework.Session) { | |||
|
|||
nodeScores := util.PrioritizeNodes(task, candidateNodes, ssn.BatchNodeOrderFn, ssn.NodeOrderMapFn, ssn.NodeOrderReduceFn) | |||
|
|||
node := util.SelectBestNode(nodeScores) | |||
node := util.SelectBestNode(nodeScores, task, bestNodeFn) |
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 use following code slice :
node := ssn.BestNodeFn(task, nodeScores)
if node == nil {
node = util.SelectBestNode(nodeScores)
}
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jiangkaihua, k82cn 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 |
Signed-off-by: jiangkaihua <54176503+jiangkaihua@users.noreply.github.com>
/lgtm |
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 add a comment what this pr does, so we can track it.
@@ -203,7 +203,11 @@ func (alloc *allocateAction) Execute(ssn *framework.Session) { | |||
|
|||
nodeScores := util.PrioritizeNodes(task, candidateNodes, ssn.BatchNodeOrderFn, ssn.NodeOrderMapFn, ssn.NodeOrderReduceFn) | |||
|
|||
node := util.SelectBestNode(nodeScores) | |||
node := ssn.BestNodeFn(task, nodeScores) |
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.
@jiangkaihua Is this complete? Where is the BestNodeFn
added?
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 BestNodeFn is defined in pkg/scheduler/framework/session_plugins.go
, which permits plugins to select one best node for a specific task according to nodeScores or something else. By default the first returned node is chosen as the final best node for scheduler. If no plugin chooses best node, the scheduler executes the previous process to select best node.
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.
Sorry i mean where add BestNodeFn by calling AddBestNodeFn
?
I could not find it.
Signed-off-by: jiangkaihua 54176503+jiangkaihua@users.noreply.github.com