12630: first try at adding GPU support, no tests yet
[arvados.git] / lib / crunchrun / executor.go
index f4feaa06c21447cc66b2e57a962e2d2c306e6de7..bffd701bcd4d0246841a2dfbb4e2d9cde5b9c2ab 100644 (file)
@@ -6,6 +6,7 @@ package crunchrun
 import (
        "io"
 
+       "git.arvados.org/arvados.git/sdk/go/arvados"
        "golang.org/x/net/context"
 )
 
@@ -23,6 +24,7 @@ type containerSpec struct {
        BindMounts    map[string]bindmount
        Command       []string
        EnableNetwork bool
+       EnableCUDA    bool
        NetworkMode   string // docker network mode, normally "default"
        CgroupParent  string
        Stdin         io.Reader
@@ -33,13 +35,10 @@ type containerSpec struct {
 // 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 +59,7 @@ type containerExecutor interface {
 
        // Release resources (temp dirs, stopped containers)
        Close()
+
+       // Name of runtime engine ("docker", "singularity")
+       Runtime() string
 }