forked from eLearningHub/huggingfastapi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
58 lines (44 loc) · 1.37 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
SHELL := /bin/bash
# Variables definitions
# -----------------------------------------------------------------------------
DEFAULT_MODEL_PATH := ./ml_model/
ifeq ($(API_KEY),)
API_KEY := $(python -c "import uuid;print(str(uuid.uuid4()))")
endif
# Target section and Global definitions
# -----------------------------------------------------------------------------
.PHONY: all clean test install run deploy down
all: clean test install run deploy down
test:
python -m pip install --upgrade pip && pip install setuptools tox
tox
install: generate_dot_env
pip install --upgrade pip && pip install -r requirements.txt
run:
- python -c "import subprocess;print(subprocess.run(['hostname','-I'],capture_output=True,text=True).stdout.strip())"
PYTHONPATH=huggingfastapi/ uvicorn huggingfastapi.main:app --reload --host 0.0.0.0
build: generate_dot_env
docker compose build
deploy: generate_dot_env
docker compose build
docker compose up -d
down:
docker compose down
generate_dot_env:
@if [[ ! -e .env ]]; then \
cp .env.example .env; \
fi
clean:
-find . -name '*.pyc' -exec rm -rf {} \;
-find . -name '__pycache__' -exec rm -rf {} \;
-find . -name 'Thumbs.db' -exec rm -rf {} \;
-find . -name '*~' -exec rm -rf {} \;
-rm -rf .cache
-rm -rf build
-rm -rf dist
-rm -rf *.egg-info
-rm -rf htmlcov*
-rm -rf .tox/
-rm -rf docs/_build
-rm -r .coverage
-rm -rf .pytest_cache