1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
9 "git.arvados.org/arvados.git/sdk/go/arvados"
10 "golang.org/x/net/context"
13 type bindmount struct {
18 type containerSpec struct {
24 BindMounts map[string]bindmount
27 NetworkMode string // docker network mode, normally "default"
34 // containerExecutor is an interface to a container runtime
35 // (docker/singularity).
36 type containerExecutor interface {
37 // ImageLoaded determines whether the given image is already
38 // available to use without calling ImageLoad.
39 ImageLoaded(imageID string) bool
41 // ImageLoad loads the image from the given tarball such that
42 // it can be used to create/start a container.
43 LoadImage(filename string) error
45 // Wait for the container process to finish, and return its
46 // exit code. If applicable, also remove the stopped container
48 Wait(context.Context) (int, error)
50 // Create a container, but don't start it yet.
51 Create(containerSpec) error
53 // Start the container
56 // CID the container will belong to
59 // Stop the container immediately
62 // Release resources (temp dirs, stopped containers)
65 // Give the executor access to arvados client & container info
66 SetArvadoClient(containerClient *arvados.Client, container arvados.Container)