[ARVADOS] updated: 2.1.0-1665-g458dae934

Git user git at public.arvados.org
Mon Nov 22 18:35:39 UTC 2021


Summary of changes:
 lib/crunchrun/crunchrun.go   | 27 ++++++++++++++-------------
 lib/crunchrun/docker.go      |  4 ++--
 lib/crunchrun/executor.go    | 28 ++++++++++++++--------------
 lib/crunchrun/singularity.go |  2 +-
 sdk/go/arvados/container.go  |  8 ++++----
 5 files changed, 35 insertions(+), 34 deletions(-)

       via  458dae934c14435c0c86b90321ac8000498cab23 (commit)
      from  96f0463a584b751698b7f2baede26ddafa5950bb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 458dae934c14435c0c86b90321ac8000498cab23
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Nov 22 13:35:20 2021 -0500

    12630: Use CUDADeviceCount instead of EnableCUDA
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/lib/crunchrun/crunchrun.go b/lib/crunchrun/crunchrun.go
index 63a0ada54..4af612993 100644
--- a/lib/crunchrun/crunchrun.go
+++ b/lib/crunchrun/crunchrun.go
@@ -987,19 +987,20 @@ func (runner *ContainerRunner) CreateContainer(imageID string, bindmounts map[st
 	runner.executorStdout = stdout
 	runner.executorStderr = stderr
 	return runner.executor.Create(containerSpec{
-		Image:         imageID,
-		VCPUs:         runner.Container.RuntimeConstraints.VCPUs,
-		RAM:           ram,
-		WorkingDir:    workdir,
-		Env:           env,
-		BindMounts:    bindmounts,
-		Command:       runner.Container.Command,
-		EnableNetwork: enableNetwork,
-		NetworkMode:   runner.networkMode,
-		CgroupParent:  runner.setCgroupParent,
-		Stdin:         stdin,
-		Stdout:        stdout,
-		Stderr:        stderr,
+		Image:           imageID,
+		VCPUs:           runner.Container.RuntimeConstraints.VCPUs,
+		RAM:             ram,
+		WorkingDir:      workdir,
+		Env:             env,
+		BindMounts:      bindmounts,
+		Command:         runner.Container.Command,
+		EnableNetwork:   enableNetwork,
+		CUDADeviceCount: runner.Container.RuntimeConstraints.CUDADeviceCount,
+		NetworkMode:     runner.networkMode,
+		CgroupParent:    runner.setCgroupParent,
+		Stdin:           stdin,
+		Stdout:          stdout,
+		Stderr:          stderr,
 	})
 }
 
diff --git a/lib/crunchrun/docker.go b/lib/crunchrun/docker.go
index 573df7faf..c64ff83da 100644
--- a/lib/crunchrun/docker.go
+++ b/lib/crunchrun/docker.go
@@ -106,10 +106,10 @@ func (e *dockerExecutor) Create(spec containerSpec) error {
 			KernelMemory: spec.RAM, // kernel portion
 		},
 	}
-	if spec.EnableCUDA {
+	if spec.CUDADeviceCount != 0 {
 		hostCfg.Resources.DeviceRequests = append(hostCfg.Resources.DeviceRequests, dockercontainer.DeviceRequest{
 			Driver:       "nvidia",
-			Count:        -1,
+			Count:        spec.CUDADeviceCount,
 			Capabilities: [][]string{[]string{"gpu", "nvidia", "compute"}},
 		})
 	}
diff --git a/lib/crunchrun/executor.go b/lib/crunchrun/executor.go
index bffd701bc..dc1bc20b7 100644
--- a/lib/crunchrun/executor.go
+++ b/lib/crunchrun/executor.go
@@ -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
diff --git a/lib/crunchrun/singularity.go b/lib/crunchrun/singularity.go
index 5637a9b4d..2128aeb22 100644
--- a/lib/crunchrun/singularity.go
+++ b/lib/crunchrun/singularity.go
@@ -247,7 +247,7 @@ func (e *singularityExecutor) Start() error {
 		args = append(args, "--net", "--network=none")
 	}
 
-	if e.spec.EnableCUDA {
+	if e.spec.CUDADeviceCount != 0 {
 		args = append(args, "--nv")
 	}
 
diff --git a/sdk/go/arvados/container.go b/sdk/go/arvados/container.go
index 014fd6c2b..8e335f875 100644
--- a/sdk/go/arvados/container.go
+++ b/sdk/go/arvados/container.go
@@ -100,10 +100,10 @@ type RuntimeConstraints struct {
 	RAM                         int64    `json:"ram"`
 	VCPUs                       int      `json:"vcpus"`
 	KeepCacheRAM                int64    `json:"keep_cache_ram"`
-	CUDADriverVersion           string   `json:"cuda_driver_version"`
-	CUDACubinHardwareCapability []string `json:"cuda_cubin_hardware_capability"`
-	CUDAPTXHardwardCapability   string   `json:"cuda_ptx_hardware_capability"`
-	CUDADeviceCount             int      `json:"cuda_device_count"`
+	CUDADriverVersion           string   `json:"cuda_driver_version,omitempty"`
+	CUDACubinHardwareCapability []string `json:"cuda_cubin_hardware_capability,omitempty"`
+	CUDAPTXHardwardCapability   string   `json:"cuda_ptx_hardware_capability,omitempty"`
+	CUDADeviceCount             int      `json:"cuda_device_count,omitempty"`
 }
 
 // SchedulingParameters specify a container's scheduling parameters

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list