Skip to content

Commit

Permalink
define env var in compose file to restrict gpus
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder committed Apr 26, 2018
1 parent 2d75f5a commit a929661
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 14 deletions.
5 changes: 0 additions & 5 deletions docker/tools/visualize/Dockerfile.tf1_3_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 2 additions & 1 deletion docker/tools/visualize/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 0 additions & 2 deletions docker/train/tensorflow-fold/Dockerfile.tf1_3_cpu_mkl
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

5 changes: 0 additions & 5 deletions docker/train/tensorflow-fold/Dockerfile.tf1_3_gpu
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

3 changes: 2 additions & 1 deletion docker/train/tensorflow-fold/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a929661

Please sign in to comment.