projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17421: a few wording tweaks.
[arvados.git]
/
lib
/
crunchrun
/
docker.go
diff --git
a/lib/crunchrun/docker.go
b/lib/crunchrun/docker.go
index ea9d448215cd1f700bce3bb2b675442c3fc6d231..e62f2a39ba36e0b23d149d50f5062344a1f0aff1 100644
(file)
--- a/
lib/crunchrun/docker.go
+++ b/
lib/crunchrun/docker.go
@@
-108,13
+108,12
@@
func (e *dockerExecutor) config(spec containerSpec) (dockercontainer.Config, doc
}
if spec.CUDADeviceCount != 0 {
var deviceIds []string
}
if spec.CUDADeviceCount != 0 {
var deviceIds []string
-
for _, s := range os.Environ()
{
+
if cudaVisibleDevices := os.Getenv("CUDA_VISIBLE_DEVICES"); cudaVisibleDevices != ""
{
// If a resource manager such as slurm or LSF told
// us to select specific devices we need to propagate that.
// If a resource manager such as slurm or LSF told
// us to select specific devices we need to propagate that.
- if strings.HasPrefix(s, "CUDA_VISIBLE_DEVICES=") {
- deviceIds = strings.SplitN(strings.SplitN(s, "=", 2)[1], ",")
- }
+ deviceIds = strings.Split(cudaVisibleDevices, ",")
}
}
+
deviceCount := spec.CUDADeviceCount
if len(deviceIds) > 0 {
// Docker won't accept both non-empty
deviceCount := spec.CUDADeviceCount
if len(deviceIds) > 0 {
// Docker won't accept both non-empty
@@
-216,7
+215,6
@@
func (e *dockerExecutor) Wait(ctx context.Context) (int, error) {
for {
select {
case waitBody := <-waitOk:
for {
select {
case waitBody := <-waitOk:
- e.logf("Container exited with code: %v", waitBody.StatusCode)
// wait for stdout/stderr to complete
<-e.doneIO
return int(waitBody.StatusCode), nil
// wait for stdout/stderr to complete
<-e.doneIO
return int(waitBody.StatusCode), nil