Skip to content

Commit

Permalink
Merge pull request #2236 from william-wang/sunset-elect
Browse files Browse the repository at this point in the history
sunset the reservation plugin and elect reserve actions
  • Loading branch information
volcano-sh-bot committed May 14, 2022
2 parents 87148e0 + b27b4bb commit c9f1c1b
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 434 deletions.
25 changes: 2 additions & 23 deletions pkg/scheduler/actions/allocate/allocate.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ import (
"volcano.sh/volcano/pkg/scheduler/util"
)

var targetJob = util.Reservation.TargetJob

type Action struct{}

func New() *Action {
Expand Down Expand Up @@ -98,18 +96,6 @@ func (alloc *Action) Execute(ssn *framework.Session) {
pendingTasks := map[api.JobID]*util.PriorityQueue{}

allNodes := ssn.NodeList
unlockedNodes := allNodes
if targetJob != nil && len(util.Reservation.LockedNodes) != 0 {
unlockedNodes = unlockedNodes[0:0]
for _, node := range allNodes {
if _, exist := util.Reservation.LockedNodes[node.Name]; !exist {
unlockedNodes = append(unlockedNodes, node)
}
}
}
for _, unlockedNode := range unlockedNodes {
klog.V(4).Infof("unlockedNode ID: %s, Name: %s", unlockedNode.Node.UID, unlockedNode.Node.Name)
}
predicateFn := func(task *api.TaskInfo, node *api.NodeInfo) error {
// Check for Resource Predicate
if !task.InitResreq.LessEqual(node.FutureIdle(), api.Zero) {
Expand Down Expand Up @@ -171,13 +157,6 @@ func (alloc *Action) Execute(ssn *framework.Session) {
}

job := jobs.Pop().(*api.JobInfo)
var nodes []*api.NodeInfo
if targetJob != nil && job.UID == targetJob.UID {
klog.V(4).Infof("Try to allocate resource to target job: %s", job.Name)
nodes = allNodes
} else {
nodes = unlockedNodes
}
if _, found = pendingTasks[job.UID]; !found {
tasks := util.NewPriorityQueue(ssn.TaskOrderFn)
for _, task := range job.TaskStatusIndex[api.Pending] {
Expand Down Expand Up @@ -207,9 +186,9 @@ func (alloc *Action) Execute(ssn *framework.Session) {
continue
}

klog.V(3).Infof("There are <%d> nodes for Job <%v/%v>", len(nodes), job.Namespace, job.Name)
klog.V(3).Infof("There are <%d> nodes for Job <%v/%v>", len(ssn.Nodes), job.Namespace, job.Name)

predicateNodes, fitErrors := ph.PredicateNodes(task, nodes, predicateFn)
predicateNodes, fitErrors := ph.PredicateNodes(task, allNodes, predicateFn)
if len(predicateNodes) == 0 {
job.NodesFitErrors[task.UID] = fitErrors
break
Expand Down
52 changes: 0 additions & 52 deletions pkg/scheduler/actions/elect/elect.go

This file was deleted.

113 changes: 0 additions & 113 deletions pkg/scheduler/actions/elect/elect_test.go

This file was deleted.

4 changes: 0 additions & 4 deletions pkg/scheduler/actions/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ package actions
import (
"volcano.sh/volcano/pkg/scheduler/actions/allocate"
"volcano.sh/volcano/pkg/scheduler/actions/backfill"
"volcano.sh/volcano/pkg/scheduler/actions/elect"
"volcano.sh/volcano/pkg/scheduler/actions/enqueue"
"volcano.sh/volcano/pkg/scheduler/actions/preempt"
"volcano.sh/volcano/pkg/scheduler/actions/reclaim"
"volcano.sh/volcano/pkg/scheduler/actions/reserve"
"volcano.sh/volcano/pkg/scheduler/actions/shuffle"
"volcano.sh/volcano/pkg/scheduler/framework"
)
Expand All @@ -34,7 +32,5 @@ func init() {
framework.RegisterAction(backfill.New())
framework.RegisterAction(preempt.New())
framework.RegisterAction(enqueue.New())
framework.RegisterAction(elect.New())
framework.RegisterAction(reserve.New())
framework.RegisterAction(shuffle.New())
}
77 changes: 0 additions & 77 deletions pkg/scheduler/actions/reserve/reserve.go

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/scheduler/plugins/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"volcano.sh/volcano/pkg/scheduler/plugins/priority"
"volcano.sh/volcano/pkg/scheduler/plugins/proportion"
"volcano.sh/volcano/pkg/scheduler/plugins/rescheduling"
"volcano.sh/volcano/pkg/scheduler/plugins/reservation"
"volcano.sh/volcano/pkg/scheduler/plugins/resourcequota"
"volcano.sh/volcano/pkg/scheduler/plugins/sla"
tasktopology "volcano.sh/volcano/pkg/scheduler/plugins/task-topology"
Expand All @@ -47,7 +46,6 @@ func init() {
framework.RegisterPluginBuilder(nodeorder.PluginName, nodeorder.New)
framework.RegisterPluginBuilder(conformance.PluginName, conformance.New)
framework.RegisterPluginBuilder(binpack.PluginName, binpack.New)
framework.RegisterPluginBuilder(reservation.PluginName, reservation.New)
framework.RegisterPluginBuilder(tdm.PluginName, tdm.New)
framework.RegisterPluginBuilder(overcommit.PluginName, overcommit.New)
framework.RegisterPluginBuilder(sla.PluginName, sla.New)
Expand Down
Loading

0 comments on commit c9f1c1b

Please sign in to comment.