Skip to content

Commit

Permalink
Merge pull request volcano-sh#23 from k82cn/vk_197
Browse files Browse the repository at this point in the history
Enqueue jobs if Queue's capability is not set.
  • Loading branch information
volcano-sh-bot authored Jun 4, 2019
2 parents 9d8ffc5 + f58c7e6 commit 7003812
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/scheduler/plugins/proportion/proportion.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
}
allocated := allocations[job.Queue]
if allocated.Less(reclaimee.Resreq) {
glog.Errorf("Failed to allocate resource for Task <%s/%s> in Queue <%s> not enough resource.",
glog.V(3).Infof("Failed to allocate resource for Task <%s/%s> in Queue <%s>, not enough resource.",
reclaimee.Namespace, reclaimee.Name, job.Queue)
continue
}
Expand Down Expand Up @@ -213,6 +213,12 @@ func (pp *proportionPlugin) OnSessionOpen(ssn *framework.Session) {
queueID := job.Queue
attr := pp.queueOpts[queueID]
queue := ssn.Queues[queueID]

// If no capability is set, always enqueue the job.
if len(queue.Queue.Spec.Capability) == 0 {
return true
}

pgResource := api.NewResource(*job.PodGroup.Spec.MinResources)
// The queue resource quota limit has not reached
if pgResource.Clone().Add(attr.allocated).LessEqual(api.NewResource(queue.Queue.Spec.Capability)) {
Expand Down

0 comments on commit 7003812

Please sign in to comment.