1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
9 "golang.org/x/net/context"
12 type bindmount struct {
17 type containerSpec struct {
23 BindMounts map[string]bindmount
26 NetworkMode string // docker network mode, normally "default"
33 // containerExecutor is an interface to a container runtime
34 // (docker/singularity).
35 type containerExecutor interface {
36 // ImageLoaded determines whether the given image is already
37 // available to use without calling ImageLoad.
38 ImageLoaded(imageID string) bool
40 // ImageLoad loads the image from the given tarball such that
41 // it can be used to create/start a container.
42 LoadImage(filename string) error
44 // Wait for the container process to finish, and return its
45 // exit code. If applicable, also remove the stopped container
47 Wait(context.Context) (int, error)
49 // Create a container, but don't start it yet.
50 Create(containerSpec) error
52 // Start the container
55 // CID the container will belong to
58 // Stop the container immediately
61 // Release resources (temp dirs, stopped containers)