forked from SeldonIO/MLServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (80 loc) · 1.9 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
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:
poetry install --sync --with all-runtimes --with all-runtimes-dev
lock:
echo "Locking mlserver deps..."
poetry lock
for _runtime in ./runtimes/*; \
do \
echo "Locking $$_runtime deps..."; \
poetry lock -C $$_runtime; \
done
_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 .tox
for _runtime in ./runtimes/*; \
do \
rm -rf \
$$_runtime/dist \
$$_runtime/build \
$$_runtime/*.egg-info \
$$_runtime/.tox; \
done
push-test:
poetry config repositories.pypi-test https://test.pypi.org/legacy/
poetry publish -r pypi-test
for _runtime in ./runtimes/*; \
do \
poetry publish -C $$_runtime -r pypi-test; \
done
push:
poetry publish
docker push ${IMAGE_NAME}:${VERSION}
docker push ${IMAGE_NAME}:${VERSION}-slim
for _runtime in ./runtimes/*; \
do \
_runtimeName=$$(basename $$_runtime); \
poetry publish --skip-existing -C $$_runtime; \
docker push ${IMAGE_NAME}:${VERSION}-$$_runtimeName; \
done
test:
tox
for _runtime in ./runtimes/*; \
do \
tox -c $$_runtime; \
done
lint: generate
black --check .
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 .
version:
@echo ${VERSION}