Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Makefile 2.4 KB

You have to be logged in to leave a comment. Sign In
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
91
92
93
94
95
96
97
98
99
  1. # Makefile
  2. .PHONY: help
  3. help:
  4. @echo "Commands:"
  5. @echo "install : installs requirements."
  6. @echo "install-dev : installs development requirements."
  7. @echo "install-test : installs test requirements."
  8. @echo "venv : set up the virtual environment for development"
  9. @echo "app : launches FastAPI app with uvicorn worker"
  10. @echo "app-prod : launches FastAPI app with uvicorn workers managed by guincorn"
  11. @echo "test : runs all tests."
  12. @echo "test-non-training : runs tests that don't involve training."
  13. @echo "style : runs style formatting."
  14. @echo "clean : cleans all unecessary files."
  15. @echo "docs : serve generated documentation."
  16. # Installation
  17. .PHONY: install
  18. install:
  19. python -m pip install -e .
  20. .PHONY: install-dev
  21. install-dev:
  22. python -m pip install -e ".[dev]"
  23. pre-commit install
  24. .PHONY: install-test
  25. install-test:
  26. python -m pip install -e ".[test]"
  27. venv:
  28. python3 -m venv ${name}
  29. source ${name}/bin/activate && \
  30. python -m pip install --upgrade pip setuptools wheel && \
  31. make install-$(env)
  32. @echo "Run 'source ${name}/bin/activate'"
  33. # Application
  34. .PHONY: app
  35. SHELL ::= /bin/bash
  36. app:
  37. ifneq (${env}, prod)
  38. uvicorn app.api:app --host 0.0.0.0 --port 5000 --reload --reload-dir tagifai --reload-dir app
  39. else
  40. gunicorn -c config/gunicorn.py -k uvicorn.workers.UvicornWorker app.api:app
  41. endif
  42. .PHONY: mlflow
  43. mlflow:
  44. mlflow server -h 0.0.0.0 -p 5000 --backend-store-uri experiments/
  45. .PHONY: streamlit
  46. streamlit:
  47. streamlit run streamlit/st_app.py
  48. # DVC
  49. .PHONY: DVC
  50. dvc:
  51. dvc add data/tags.json
  52. dvc add data/projects.json
  53. tagifai clean-experiments --experiments-to-keep best
  54. dvc add experiments
  55. dvc push
  56. # Tests
  57. .PHONY: great-expectations
  58. great-expectations:
  59. great_expectations checkpoint run projects
  60. great_expectations checkpoint run tags
  61. .PHONY: test
  62. test: great-expectations
  63. pytest --cov tagifai --cov app --cov-report html
  64. .PHONY: test-non-training
  65. test-non-training: great-expectations
  66. pytest -m "not training"
  67. # Styling
  68. .PHONY: style
  69. style:
  70. black .
  71. flake8
  72. isort .
  73. # Cleaning
  74. .PHONY: clean
  75. clean:
  76. find . -type f -name "*.DS_Store" -ls -delete
  77. find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
  78. find . | grep -E ".pytest_cache" | xargs rm -rf
  79. find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
  80. rm -f .coverage
  81. # Documentation
  82. .PHONY: docs
  83. docs:
  84. python -m mkdocs serve
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...