forked from SeldonIO/MLServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
113 lines (92 loc) · 2.42 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
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
.PHONY: bootstrap-test
bootstrap-test:
for _runtime in ./runtimes/*; \
do \
echo "Copying Tox configuration to $$_runtime..."; \
cp tox.runtime.ini $$_runtime/tox.ini; \
done
install-dev:
poetry install --sync --with all-runtimes --with all-runtimes-dev
lock:
echo "Locking mlserver deps..."
poetry lock --no-update
for _runtime in ./runtimes/*; \
do \
echo "Locking $$_runtime deps..."; \
poetry lock --no-update -C $$_runtime; \
done
_generate_model_repository: # "private" target to call `fmt` after `generate`
poetry run bash ./hack/generate-types.sh model_repository
_generate_dataplane: # "private" target to call `fmt` after `generate`
poetry run bash ./hack/generate-types.sh dataplane
generate-model-repository: | _generate_model_repository fmt
generate-dataplane: | _generate_dataplane fmt
generate: | _generate_model_repository _generate_dataplane 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:
black --check .
flake8 .
mypy ./mlserver
for _runtime in ./runtimes/*; \
do \
mypy $$_runtime || exit 1; \
done
mypy ./benchmarking
mypy ./docs/examples
lint-no-changes:
git \
--no-pager diff \
--exit-code \
.
lint-generate: generate lint-no-changes
licenses:
tox --recreate -e licenses
cut -d, -f1,3 ./licenses/license_info.csv \
> ./licenses/license_info.no_versions.csv
fmt:
poetry run black .
version:
@echo ${VERSION}