-
Notifications
You must be signed in to change notification settings - Fork 27
/
Makefile
38 lines (30 loc) · 934 Bytes
/
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
IMAGE := nhits
ROOT := $(shell dirname $(realpath $(firstword ${MAKEFILE_LIST})))
PARENT_ROOT := $(shell dirname ${ROOT})
PORT := 8888
DOCKER_PARAMETERS := \
--user $(shell id -u) \
-v ${ROOT}:/app \
-w /app \
-e HOME=/tmp
ifdef gpu
DOCKER_PARAMETERS += --gpus all
endif
init:
docker build -t ${IMAGE} .
get_dataset:
$(MAKE) run_module module="mkdir -p data/"
$(MAKE) run_module module="wget -O data/datasets.zip https://nhits-experiments.s3.amazonaws.com/datasets.zip"
$(MAKE) run_module module="unzip data/datasets.zip -d data/"
jupyter:
docker run -d --rm ${DOCKER_PARAMETERS} -e HOME=/tmp -p ${PORT}:8888 ${IMAGE} \
bash -c "jupyter lab --ip=0.0.0.0 --no-browser --NotebookApp.token=''"
run_module: .require-module
docker run -i --rm ${DOCKER_PARAMETERS} \
${IMAGE} ${module}
bash_docker:
docker run -it --rm ${DOCKER_PARAMETERS} ${IMAGE}
.require-module:
ifndef module
$(error module is required)
endif