From a929661362a02093e0bdad399c5eb5ad05a28e4f Mon Sep 17 00:00:00 2001 From: Arne Binder Date: Thu, 26 Apr 2018 16:51:14 +0200 Subject: [PATCH] define env var in compose file to restrict gpus --- docker/tools/visualize/Dockerfile.tf1_3_gpu | 5 ----- docker/tools/visualize/docker-compose.yml | 3 ++- docker/train/tensorflow-fold/Dockerfile.tf1_3_cpu_mkl | 2 -- docker/train/tensorflow-fold/Dockerfile.tf1_3_gpu | 5 ----- docker/train/tensorflow-fold/docker-compose.yml | 3 ++- 5 files changed, 4 insertions(+), 14 deletions(-) diff --git a/docker/tools/visualize/Dockerfile.tf1_3_gpu b/docker/tools/visualize/Dockerfile.tf1_3_gpu index 623522d..2e67252 100644 --- a/docker/tools/visualize/Dockerfile.tf1_3_gpu +++ b/docker/tools/visualize/Dockerfile.tf1_3_gpu @@ -170,8 +170,3 @@ VOLUME /root/train VOLUME /root/corpora_out #ENTRYPOINT ["/root/recursive-embedding/set-user-with-folder.sh", "/root/train", "python", "train_fold.py"] - -# pass as env variable -ARG _NVIDIA_VISIBLE_DEVICES=0 -RUN echo NVIDIA_VISIBLE_DEVICES="$_NVIDIA_VISIBLE_DEVICES" -ENV NVIDIA_VISIBLE_DEVICES="$_NVIDIA_VISIBLE_DEVICES" diff --git a/docker/tools/visualize/docker-compose.yml b/docker/tools/visualize/docker-compose.yml index 1a3210f..a454d5a 100644 --- a/docker/tools/visualize/docker-compose.yml +++ b/docker/tools/visualize/docker-compose.yml @@ -8,7 +8,8 @@ services: args: OWN_LOCATION: docker/tools/visualize PROJECT_ROOT: /root/recursive-embedding - _NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES} + environment: + - NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES} ports: - ${HOST_PORT}:5000 volumes: diff --git a/docker/train/tensorflow-fold/Dockerfile.tf1_3_cpu_mkl b/docker/train/tensorflow-fold/Dockerfile.tf1_3_cpu_mkl index 6624968..91efd3a 100644 --- a/docker/train/tensorflow-fold/Dockerfile.tf1_3_cpu_mkl +++ b/docker/train/tensorflow-fold/Dockerfile.tf1_3_cpu_mkl @@ -120,7 +120,5 @@ EXPOSE 8888 VOLUME /root/train -ENV NVIDIA_VISIBLE_DEVICES="" - ENTRYPOINT ["/root/set-user-with-folder.sh", "/root/train", "python", "train_fold.py"] diff --git a/docker/train/tensorflow-fold/Dockerfile.tf1_3_gpu b/docker/train/tensorflow-fold/Dockerfile.tf1_3_gpu index e4999a2..6b609eb 100644 --- a/docker/train/tensorflow-fold/Dockerfile.tf1_3_gpu +++ b/docker/train/tensorflow-fold/Dockerfile.tf1_3_gpu @@ -160,10 +160,5 @@ WORKDIR "$PROJECT_ROOT"/src VOLUME /root/train -# pass as env variable -ARG _NVIDIA_VISIBLE_DEVICES=0 -RUN echo NVIDIA_VISIBLE_DEVICES="$_NVIDIA_VISIBLE_DEVICES" -ENV NVIDIA_VISIBLE_DEVICES="$_NVIDIA_VISIBLE_DEVICES" - ENTRYPOINT ["/root/set-user-with-folder.sh", "/root/train", "python", "train_fold.py"] diff --git a/docker/train/tensorflow-fold/docker-compose.yml b/docker/train/tensorflow-fold/docker-compose.yml index 4912270..3d8b985 100644 --- a/docker/train/tensorflow-fold/docker-compose.yml +++ b/docker/train/tensorflow-fold/docker-compose.yml @@ -8,7 +8,8 @@ services: args: OWN_LOCATION: docker/train/tensorflow-fold PROJECT_ROOT: /root/recursive-embedding - _NVIDIA_VISIBLE_DEVICES: ${NVIDIA_VISIBLE_DEVICES} + environment: + - NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES} image: tensorflowfold:${DOCKERFILE_EXT} volumes: - ../../../src:/root/recursive-embedding/src