forked from alathon/torch-rnn-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.no_cuda
36 lines (25 loc) · 1.12 KB
/
Makefile.no_cuda
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
mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
DATA_DIR ?= $(dir $(mkfile_path))data
DOCKER_FLAGS ?=-it
MODEL_NAME ?= "invalid-model.t7"
# You probably shouldn't touch these
SERVE_CMD=th /opt/server/server.lua -checkpoint '$(MOUNT_NAME)/checkpoints/$(MODEL_NAME)' -gpu_backend cpu
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-no-cuda -f Dockerfile.base_no_cuda .
build-torch: build-base
docker build -t diku-hcc/torch-no-cuda -f Dockerfile.torch_no_cuda .
build-server: build-base build-torch
docker build -t diku-hcc/server-no-cuda -f Dockerfile.server_no_cuda .
build-preprocess:
docker build -t diku-hcc/preprocess -f Dockerfile.preprocess .
torch:
docker run $(MOUNT) $(DOCKER_FLAGS) diku-hcc/torch-no-cuda:latest $(CMD)
server:
docker run $(MOUNT) $(DOCKER_FLAGS) diku-hcc/server-no-cuda:latest $(CMD)
serve:
docker run -p 8080:8080 $(MOUNT) $(DOCKER_FLAGS) diku-hcc/server-no-cuda:latest $(SERVE_CMD)
preprocess:
docker run $(MOUNT) $(DOCKER_FLAGS) diku-hcc/preprocess:latest $(CMD)