var quietAfter503 = time.Minute
+func isSupervisor(ctr arvados.Container) bool {
+ return (len(ctr.Command) > 0 && ctr.Command[0] == "arvados-cwl-runner") || ctr.SchedulingParameters.Supervisor
+}
+
func (sch *Scheduler) runQueue() {
unsorted, _ := sch.queue.Entries()
sorted := make([]container.QueueEnt, 0, len(unsorted))
// reaches the dynamic maxConcurrency limit.
trying := len(running)
+ supervisors := 0
+
tryrun:
for i, ctr := range sorted {
ctr, it := ctr.Container, ctr.InstanceType
"ContainerUUID": ctr.UUID,
"InstanceType": it.Name,
})
+ if isSupervisor(ctr) {
+ supervisors += 1
+ if sch.maxSupervisors > 0 && supervisors > sch.maxSupervisors {
+ continue
+ }
+ }
if _, running := running[ctr.UUID]; running || ctr.Priority < 1 {
continue
}