-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
75 lines (61 loc) · 1.94 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
# ----------------------------------
# Deployment
# ----------------------------------
update_heroku:
git commit --allow-empty -m 'trigger heroku after updating forecast data'
git push heroku master
# ----------------------------------
# Training on GCP or locally
# ----------------------------------
JOB_NAME=electricity_price_predictor_$(shell date +'%Y%m%d_%H%M')
BUCKET_NAME=electricity_price_predictor
BUCKET_TRAINING_FOLDER=trainings
PACKAGE_NAME=electricity_price_predictor
FILENAME=sarimax
PYTHON_VERSION=3.7
RUNTIME_VERSION=2.3
REGION=europe-west4
train_on_gcp:
gcloud ai-platform jobs submit training ${JOB_NAME} \
--job-dir gs://${BUCKET_NAME}/${BUCKET_TRAINING_FOLDER} \
--package-path ${PACKAGE_NAME} \
--module-name ${PACKAGE_NAME}.${FILENAME} \
--python-version=${PYTHON_VERSION} \
--runtime-version=${RUNTIME_VERSION} \
--region ${REGION}
python -m ${PACKAGE_NAME}.make_public
explorer.exe "https://electricity-price-predictor.herokuapp.com/"
train_local:
python -m ${PACKAGE_NAME}.${FILENAME}
python -m ${PACKAGE_NAME}.make_public
explorer.exe "https://electricity-price-predictor.herokuapp.com/"
# ----------------------------------
# INSTALL & TEST
# ----------------------------------
install_requirements:
@pip install -r requirements.txt
test:
@coverage run -m pytest tests/*.py
clean:
@rm -f */version.txt
@rm -f .coverage
@rm -fr */__pycache__ */*.pyc __pycache__
@rm -fr build dist
@rm -fr electricity_price_predictor-*.dist-info
@rm -fr electricity_price_predictor.egg-info
install:
@pip install . -U
all: clean install test
uninstall:
@python setup.py install --record files.txt
@cat files.txt | xargs rm -rf
@rm -f files.txt
# ----------------------------------
# UPLOAD PACKAGE TO PYPI
# ----------------------------------
build:
@python setup.py sdist bdist_wheel
pypi_test:
@twine upload -r testpypi dist/* -u lologibus2
pypi:
@twine upload dist/* -u lologibus2