-
Notifications
You must be signed in to change notification settings - Fork 18
/
Makefile
165 lines (133 loc) · 4.81 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
# Copyright © 2022 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause
.PHONY: run-portainer run-base run-vap run-full all simulator docker test lint
REPOS=cv-region-of-interest device-scale event-reconciler loss-detector product-lookup
GOREPOS=device-scale event-reconciler loss-detector product-lookup
.PHONY: $(REPOS)
DOCKER_TAG=dev
STACK_NAME=loss-detection
docker-rm:
-docker rm $$(docker ps -aq)
clean-docker: docker-rm
docker volume prune -f && \
docker network prune -f
run-portainer:
cd ./loss-detection-app && docker compose -p portainer -f docker-compose.portainer.yml up -d
run-edgex:
cd ./loss-detection-app && docker compose -p ${STACK_NAME} -f docker-compose.edgex.yml up -d
run-base:
cd ./loss-detection-app && \
docker compose -p ${STACK_NAME} -f docker-compose.edgex.yml -f docker-compose.loss-detection.yml up -d
run-vap: models
cd ./loss-detection-app && \
docker compose -p ${STACK_NAME} -f docker-compose.edgex.yml -f docker-compose.loss-detection.yml -f docker-compose.vap.yml up -d
run-ovms:
cd ./loss-detection-app && docker compose -p ${STACK_NAME} -f docker-compose-ovms.yml up -d
run-vap-ovms: run-ovms
cd ./loss-detection-app && \
docker compose -p ${STACK_NAME} -f docker-compose.edgex.yml -f docker-compose.loss-detection.yml -f docker-compose.vap.yml up -d
run-full: run-vap
down:
cd ./loss-detection-app && \
docker compose -p ${STACK_NAME} -f docker-compose.edgex.yml -f docker-compose.loss-detection.yml -f docker-compose.vap.yml -f docker-compose-ovms.yml down -v
down-ovms:
cd ./loss-detection-app && \
docker compose -p ${STACK_NAME} -f docker-compose-ovms.yml down -v
down-portainer:
cd ./loss-detection-app && docker compose -p portainer -f docker-compose.portainer.yml down
models:
if [ ! -d pipeline-server ] ; then git clone https://github.com/dlstreamer/pipeline-server; fi && \
cd pipeline-server && \
git checkout 2022.2.0 && \
mkdir -p ./loss-detection-app/models && \
./tools/model_downloader/model_downloader.sh --model-list $(shell pwd)/loss-detection-app/models.yml --output $(shell pwd)/loss-detection-app
clean-deps:
rm -rf video-analytics-serving
all: simulator docker
simulator:
cd rtsf-at-checkout-event-simulator; \
go build -o event-simulator
clean: down clean-deps
rm -f rtsf-at-checkout-event-simulator/event-simulator && \
docker rmi $$(docker images | grep rtsf-at-checkout | awk '{print $$3}') && \
docker volume prune -f && \
docker network prune -f
docker:
for repo in ${REPOS}; do \
echo rtsf-at-checkout-$$repo; \
cd rtsf-at-checkout-$$repo; \
docker build --rm \
--build-arg http_proxy \
--build-arg https_proxy \
-f Dockerfile \
-t rtsf-at-checkout/$$repo:$(DOCKER_TAG) \
. || exit 1; \
cd ..; \
done
go-test:
for repo in ${GOREPOS}; do \
echo rtsf-at-checkout-$$repo; \
cd rtsf-at-checkout-$$repo; \
go test -tags no_zmq -coverprofile=coverage.out ./... || exit 1; \
cd ..; \
done
go-lint: go-tidy
@which golangci-lint >/dev/null || echo "WARNING: go linter not installed. To install, run make install-lint"
@which golangci-lint >/dev/null ; echo "running golangci-lint"; golangci-lint version; go version;
for repo in ${GOREPOS}; do \
echo rtsf-at-checkout-$$repo; \
cd rtsf-at-checkout-$$repo; \
golangci-lint run --config ../.github/.golangci.yml --out-format=line-number >> ../goLintResults.txt ; \
cd ..; \
done
go-tidy:
for repo in ${GOREPOS}; do \
echo rtsf-at-checkout-$$repo; \
cd rtsf-at-checkout-$$repo; \
go mod tidy || exit 1; \
cd ..; \
done
install-go-lint:
sudo curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sudo sh -s -- -b $$(go env GOPATH)/bin v1.54.2
hadolint:
docker run --rm -v $(pwd):/repo -i hadolint/hadolint:latest-alpine sh -c "cd /repo && hadolint -f json ./**/Dockerfile" > go-hadolint.json
cv-roi:
cd rtsf-at-checkout-cv-region-of-interest; \
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f ./Dockerfile \
-t rtsf-at-checkout/cv-region-of-interest:$(DOCKER_TAG) \
.
device-scale:
cd rtsf-at-checkout-device-scale; \
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f Dockerfile \
-t rtsf-at-checkout/device-scale:$(DOCKER_TAG) \
.
reconciler:
cd rtsf-at-checkout-event-reconciler; \
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f Dockerfile \
-t rtsf-at-checkout/event-reconciler:$(DOCKER_TAG) \
.
loss-detector:
cd rtsf-at-checkout-loss-detector; \
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f Dockerfile \
-t rtsf-at-checkout/loss-detector:$(DOCKER_TAG) \
.
product-lookup:
cd rtsf-at-checkout-product-lookup; \
docker build \
--build-arg http_proxy \
--build-arg https_proxy \
-f Dockerfile \
-t rtsf-at-checkout/product-lookup:$(DOCKER_TAG) \
.