-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
66 lines (52 loc) · 2.17 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
57
58
59
60
61
62
63
64
65
66
# make appropriate changes before running the scripts
# START OF CONFIG =====================================================================================================
IMAGE_TF2=azmfaridee/dl:tf2
IMAGE_PT=azmfaridee/dl:pt
CONTAINER=yourname_projectname
# index starts at 1
AVAILABLE_GPUS='1,2'
LOCAL_JUPYTER_PORT=48888
LOCAL_TENSORBOARD_PORT=46006
VSCODE_PORT=48443
MATLAB_PORT=46080
PASSWORD=your_vscode_and_jupyter_pass
# END OF CONFIG ======================================================================================================
docker-resume:
docker start -ai $(CONTAINER)
docker-run:
# docker image pull $(IMAGE_TF2)
docker run --restart always --gpus $(AVAILABLE_GPUS) \
-it -e PASSWORD=$(PASSWORD) -e JUPYTER_TOKEN=$(PASSWORD) \
-p $(VSCODE_PORT):8443 -p $(LOCAL_JUPYTER_PORT):8888 -p $(LOCAL_TENSORBOARD_PORT):6006 \
-v $(shell pwd):/notebooks --name $(CONTAINER) $(IMAGE_TF2)
docker-run-pt:
# docker image pull $(IMAGE_PT)
docker run --restart always --gpus $(AVAILABLE_GPUS) \
-it -e PASSWORD=$(PASSWORD) -e JUPYTER_TOKEN=$(PASSWORD) \
-p $(VSCODE_PORT):8443 -p $(LOCAL_JUPYTER_PORT):8888 -p $(LOCAL_TENSORBOARD_PORT):6006 \
-v $(shell pwd):/notebooks --name $(CONTAINER) $(IMAGE_PT)
docker-stop:
docker stop $(CONTAINER)
docker-shell:
docker exec -it $(CONTAINER) bash
docker-clean:
docker rm $(CONTAINER)
docker-build:
docker build -t $(IMAGE_TF2) -f Dockerfile .
docker build -t $(IMAGE_PT) -f Dockerfile.pytorch .
docker-rebuild:
docker build -t $(IMAGE_TF2) -f Dockerfile --no-cache --pull .
docker build -t $(IMAGE_PT) -f Dockerfile.pytorch --no-cache --pull .
docker-push:
docker push $(IMAGE_TF2)
docker push $(IMAGE_PT)
docker-tensorboard:
docker exec -it $(CONTAINER) tensorboard --logdir=logs
docker-vscode:
docker exec -it $(CONTAINER) code-server --bind-addr 0.0.0.0:8443 --auth password --disable-telemetry /notebooks
docker-matlab-run:
docker run --gpus '"device=$(AVAILABLE_GPUS)"' \
-it -e PASSWORD=$(PASSWORD) -p $(MATLAB_PORT):6080 \
--shm-size=512M -e MLM_LICENSE_FILE=<port id>@<location> \
-v $(shell pwd):/notebooks --name matlab_test nvcr.io/partners/matlab:r2020a
# Replace the port and location for network license