-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (52 loc) · 2.27 KB
/
Copy pathMakefile
File metadata and controls
73 lines (52 loc) · 2.27 KB
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
#!/usr/bin/env make
.PHONY: train docker-build docker-console spacy-load-model
DOCKER_IMAGE_VERSION=0.7.0
DOCKER_IMAGE_TAG=leovs09/sentiment:$(DOCKER_IMAGE_VERSION)
# ---------------------------------------------------------------------------------------------------------------------
# DEVELOPMENT
# ---------------------------------------------------------------------------------------------------------------------
# Will reproduce all stages to generate model based on changes
default:
dvc repro
# Will load data and models which specifaed by dvc files
checkout:
dvc pull
train:
echo "-m flag will run script in module mode, which accept relative imports"
python -m src.train
test:
echo "-m flag will run script in module mode, which accept relative imports"
python -m src.test
# Will load medium size model for spacy
spacy-load-md:
python -m spacy download en_core_web_md
# Will start notebook environment on http://0.0.0.0:8888
notebook:
jupyter notebook --ip=0.0.0.0 --allow-root
install:
pip install -r requirements.txt
# Will save all current dependencies to requirements.txt
save-dependencies:
pip freeze > requirements.txt
# docs folder required for github pages
notebook-to-html:
jupyter nbconvert ./analyse.ipynb --to html --output-dir="./docs" --output="index.html"
notebook-to-python:
jupyter nbconvert ./analyse.ipynb --to python --output-dir="./results" --output="analyse.py"
notebook-artifacts: notebook-to-html notebook-to-python
# ---------------------------------------------------------------------------------------------------------------------
# DOCKER
# ---------------------------------------------------------------------------------------------------------------------
dev: docker-build docker attach-console
# Will build docker image for development
docker-build:
docker build --tag $(DOCKER_IMAGE_TAG) .
# Will start in docker develoment environment
docker-console:
docker run --gpus all -it --rm -v ${PWD}:/work -w /work --name sentiment -p 8888:8888 $(DOCKER_IMAGE_TAG) bash
docker:
docker run --gpus all --rm -v ${PWD}:/work -w /work --name sentiment -p 8888:8888 $(DOCKER_IMAGE_TAG)
docker-it:
docker run --gpus all -it --rm -v ${PWD}:/work -w /work --name sentiment -p 8888:8888 $(DOCKER_IMAGE_TAG)
attach-console:
docker exec -it sentiment bash