forked from alathon/torch-rnn-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 1.18 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
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
DATA_DIR ?= $(dir $(mkfile_path))data
DOCKER_FLAGS ?=-i
MODEL_NAME ?= "invalid-model.t7"
RUNTIME ?= --runtime=nvidia
# You probably shouldn't touch these
SERVE_CMD=th /opt/server/server.lua -checkpoint '$(MOUNT_NAME)/checkpoints/$(MODEL_NAME)'
MOUNT_NAME=/data
MOUNT=-v $(DATA_DIR):$(MOUNT_NAME)
.PHONY: build-base build-server build-torch build-preprocess preprocess server torch
build-base:
docker build -t diku-hcc/base -f Dockerfile.base .
build-torch: build-base
docker build -t diku-hcc/torch -f Dockerfile.torch .
build-server: build-base build-torch
docker build -t diku-hcc/server -f Dockerfile.server .
build-preprocess:
docker build -t diku-hcc/preprocess -f Dockerfile.preprocess .
torch:
docker run $(RUNTIME) $(MOUNT) $(DOCKER_FLAGS) -w /opt/torch -t diku-hcc/torch:latest $(CMD)
server:
docker run $(RUNTIME) $(MOUNT) $(DOCKER_FLAGS) -w /opt/server -t diku-hcc/server:latest $(CMD)
serve:
docker run $(RUNTIME) -p 8080:8080 $(MOUNT) $(DOCKER_FLAGS) -w /opt/server -t diku-hcc/server:latest $(SERVE_CMD)
preprocess:
docker run $(RUNTIME) $(MOUNT) $(DOCKER_FLAGS) -w /opt/preprocess -t diku-hcc/preprocess:latest $(CMD)