-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
91 lines (65 loc) · 2.7 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
# Run this file in project root directory
# Update requirements.txt
#https://stackoverflow.com/questions/62496083/pipreqs-has-the-unicode-error-under-a-virtualenv
update_reqs:
pip install pipreqs
pipreqs --force --ignore bin,etc,include,lib,lib64 "./"
# Install packages, format code, sort imports, and run unit tests
PIP_CACHE_DIR ?= $(HOME)/.cache/pip
install:
pip install --upgrade pip &&\
pip install black[jupyter] pytest pylint isort pytest-cov pytest-mock pre-commit &&\
pip install --cache-dir $(PIP_CACHE_DIR) -r requirements.txt
pre-commit:
pre-commit install --hook-type pre-commit --hook-type pre-merge-commit
isort:
isort --profile black --filter-files ./notebooks ./src ./tests
format:
black ./notebooks ./src ./tests
test:
coverage run -m pytest -vvv
coverage report -m
debug:
pytest -vvv --pdb
# Exclude W0511 (fixme) and E1120 (no value for argument in function call) in .pylintrc file
lint:
pylint ./src/feature_store ./src/training ./src/inference ./tests
all: install isort format test lint
# Import raw dataset from source
get_init_data:
python ./src/feature_store/generate_initial_data.py --config_yaml_path ./src/config/feature-store-config.yml --logger_path ./src/config/logging.conf
# Preprocess and transform data before ingestion by feature store
prep_data:
python ./src/feature_store/prep_data.py --config_yaml_path ./src/config/feature-store-config.yml --logger_path ./src/config/logging.conf
# Setup feature store, view entities and feature views
teardown_feast:
cd ./src/feature_store/feature_repo &&\
feast teardown
init_feast:
cd ./src/feature_store/feature_repo &&\
feast apply
show_feast_entities:
cd ./src/feature_store/feature_repo &&\
feast entities list
show_feast_views:
cd ./src/feature_store/feature_repo &&\
feast feature-views list
show_feast_ui:
cd ./src/feature_store/feature_repo &&\
feast ui
setup_feast: teardown_feast init_feast show_feast_entities show_feast_views
# Submit train experiment
split_data:
python ./src/training/split_data.py --config_yaml_path ./src/config/training-config.yml --logger_path ./src/config/logging.conf
train:
python ./src/training/train.py --config_yaml_path ./src/config/training-config.yml --logger_path ./src/config/logging.conf
evaluate:
python ./src/training/evaluate.py --config_yaml_path ./src/config/training-config.yml --logger_path ./src/config/logging.conf
submit_train: prep_data split_data train evaluate
# Test model locally
test_model:
python ./src/inference/predict.py --config_yaml_path ./src/config/training-config.yml --logger_path ./src/config/logging.conf
# Test model via API (go to http://localhost:8000/docs page to test sample)
test_packaged_model:
cd ./src/inference &&\
uvicorn --host 0.0.0.0 main:app