-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
37 lines (28 loc) · 1.06 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
help:
@echo 'Demo Flask App w/ Celery Backend for ML Predictions'
@echo '==================================================='
@echo 'Options:'
@echo '----------------------------------------------------'
@echo 'help -> Print this help message (default)'
@echo 'train -> Train a new model and save it as model.pkl'
@echo 'build -> Build docker images for celery & flask'
@echo 'run -> Run docker compose: redis, celery & flask'
@echo 'rund -> Run docker compose: redis, celery & flask (detached)'
@echo 'clean -> Tear down docker containers, remove images'
@echo 'all -> Runs: train, build, run & clean'
@echo '----------------------------------------------------'
@echo ''
model.pkl:
python train.py
train: model.pkl
build: model.pkl Dockerfile.celery Dockerfile.app predict.py
docker-compose build
rund: model.pkl build
docker-compose up -d
run: model.pkl build
docker-compose up
clean:
docker-compose down --rmi all --remove-orphans
[ -d __pycache__ ] && rm -r __pycache__
[ -f model.pkl ] && rm model.pkl
all: train build run clean