1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
10 "git.arvados.org/arvados.git/lib/dispatchcloud/container"
11 "git.arvados.org/arvados.git/lib/dispatchcloud/worker"
12 "git.arvados.org/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. See
17 // container.Queue method documentation for details.
18 type ContainerQueue interface {
19 Entries() (entries map[string]container.QueueEnt, updated time.Time)
20 Lock(uuid string) error
21 Unlock(uuid string) error
22 Cancel(uuid string) error
24 Get(uuid string) (arvados.Container, bool)
25 Subscribe() <-chan struct{}
26 Unsubscribe(<-chan struct{})
30 // A WorkerPool asynchronously starts and stops worker VMs, and starts
31 // and stops containers on them. Implemented by worker.Pool and test
32 // stubs. See worker.Pool method documentation for details.
33 type WorkerPool interface {
34 Running() map[string]time.Time
35 Unallocated() map[arvados.InstanceType]int
36 CountWorkers() map[worker.State]int
38 Create(arvados.InstanceType) bool
39 Shutdown(arvados.InstanceType) bool
40 StartContainer(arvados.InstanceType, arvados.Container) bool
41 KillContainer(uuid, reason string) bool
42 ForgetContainer(uuid string)
43 Subscribe() <-chan struct{}
44 Unsubscribe(<-chan struct{})