X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/663bc76408fc7b1a7a02c0f82aa2bf003c30b78a..96d8b9e1afecccae803ec4b956ada745dbe71d9f:/lib/dispatchcloud/scheduler/scheduler.go diff --git a/lib/dispatchcloud/scheduler/scheduler.go b/lib/dispatchcloud/scheduler/scheduler.go index 4644dc4ea4..21510ee091 100644 --- a/lib/dispatchcloud/scheduler/scheduler.go +++ b/lib/dispatchcloud/scheduler/scheduler.go @@ -48,6 +48,7 @@ type Scheduler struct { last503time time.Time // last time API responded 503 maxConcurrency int // dynamic container limit (0 = unlimited), see runQueue() + maxSupervisors int // maximum number of "supervisor" containers (these are containers who's main job is to launch other containers, e.g. workflow runners) mContainersAllocatedNotStarted prometheus.Gauge mContainersNotAllocatedOverQuota prometheus.Gauge @@ -60,7 +61,7 @@ type Scheduler struct { // // Any given queue and pool should not be used by more than one // scheduler at a time. -func New(ctx context.Context, client *arvados.Client, queue ContainerQueue, pool WorkerPool, reg *prometheus.Registry, staleLockTimeout, queueUpdateInterval time.Duration) *Scheduler { +func New(ctx context.Context, client *arvados.Client, queue ContainerQueue, pool WorkerPool, reg *prometheus.Registry, staleLockTimeout, queueUpdateInterval time.Duration, maxSupervisors int) *Scheduler { sch := &Scheduler{ logger: ctxlog.FromContext(ctx), client: client, @@ -73,6 +74,7 @@ func New(ctx context.Context, client *arvados.Client, queue ContainerQueue, pool stop: make(chan struct{}), stopped: make(chan struct{}), uuidOp: map[string]string{}, + maxSupervisors: maxSupervisors, } sch.registerMetrics(reg) return sch