-
Notifications
You must be signed in to change notification settings - Fork 249
/
Makefile
77 lines (59 loc) · 1.99 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
install:
pip install --upgrade pip && \
pip install -e .
editable-install:
pip install --upgrade pip && \
pip install -e .[dev] --config-settings editable_mode=strict
get-data:
mkdir -p /data && \
mkdir -p /data/nfs/ && \
git -C /data/nfs/modulus-data pull || \
git clone https://gitlab-master.nvidia.com/modulus/modulus-data.git /data/nfs/modulus-data
setup-ci:
pip install pre-commit && \
pre-commit install
black:
pre-commit run black -a
interrogate:
pre-commit run interrogate -a
lint:
pre-commit run markdownlint -a && \
pre-commit run ruff -a && \
pre-commit run check-added-large-files -a
license:
pre-commit run license -a
doctest:
coverage run \
--rcfile='test/coverage.docstring.rc' \
-m pytest \
--doctest-modules modulus/ --ignore-glob=*internal* --ignore-glob=*experimental*
pytest:
coverage run \
--rcfile='test/coverage.pytest.rc' \
-m pytest --ignore-glob=*docs* --ignore-glob=*examples*
pytest-internal:
cd test/internal && \
pytest && \
cd ../../
coverage:
coverage combine && \
coverage report --show-missing --omit=*test* --omit=*internal* --omit=*experimental* --fail-under=70 && \
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_GIT_HASH = $(shell git rev-parse --short HEAD)
container-deploy:
docker build -t modulus:deploy --build-arg TARGETPLATFORM=${TARGETPLATFORM} --build-arg MODULUS_GIT_HASH=${MODULUS_GIT_HASH} --target deploy -f Dockerfile .
container-ci:
docker build -t modulus:ci --build-arg TARGETPLATFORM=${TARGETPLATFORM} --target ci -f Dockerfile .
container-docs:
docker build -t modulus:docs --build-arg TARGETPLATFORM=${TARGETPLATFORM} --target docs -f Dockerfile .