-
Notifications
You must be signed in to change notification settings - Fork 68
/
makefile
82 lines (63 loc) · 2.22 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
72
73
74
75
76
77
78
79
80
81
DOCKER_REPOSITORY := shibui/ml-system-in-actions
ABSOLUTE_PATH := $(shell pwd)
DOCKERFILE := Dockerfile
DOCKER_COMPOSE := docker-compose.yml
IMAGE_VERSION := 0.0.1
SYNC_ASYNC_PATTERN := sync_async_pattern
SYNC_ASYNC_PATTERN_PROXY := sync_async_proxy
SYNC_ASYNC_PATTERN_PROXY_PORT := 8000
SYNC_ASYNC_PATTERN_SYNC_MODEL := imagenet_mobilenet_v2
SYNC_ASYNC_PATTERN_SYNC_GRPC_PORT := 8500
SYNC_ASYNC_PATTERN_SYNC_REST_PORT := 8501
SYNC_ASYNC_PATTERN_ASYNC_MODEL := imagenet_inception_v3
SYNC_ASYNC_PATTERN_ASYNC_GRPC_PORT := 8600
SYNC_ASYNC_PATTERN_ASYNC_REST_PORT := 8601
SYNC_ASYNC_PATTERN_BACKEND := sync_async_backend
.PHONY: build_proxy
build_proxy:
docker build \
-t $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_PROXY)_$(IMAGE_VERSION) \
-f ./$(DOCKERFILE).proxy .
.PHONY: push_proxy
push_proxy:
docker push $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_PROXY)_$(IMAGE_VERSION)
.PHONY: build_sync
build_sync:
docker build \
-t $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_SYNC_MODEL)_$(IMAGE_VERSION) \
-f ./$(SYNC_ASYNC_PATTERN_SYNC_MODEL)/$(DOCKERFILE) .
.PHONY: push_sync
push_sync:
docker push $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_SYNC_MODEL)_$(IMAGE_VERSION)
.PHONY: build_async
build_async:
docker build \
-t $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_ASYNC_MODEL)_$(IMAGE_VERSION) \
-f ./$(SYNC_ASYNC_PATTERN_ASYNC_MODEL)/$(DOCKERFILE) .
.PHONY: push_async
push_async:
docker push $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_ASYNC_MODEL)_$(IMAGE_VERSION)
.PHONY: build_backend
build_backend:
docker build \
-t $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_BACKEND)_$(IMAGE_VERSION) \
-f ./$(DOCKERFILE).backend .
.PHONY: push_backend
push_backend:
docker push $(DOCKER_REPOSITORY):$(SYNC_ASYNC_PATTERN)_$(SYNC_ASYNC_PATTERN_BACKEND)_$(IMAGE_VERSION)
.PHONY: build_all
build_all: build_proxy build_sync build_async build_backend
.PHONY: push_all
push_all: push_proxy push_sync push_async push_backend
.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