-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
123 lines (98 loc) · 4.05 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
114
115
116
117
118
119
120
121
122
123
# Copyright 2023- Autonomi AI, Inc. All rights reserved.
export DOCKER_BUILDKIT ?= 1
export COMPOSE_DOCKER_CLI_BUILD ?= 1
export NOS_TELEMETRY_ENABLED ?= 0
.DEFAULT_GOAL := help
.PHONY: default clean clean-build clean-pyc clean-test test test-coverage develop install style
SHELL := /bin/bash
NOS_VERSION := $(shell python -c "exec(open('nos/version.py').read().strip()); print(__version__)")
NOS_VERSION_TAG = ${NOS_VERSION}
DOCKER_IMAGE_NAME := autonomi/nos
DOCKER_ARGS :=
DOCKER_CMD :=
include makefiles/Makefile.base.mk
include makefiles/Makefile.docs.mk
include makefiles/Makefile.agibuild.mk
default: help;
help:
@echo "🔥 NOS - Nitrous Oxide for your AI infrastructure."
@echo ""
@echo "Usage: make <target>"
@echo ""
@echo "Targets:"
@echo " clean Remove all build, test, coverage and Python artifacts"
@echo " clean-build Remove build artifacts"
@echo " clean-pyc Remove Python file artifacts"
@echo " clean-test Remove test and coverage artifacts"
@echo " post-install-check Post-install checks (check version, etc)"
@echo " develop-gpu Install GPU dependencies and package in developer/editable-mode"
@echo " develop-cpu Install CPU dependencies and package in developer/editable-mode"
@echo " install Install wheel package"
@echo " lint Format source code automatically"
@echo " test Basic GPU/CPU testing with a single GPU"
@echo " test-cpu Basic CPU testing"
@echo " test-client Basic client-side testing"
@echo " test-server Server-side testing (all GPUs)"
@echo " test-cpu-benchmark Testing with benchmarks (CPUs)"
@echo " test-gpu-benchmark Testing with benchmarks (GPUs)"
@echo " test-all All tests including CPU, GPU, client, and server
@echo " dist Builds source and wheel package"
@echo ""
clean: clean-build clean-pyc clean-test ## remove all build, test, coverage and Python artifacts
clean-build: ## remove build artifacts
rm -fr build/
rm -fr dist/
rm -fr .eggs/
rm -fr site/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc: ## remove Python file artifacts
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test: ## remove test and coverage artifacts
rm -fr .tox/
rm -f .coverage
rm -fr htmlcov/
rm -fr .pytest_cache
post-install-check: ## Post-install checks (check version, etc)
python -c 'from nos.version import __version__; print(f"nos=={__version__}")'
develop-gpu: ## Install GPU dependencies and package in developer/editable-mode
python -m pip install --upgrade pip
pip install --editable '.[server,gpu,dev,test,docs]'
make post-install-check
develop-cpu: ## Install CPU dependencies and package in developer/editable-mode
python -m pip install --upgrade pip
pip install --editable '.[server,cpu,dev,test,docs]'
make post-install-check
install: ## Install wheel package
pip install .
lint: ## Format source code automatically
pre-commit run --all-files # Uses pyproject.toml
test: ## Basic CPU testing with mkdocs-build
make test-cpu
make mkdocs-build
test-cpu: ## Basic CPU testing
CUDA_VISIBLE_DEVICES="" \
pytest -sv tests
test-gpu: ## Basic GPU testing with single GPU
CUDA_VISIBLE_DEVICES="0" \
pytest -sv tests
test-client: agi-build-cpu agi-build-gpu ## Basic client-side testing
CUDA_VISIBLE_DEVICES="" \
pytest -sv tests/client -m "client"
test-cpu-benchmark: ## Testing with benchmarks (no GPUs)
CUDA_VISIBLE_DEVICES="" \
pytest -sv tests -m "benchmark"
test-gpu-benchmark: ## Testing with benchmarks (all GPUs)
pytest -sv tests -m "benchmark"
test-server: ## Server-side testing (all GPUs)
pytest -sv tests -m "server"
test-all: ## All tests including CPU, GPU, client, and server
make test-cpu test-gpu test-client test-server
dist: clean ## builds source and wheel package
python -m build --sdist --wheel
ls -lh dist
test-locust:
locust -f tests/locustfile.py --config=tests/locust.conf