-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathmakefile
More file actions
69 lines (53 loc) · 1.47 KB
/
makefile
File metadata and controls
69 lines (53 loc) · 1.47 KB
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
DOCKER_REPOSITORY := shibui/ml-system-in-actions
ABSOLUTE_PATH := $(shell pwd)
DOCKERFILE := Dockerfile
DOCKER_COMPOSE := docker-compose.yml
IMAGE_VERSION := 0.0.1
DATA_CACHE_PATTERN := data_cache_pattern
DATA_CACHE_PATTERN_PREP := proxy
DATA_CACHE_PATTERN_PREP_PORT := 8000
DATA_CACHE_PATTERN_PRED := pred
DATA_CACHE_PATTERN_REST_PORT := 8001
DATA_CACHE_PATTERN_GRPC_PORT := 50051
.PHONY: proto
proto:
python \
-m grpc_tools.protoc \
-I src/proto \
--python_out=src/proto \
--grpc_python_out=src/proto \
src/proto/onnx-ml.proto \
src/proto/predict.proto \
src/proto/prediction_service.proto
.PHONY: build_proxy
build_proxy:
docker build \
-t $(DOCKER_REPOSITORY):$(DATA_CACHE_PATTERN)_$(DATA_CACHE_PATTERN_PREP)_$(IMAGE_VERSION) \
-f ./$(DOCKERFILE).proxy .
.PHONY: push_proxy
push_proxy:
docker push $(DOCKER_REPOSITORY):$(DATA_CACHE_PATTERN)_$(DATA_CACHE_PATTERN_PREP)_$(IMAGE_VERSION)
.PHONY: build_pred
build_pred:
docker build \
-t $(DOCKER_REPOSITORY):$(DATA_CACHE_PATTERN)_$(DATA_CACHE_PATTERN_PRED)_$(IMAGE_VERSION) \
-f ./$(DOCKERFILE).pred .
.PHONY: push_pred
push_pred:
docker push $(DOCKER_REPOSITORY):$(DATA_CACHE_PATTERN)_$(DATA_CACHE_PATTERN_PRED)_$(IMAGE_VERSION)
.PHONY: build_all
build_all: build_proxy build_pred
.PHONY: push_all
push_all: push_proxy push_pred
.PHONY: c_build
c_build: build_all
.PHONY: c_up
c_up:
docker-compose \
-f ./$(DOCKER_COMPOSE) \
up -d
.PHONY: c_down
c_down:
docker-compose \
-f ./$(DOCKER_COMPOSE) \
down