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

Add callback func bestNodeFn for plugins to attach nodeScores. #785

Merged
merged 1 commit into from
May 6, 2020
Merged

Add callback func bestNodeFn for plugins to attach nodeScores. #785

merged 1 commit into from
May 6, 2020

Conversation

jiangkaihua
Copy link
Contributor

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 29, 2020
@jiangkaihua
Copy link
Contributor Author

@k82cn

@TravisBuddy
Copy link

Travis tests have failed

Hey @jiangkaihua,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

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)
Copy link
Member

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)
}

@k82cn
Copy link
Member

k82cn commented May 6, 2020

/approve

@volcano-sh-bot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 6, 2020
Signed-off-by: jiangkaihua <54176503+jiangkaihua@users.noreply.github.com>
@k82cn
Copy link
Member

k82cn commented May 6, 2020

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label May 6, 2020
@volcano-sh-bot volcano-sh-bot merged commit 52ad8d2 into volcano-sh:master May 6, 2020
Copy link
Collaborator

@hzxuzhonghu hzxuzhonghu left a 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)
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants