forked from SeldonIO/MLServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (70 loc) · 1.77 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
SHELL := /bin/bash
VERSION := $(shell sed 's/^__version__ = "\(.*\)"/\1/' ./mlserver/version.py)
IMAGE_NAME := seldonio/mlserver
.PHONY: install-dev _generate generate run build \
push-test push test lint fmt version clean licenses
install-dev:
pip install -r requirements/dev.txt
for _runtime in ./runtimes/*; \
do \
pip install --editable $$_runtime; \
if [[ -f $$_runtime/requirements/dev.txt ]]; \
then \
pip install -r $$_runtime/requirements/dev.txt; \
fi \
done
pip install --editable .
pip install -r ./requirements/docker.txt
_generate: # "private" target to call `fmt` after `generate`
./hack/generate-types.sh
generate: | _generate fmt
run:
mlserver start \
./tests/testdata
build: clean
./hack/build-images.sh ${VERSION}
./hack/build-wheels.sh ./dist
clean:
rm -rf ./dist ./build *.egg-info
for _runtime in ./runtimes/*; \
do \
rm -rf $$_runtime/dist; \
rm -rf $$_runtime/build; \
rm -rf $$_runtime/*.egg-info; \
done
push-test:
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
push:
twine upload dist/*
docker push ${IMAGE_NAME}:${VERSION}
docker push ${IMAGE_NAME}:${VERSION}-slim
for _runtime in ./runtimes/*; \
do \
_runtimeName=$$(basename $$_runtime); \
docker push ${IMAGE_NAME}:${VERSION}-$$_runtimeName; \
done
test:
tox
lint: generate
flake8 .
mypy ./mlserver
for _runtime in ./runtimes/*; \
do \
mypy $$_runtime || exit 1; \
done
mypy ./benchmarking
mypy ./docs/examples
# Check if something has changed after generation
git \
--no-pager diff \
--exit-code \
.
licenses:
tox --recreate -e licenses
cut -d, -f1,3 ./licenses/license_info.csv \
> ./licenses/license_info.no_versions.csv
fmt:
black . \
--exclude "/(\.tox.*|mlserver/grpc/dataplane_pb2.*|venv.*)/"
version:
@echo ${VERSION}