1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
10 "git.curoverse.com/arvados.git/lib/dispatchcloud/container"
11 "git.curoverse.com/arvados.git/lib/dispatchcloud/worker"
12 "git.curoverse.com/arvados.git/sdk/go/arvados"
15 // A ContainerQueue is a set of containers that need to be started or
16 // stopped. Implemented by container.Queue and test stubs.
17 type ContainerQueue interface {
18 Entries() (entries map[string]container.QueueEnt, updated time.Time)
19 Lock(uuid string) error
20 Unlock(uuid string) error
21 Cancel(uuid string) error
23 Get(uuid string) (arvados.Container, bool)
26 // A WorkerPool asynchronously starts and stops worker VMs, and starts
27 // and stops containers on them. Implemented by worker.Pool and test
29 type WorkerPool interface {
30 Running() map[string]time.Time
31 Unallocated() map[arvados.InstanceType]int
32 Workers() map[worker.State]int
34 Create(arvados.InstanceType) error
35 Shutdown(arvados.InstanceType) bool
36 StartContainer(arvados.InstanceType, arvados.Container) bool
37 KillContainer(uuid string)
38 Subscribe() <-chan struct{}
39 Unsubscribe(<-chan struct{})