X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7af0535d3b0d7960152b06b7211c26bfd7b208cb..28a733a8823fedadc34a560935abdd17039cb100:/lib/crunchrun/executor.go diff --git a/lib/crunchrun/executor.go b/lib/crunchrun/executor.go index 65bf7427b9..29abab631f 100644 --- a/lib/crunchrun/executor.go +++ b/lib/crunchrun/executor.go @@ -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,19 +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 - 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 @@ -50,12 +51,19 @@ 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 or + // negative if container is finished or no process has started + // yet) + Pid() int // Stop the container immediately Stop() error // Release resources (temp dirs, stopped containers) Close() + + // Name and version of runtime engine ("docker 20.10.16", "singularity-ce version 3.9.9") + Runtime() string + + GatewayTarget }