Skip to content

Commit

Permalink
Merge pull request #733 from k82cn/add_res_pred_alloc
Browse files Browse the repository at this point in the history
Added resources predicate in allocate action.
  • Loading branch information
volcano-sh-bot authored Mar 9, 2020
2 parents b545729 + 7f97d53 commit 2f6e785
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/scheduler/actions/allocate/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,14 @@ func (alloc *allocateAction) Execute(ssn *framework.Session) {
break
}

nodeScores := util.PrioritizeNodes(task, predicateNodes, ssn.BatchNodeOrderFn, ssn.NodeOrderMapFn, ssn.NodeOrderReduceFn)
var candidateNodes []*api.NodeInfo
for _, n := range predicateNodes {
if task.InitResreq.LessEqual(n.Idle) || task.InitResreq.LessEqual(n.FutureIdle()) {
candidateNodes = append(candidateNodes, n)
}
}

nodeScores := util.PrioritizeNodes(task, candidateNodes, ssn.BatchNodeOrderFn, ssn.NodeOrderMapFn, ssn.NodeOrderReduceFn)

node := util.SelectBestNode(nodeScores)
// Allocate idle resource to the task.
Expand Down

0 comments on commit 2f6e785

Please # to comment.