forked from NVIDIA/modulus-sym
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (48 loc) · 1.65 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
install:
pip install --upgrade pip && \
pip install -e .
setup-ci:
pip install pre-commit && \
pre-commit install
black:
pre-commit run black -a
interrogate:
# pre-commit run interrogate -a
echo "Interrogate CI stage not currently implemented"
lint:
# pre-commit run markdownlint -a
echo "Lint CI stage not currently implemented"
license:
pre-commit run license -a
doctest:
# coverage run \
# --rcfile='test/coverage.docstring.rc' \
# -m pytest \
# --doctest-modules modulus/ --ignore-glob=*internal*
echo "Doctest CI stage not currently implemented"
pytest:
coverage run \
--rcfile='test/coverage.pytest.rc' \
-m pytest test/
coverage:
coverage combine && \
coverage report --show-missing --omit=*test* --omit=*internal* --fail-under=50 && \
coverage html
# For arch naming conventions, refer
# https://docs.docker.com/build/building/multi-platform/
# https://github.com/containerd/containerd/blob/v1.4.3/platforms/platforms.go#L86
ARCH := $(shell uname -p)
ifeq ($(ARCH), x86_64)
TARGETPLATFORM := "linux/amd64"
else ifeq ($(ARCH), aarch64)
TARGETPLATFORM := "linux/arm64"
else
$(error Unknown CPU architecture ${ARCH} detected)
endif
MODULUS_SYM_GIT_HASH = $(shell git rev-parse --short HEAD)
container-deploy:
docker build -t modulus-sym:deploy --build-arg TARGETPLATFORM=${TARGETPLATFORM} --build-arg MODULUS_SYM_GIT_HASH=${MODULUS_SYM_GIT_HASH} --target deploy -f Dockerfile .
container-ci:
docker build -t modulus-sym:ci --build-arg TARGETPLATFORM=${TARGETPLATFORM} --target ci -f Dockerfile .
container-docs:
docker build -t modulus-sym:docs --build-arg TARGETPLATFORM=${TARGETPLATFORM} --target docs -f Dockerfile .