X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/bcab6c50f54f155f14d1dd635becd85a5e91289d..beec7ed54cc2f355480ab0dc0eab439b56537d6e:/lib/crunchrun/executor.go diff --git a/lib/crunchrun/executor.go b/lib/crunchrun/executor.go index c773febe94..b7c341f318 100644 --- a/lib/crunchrun/executor.go +++ b/lib/crunchrun/executor.go @@ -6,6 +6,7 @@ package crunchrun import ( "io" + "git.arvados.org/arvados.git/sdk/go/arvados" "golang.org/x/net/context" ) @@ -25,21 +26,18 @@ type containerSpec struct { EnableNetwork bool NetworkMode string // docker network mode, normally "default" CgroupParent string - Stdin io.ReadCloser - Stdout io.WriteCloser - Stderr io.WriteCloser + Stdin io.Reader + Stdout io.Writer + Stderr io.Writer } // containerExecutor is an interface to a container runtime // (docker/singularity). type containerExecutor interface { - // ImageLoaded determines whether the given image is already - // available to use without calling ImageLoad. - ImageLoaded(imageID string) bool - // ImageLoad loads the image from the given tarball such that // it can be used to create/start a container. - LoadImage(filename string) error + LoadImage(imageID string, imageTarballPath string, container arvados.Container, keepMount string, + containerClient *arvados.Client) error // Wait for the container process to finish, and return its // exit code. If applicable, also remove the stopped container @@ -60,4 +58,7 @@ type containerExecutor interface { // Release resources (temp dirs, stopped containers) Close() + + // Name of runtime engine ("docker", "singularity") + Runtime() string }