-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile
56 lines (47 loc) · 1.29 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Handy commands:
# - `make docker-build`: builds DOCKERIMAGE
PROJECT ?= permatrack
WORKSPACE ?= /workspace/$(PROJECT)
DOCKER_IMAGE ?= ${PROJECT}:latest
SHMSIZE ?= 444G
DOCKER_OPTS := \
--name ${PROJECT} \
--rm -it \
--shm-size=${SHMSIZE} \
-e AWS_DEFAULT_REGION \
-e AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY \
-e HOST_HOSTNAME= \
-e NCCL_DEBUG=VERSION \
-e DISPLAY=${DISPLAY} \
-e XAUTHORITY \
-e NVIDIA_DRIVER_CAPABILITIES=all \
-v ~/.aws:/root/.aws \
-v /root/.ssh:/root/.ssh \
-v ~/.cache:/root/.cache \
-v /data:/data \
-v /mnt/fsx/:/mnt/fsx \
-v /dev/null:/dev/raw1394 \
-v /tmp:/tmp \
-v /tmp/.X11-unix/X0:/tmp/.X11-unix/X0 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${PWD}:${WORKSPACE} \
-w ${WORKSPACE} \
--privileged \
--ipc=host \
--network=host
NGPUS=$(shell nvidia-smi -L | wc -l)
.PHONY: all clean docker-build
all: clean
clean:
find . -name "*.pyc" | xargs rm -f && \
find . -name "__pycache__" | xargs rm -rf
docker-build:
docker build \
-f docker/Dockerfile \
-t ${DOCKER_IMAGE} .
docker-start-interactive: docker-build
nvidia-docker run ${DOCKER_OPTS} ${DOCKER_IMAGE} bash
docker-run: docker-build
nvidia-docker run ${DOCKER_OPTS} ${DOCKER_IMAGE} \
bash -c "${COMMAND}"