Merge branch '21666-provision-test-improvement'
[arvados.git] / lib / crunchrun / executor.go
index bffd701bcd4d0246841a2dfbb4e2d9cde5b9c2ab..308b05cdeb33b529d46564658cdb5c6dcfc8b1af 100644 (file)
@@ -4,10 +4,10 @@
 package crunchrun
 
 import (
+       "context"
        "io"
 
        "git.arvados.org/arvados.git/sdk/go/arvados"
-       "golang.org/x/net/context"
 )
 
 type bindmount struct {
@@ -16,20 +16,20 @@ type bindmount struct {
 }
 
 type containerSpec struct {
-       Image         string
-       VCPUs         int
-       RAM           int64
-       WorkingDir    string
-       Env           map[string]string
-       BindMounts    map[string]bindmount
-       Command       []string
-       EnableNetwork bool
-       EnableCUDA    bool
-       NetworkMode   string // docker network mode, normally "default"
-       CgroupParent  string
-       Stdin         io.Reader
-       Stdout        io.Writer
-       Stderr        io.Writer
+       Image           string
+       VCPUs           int
+       RAM             int64
+       WorkingDir      string
+       Env             map[string]string
+       BindMounts      map[string]bindmount
+       Command         []string
+       EnableNetwork   bool
+       CUDADeviceCount int
+       NetworkMode     string // docker network mode, normally "default"
+       CgroupParent    string
+       Stdin           io.Reader
+       Stdout          io.Writer
+       Stderr          io.Writer
 }
 
 // containerExecutor is an interface to a container runtime
@@ -51,8 +51,9 @@ type containerExecutor interface {
        // Start the container
        Start() error
 
-       // CID the container will belong to
-       CgroupID() string
+       // Process ID of a process in the container.  Return 0 if
+       // container is finished or no process has started yet.
+       Pid() int
 
        // Stop the container immediately
        Stop() error
@@ -60,6 +61,8 @@ type containerExecutor interface {
        // Release resources (temp dirs, stopped containers)
        Close()
 
-       // Name of runtime engine ("docker", "singularity")
+       // Name and version of runtime engine ("docker 20.10.16", "singularity-ce version 3.9.9")
        Runtime() string
+
+       GatewayTarget
 }