-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (58 loc) · 1.52 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
67
68
69
70
71
PROJ_NAME=obb
CONTAINER_NAME=${PROJ_NAME}-${USER}
ifndef DS_VOLUME
DS_VOLUME=/share
endif
ifndef NB_PORT
NB_PORT=8888
endif
ifndef MLF_PORT
MLF_PORT=5000
endif
help:
@echo "build -- builds the docker image"
@echo "dockershell -- raises an interactive shell docker"
@echo "notebookshell -- launches a notebook server"
@echo "mlflow -- launches an mlflow server"
build:
docker build --no-cache -t $(PROJ_NAME) .
dockershell:
docker run --shm-size="16g" --rm --name ${CONTAINER_NAME} --gpus all \
-v $(shell pwd):/work -v $(DS_VOLUME):/data \
-p 9197:9197 \
-p ${MLF_PORT}:${MLF_PORT} \
-p ${NB_PORT}:${NB_PORT} \
-it $(PROJ_NAME)
notebookshell:
docker run --shm-size="16g" --gpus all --privileged -itd --rm --name $(CONTAINER_NAME)-nb \
-p ${NB_PORT}:${NB_PORT} \
-v $(shell pwd):/work -v $(DS_VOLUME):/data \
$(PROJ_NAME) \
jupyter lab \
--NotebookApp.token='obb' \
--no-browser \
--ip=0.0.0.0 \
--allow-root \
--port=${NB_PORT}
mlflow:
docker run --privileged -itd --rm --name $(CONTAINER_NAME) \
-p ${MLF_PORT}:${MLF_PORT} \
-v $(shell pwd):/work \
-v $(DS_VOLUME):/data \
$(PROJ_NAME) \
mlflow ui --host 0.0.0.0:$(MLF_PORT)
nbstop:
docker exec -d --privileged $(CONTAINER_NAME) \
jupyter lab stop ${NB_PORT}
nbexec:
docker exec -d --privileged $(CONTAINER_NAME) \
jupyter lab \
--NotebookApp.token='obb' \
--no-browser \
--ip=0.0.0.0 \
--allow-root \
--port=${NB_PORT}
mlfexec:
docker exec -d $(CONTAINER_NAME) mlflow ui --host 0.0.0.0:$(MLF_PORT)
execshell:
docker exec -it ${CONTAINER_NAME} /bin/bash