-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
180 lines (137 loc) · 3.83 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
PROJECT=beta-platform
OS_TYPE=$(shell uname -a)
BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
GITCOMMIT=$(shell git rev-parse HEAD)
BUILDDATE=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
MAJOR=0
MINOR=0
PATCH=3
REVISION=alpha
VERSION=v$(MAJOR).$(MINOR).$(PATCH)
GOVERSION=1.11
LONGVERSION=v$(MAJOR).$(MINOR).$(PATCH)-$(REVISION)
CWD=$(shell pwd)
VPATH=github.com/medtune/capsul/pkg
PROJECTPATH=$(CWD)
AUTHORS=Hilaly.Mohammed-Amine/El.bouchti.Alaa
OWNERS=$(AUTHORS)
LICENSETYPE=Apache-v2.0
LICENSEURL=https://raw.githubusercontent.com/medtune/capsul/master/LICENSE.txt
CONTAINER_ENGINE=docker
GOCMD=go
GOVERSION=$(GOCMD) version
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME) -v $(BINARY_FILE)
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
test-clean:
rm -f test/testdata/*_cam.png
# build base container image
# does not compile binaries
build-base:
@echo building base capsul library ...
docker build \
-t medtune/capsul:base \
-f build/base.Dockerfile \
.
# build capsul package and tag version/latest
capsul: build-base
docker tag medtune/capsul:base medtune/capsul:$(VERSION)
docker tag medtune/capsul:base medtune/capsul:latest
# alias capsul
capsul-base: capsul
# build capsul command line tool
build-cmd:
@echo building base capsul library ...
docker build \
-t medtune/capsul:cmd \
-f build/cmd.Dockerfile \
.
# build capsul cmd & tag version/latest
capsul-cmd: build-cmd
docker tag medtune/capsul:cmd medtune/capsul:cmd-$(VERSION)
docker tag medtune/capsul:cmd medtune/capsul:cmd-latest
# Build mnist tf server image
build-mnist:
@echo building model capsul mnist ...
docker build \
-t medtune/capsul:mnist \
-f build/capsules/mnist.Dockerfile \
.
# Build inception tf server image
build-inception:
@echo building model capsul inception ...
docker build \
-t medtune/capsul:inception \
-f build/capsules/inception.Dockerfile \
.
# Build mura inception restnet v2 tf server image
build-mura-irn-v2:
@echo building model capsul mura inception resnet v2 ...
docker build \
-t medtune/capsul:mura-irn-v2 \
-f build/capsules/mura_irn_v2.Dockerfile \
.
# Build mura mobilenet v2 tf server image
build-mura-mn-v2:
@echo building model capsul mura mobilenet v2 ...
docker build \
-t medtune/capsul:mura-mn-v2 \
-f build/capsules/mura_mobilenet_v2.Dockerfile \
.
# Build mura mobile net grad cam customized server
build-mura-mn-v2-cam:
@echo building grad cam server for mura mobilenet v2
docker build \
-t medtune/capsul:mura-mn-v2-cam \
-f build/csflask/mura_mn_v2_cam.Dockerfile \
.
# build mura main image
build-mura: build-mura-mn-v2
@echo taging mura-mn-v2 with mura
docker tag medtune/capsul:mura-mn-v2 medtune/capsul:mura
# Build mura
build-mura-cam: build-mura-mn-v2-cam
@echo building model capsul mura-cam ...
docker tag medtune/capsul:mura-mn-v2-cam medtune/capsul:mura-cam
# Build chexray mobilenet v2
build-chexray-mn-v2:
docker build \
-t medtune/capsul:chexray-mn-v2 \
-f build/capsules/chexray_mobilenet_v2.Dockerfile \
.
# Build chexray mobilenet v2 grad cam
build-chexray-mn-v2-cam:
docker build \
-t medtune/capsul:chexray-mn-v2 \
-f build/csflask/chexray_mobilenet_v2_cam.Dockerfile \
.
# Build chexray densenet 121
build-chexray-dn-121:
@echo building model capsul chexray densenet 121 ...
docker build \
-t medtune/capsul:chexray-dn-121 \
-f build/capsules/chexray_densenet_121.Dockerfile \
.
# Build chexray
build-chexray-pp:
docker build \
-t medtune/capsul:chexray-pp-helper \
-f build/csflask/chexray_pp.Dockerfile \
.
# Build csflask
build-csflask: build-mura-mn-v2-cam \
build-chexray-pp
# Build capsules
build-capsules: build-mnist \
build-inception \
build-mura-mn-v2 \
build-mura-irn-v2 \
build-chexray-dn-121