Abeshith commited on
Commit
ba003d8
·
0 Parent(s):

Initial commit: AutoML MLOps Pipeline project structure

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .dockerignore +0 -0
  2. .dvc/config +0 -0
  3. .github/workflows/ci.yaml +0 -0
  4. .github/workflows/deploy-hf-space.yaml +0 -0
  5. .github/workflows/docker-build.yaml +0 -0
  6. .gitignore +83 -0
  7. Dockerfile +0 -0
  8. LICENSE +0 -0
  9. README.md +0 -0
  10. app/__init__.py +0 -0
  11. app/config.py +0 -0
  12. app/dependencies.py +0 -0
  13. app/main.py +0 -0
  14. app/middleware.py +0 -0
  15. app/routers/__init__.py +0 -0
  16. app/routers/health.py +0 -0
  17. app/routers/predict.py +0 -0
  18. app/routers/train.py +0 -0
  19. app/schemas.py +0 -0
  20. config/automl_config.yaml +44 -0
  21. config/config.yaml +53 -0
  22. config/deployment_config.yaml +42 -0
  23. config/monitoring_config.yaml +44 -0
  24. docker-compose.yaml +0 -0
  25. monitoring/__init__.py +0 -0
  26. monitoring/dashboards/evidently_dashboard.ipynb +10 -0
  27. monitoring/dashboards/generate_reports.py +0 -0
  28. monitoring/data_drift/__init__.py +0 -0
  29. monitoring/data_drift/drift_detector.py +0 -0
  30. monitoring/data_drift/evidently_monitor.py +0 -0
  31. monitoring/model_monitoring/__init__.py +0 -0
  32. monitoring/model_monitoring/performance_tracker.py +0 -0
  33. monitoring/model_monitoring/prediction_logger.py +0 -0
  34. notebooks/01_data_exploration.ipynb +10 -0
  35. notebooks/02_automl_experiments.ipynb +10 -0
  36. notebooks/03_model_analysis.ipynb +10 -0
  37. observability/grafana/dashboards/api_metrics.json +0 -0
  38. observability/grafana/dashboards/model_metrics.json +0 -0
  39. observability/grafana/dashboards/system_metrics.json +0 -0
  40. observability/grafana/provisioning/dashboards.yaml +0 -0
  41. observability/grafana/provisioning/datasources.yaml +0 -0
  42. observability/loki/loki-config.yaml +0 -0
  43. observability/prometheus/alerts.yml +0 -0
  44. observability/prometheus/prometheus.yml +0 -0
  45. observability/promtail/promtail-config.yaml +0 -0
  46. pyproject.toml +0 -0
  47. requirements-dev.txt +19 -0
  48. requirements.txt +30 -0
  49. scripts/evaluate.py +0 -0
  50. scripts/init_db.py +0 -0
.dockerignore ADDED
File without changes
.dvc/config ADDED
File without changes
.github/workflows/ci.yaml ADDED
File without changes
.github/workflows/deploy-hf-space.yaml ADDED
File without changes
.github/workflows/docker-build.yaml ADDED
File without changes
.gitignore ADDED
@@ -0,0 +1,83 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ __pycache__/
2
+ *.py[cod]
3
+ *$py.class
4
+ *.so
5
+ .Python
6
+ build/
7
+ develop-eggs/
8
+ dist/
9
+ downloads/
10
+ eggs/
11
+ .eggs/
12
+ lib/
13
+ lib64/
14
+ parts/
15
+ sdist/
16
+ var/
17
+ wheels/
18
+ *.egg-info/
19
+ .installed.cfg
20
+ *.egg
21
+
22
+ .env
23
+ .venv
24
+ env/
25
+ venv/
26
+ ENV/
27
+ env.bak/
28
+ venv.bak/
29
+ automlenv/
30
+
31
+ .pytest_cache/
32
+ .coverage
33
+ htmlcov/
34
+ *.cover
35
+ .hypothesis/
36
+
37
+ *.log
38
+
39
+ .vscode/
40
+ .idea/
41
+ *.swp
42
+ *.swo
43
+ *~
44
+
45
+ artifacts/
46
+ !artifacts/.gitkeep
47
+ mlflow/mlruns/
48
+ mlruns/
49
+ mlartifacts/
50
+
51
+ .dvc/cache/
52
+ .dvc/tmp/
53
+
54
+ data/
55
+ !data/.gitkeep
56
+ !data/sample_data.csv
57
+
58
+ *.h5
59
+ *.pkl
60
+ *.joblib
61
+ *.model
62
+ *.onnx
63
+ *.pb
64
+
65
+ .ipynb_checkpoints/
66
+ *.ipynb_checkpoints
67
+
68
+ .DS_Store
69
+ Thumbs.db
70
+ *.bak
71
+ *.tmp
72
+
73
+ node_modules/
74
+ package-lock.json
75
+
76
+ .mypy_cache/
77
+ .dmypy.json
78
+ dmypy.json
79
+ .pyre/
80
+ .pytype/
81
+
82
+ models/production/
83
+ !models/.gitkeep
Dockerfile ADDED
File without changes
LICENSE ADDED
File without changes
README.md ADDED
File without changes
app/__init__.py ADDED
File without changes
app/config.py ADDED
File without changes
app/dependencies.py ADDED
File without changes
app/main.py ADDED
File without changes
app/middleware.py ADDED
File without changes
app/routers/__init__.py ADDED
File without changes
app/routers/health.py ADDED
File without changes
app/routers/predict.py ADDED
File without changes
app/routers/train.py ADDED
File without changes
app/schemas.py ADDED
File without changes
config/automl_config.yaml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ automl_library: autogluon
2
+
3
+ autogluon:
4
+ time_limit: 600
5
+ presets: medium_quality
6
+ eval_metric: null
7
+ verbosity: 2
8
+ num_bag_folds: 5
9
+ num_stack_levels: 1
10
+
11
+ flaml:
12
+ time_budget: 600
13
+ metric: auto
14
+ task: classification
15
+ estimator_list:
16
+ - lgbm
17
+ - xgboost
18
+ - rf
19
+ - extra_tree
20
+ n_jobs: -1
21
+ verbose: 1
22
+ early_stop: true
23
+
24
+ pycaret:
25
+ session_id: 42
26
+ n_select: 5
27
+ fold: 5
28
+ verbose: false
29
+ optimize: Accuracy
30
+ use_gpu: false
31
+ tuning:
32
+ enabled: true
33
+ n_iter: 10
34
+ optimize: Accuracy
35
+ ensemble:
36
+ enabled: false
37
+ method: Bagging
38
+ n_estimators: 10
39
+
40
+ common:
41
+ target_column: target
42
+ problem_type: auto
43
+ cv_folds: 5
44
+ random_state: 42
config/config.yaml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ artifacts_root: artifacts
2
+
3
+ data_ingestion:
4
+ root_dir: artifacts/data_ingestion
5
+ source_url: null
6
+ local_data_file: artifacts/data_ingestion/data.csv
7
+ unzip_dir: artifacts/data_ingestion
8
+
9
+ data_validation:
10
+ root_dir: artifacts/data_validation
11
+ data_dir: artifacts/data_ingestion/data.csv
12
+ status_file: artifacts/data_validation/status.txt
13
+ schema_file: config/schema.yaml
14
+
15
+ data_transformation:
16
+ root_dir: artifacts/data_transformation
17
+ data_path: artifacts/data_ingestion/data.csv
18
+ train_path: artifacts/data_transformation/train.csv
19
+ test_path: artifacts/data_transformation/test.csv
20
+ test_size: 0.2
21
+ random_state: 42
22
+
23
+ feature_engineering:
24
+ root_dir: artifacts/feature_engineering
25
+ train_path: artifacts/data_transformation/train.csv
26
+ test_path: artifacts/data_transformation/test.csv
27
+ output_train_path: artifacts/feature_engineering/train_features.csv
28
+ output_test_path: artifacts/feature_engineering/test_features.csv
29
+
30
+ model_trainer:
31
+ root_dir: artifacts/model_trainer
32
+ train_data_path: artifacts/feature_engineering/train_features.csv
33
+ test_data_path: artifacts/feature_engineering/test_features.csv
34
+ model_path: artifacts/model_trainer/model
35
+ target_column: target
36
+
37
+ model_evaluation:
38
+ root_dir: artifacts/model_evaluation
39
+ model_path: artifacts/model_trainer/model
40
+ test_data_path: artifacts/feature_engineering/test_features.csv
41
+ metrics_file: artifacts/model_evaluation/metrics.json
42
+ target_column: target
43
+
44
+ model_pusher:
45
+ root_dir: artifacts/model_pusher
46
+ model_path: artifacts/model_trainer/model
47
+ model_registry_path: models/production
48
+
49
+ mlflow:
50
+ tracking_uri: http://localhost:5000
51
+ experiment_name: automl_experiment
52
+ run_name: null
53
+ registry_uri: null
config/deployment_config.yaml ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ api:
2
+ host: 0.0.0.0
3
+ port: 8000
4
+ workers: 4
5
+ reload: false
6
+ log_level: info
7
+ title: AutoML MLOps API
8
+ version: 1.0.0
9
+
10
+ model:
11
+ path: models/production
12
+ cache_enabled: true
13
+ cache_ttl: 3600
14
+ prediction_timeout: 30
15
+
16
+ docker:
17
+ image_name: automl-mlops
18
+ registry: ghcr.io
19
+ tag: latest
20
+ platform: linux/amd64
21
+
22
+ huggingface:
23
+ space_name: null
24
+ space_sdk: docker
25
+ space_hardware: cpu-basic
26
+ private: false
27
+
28
+ health:
29
+ liveness_path: /health
30
+ readiness_path: /readiness
31
+ startup_timeout: 60
32
+
33
+ metrics:
34
+ enabled: true
35
+ path: /metrics
36
+ include_trace_exemplar: true
37
+
38
+ logging:
39
+ level: INFO
40
+ format: json
41
+ rotation: 100 MB
42
+ retention: 7 days
config/monitoring_config.yaml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ data_drift:
2
+ reference_data_path: artifacts/data/processed/reference.csv
3
+ current_data_path: artifacts/data/processed/current.csv
4
+ report_path: artifacts/reports/drift_reports
5
+ threshold: 0.1
6
+ columns: null
7
+
8
+ model_monitoring:
9
+ predictions_path: artifacts/logs/predictions
10
+ performance_threshold: 0.05
11
+ window_size: 1000
12
+ metrics:
13
+ - accuracy
14
+ - precision
15
+ - recall
16
+ - f1
17
+
18
+ evidently:
19
+ reference_window: 7
20
+ detection_window: 1
21
+ confidence_level: 0.95
22
+ stattest: ks
23
+ stattest_threshold: 0.05
24
+
25
+ prometheus:
26
+ host: localhost
27
+ port: 9090
28
+ scrape_interval: 15s
29
+ evaluation_interval: 15s
30
+
31
+ grafana:
32
+ host: localhost
33
+ port: 3000
34
+ admin_user: admin
35
+ admin_password: admin
36
+
37
+ loki:
38
+ host: localhost
39
+ port: 3100
40
+
41
+ promtail:
42
+ host: localhost
43
+ port: 9080
44
+ log_path: artifacts/logs
docker-compose.yaml ADDED
File without changes
monitoring/__init__.py ADDED
File without changes
monitoring/dashboards/evidently_dashboard.ipynb ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [],
3
+ "metadata": {
4
+ "language_info": {
5
+ "name": "python"
6
+ }
7
+ },
8
+ "nbformat": 4,
9
+ "nbformat_minor": 5
10
+ }
monitoring/dashboards/generate_reports.py ADDED
File without changes
monitoring/data_drift/__init__.py ADDED
File without changes
monitoring/data_drift/drift_detector.py ADDED
File without changes
monitoring/data_drift/evidently_monitor.py ADDED
File without changes
monitoring/model_monitoring/__init__.py ADDED
File without changes
monitoring/model_monitoring/performance_tracker.py ADDED
File without changes
monitoring/model_monitoring/prediction_logger.py ADDED
File without changes
notebooks/01_data_exploration.ipynb ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [],
3
+ "metadata": {
4
+ "language_info": {
5
+ "name": "python"
6
+ }
7
+ },
8
+ "nbformat": 4,
9
+ "nbformat_minor": 5
10
+ }
notebooks/02_automl_experiments.ipynb ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [],
3
+ "metadata": {
4
+ "language_info": {
5
+ "name": "python"
6
+ }
7
+ },
8
+ "nbformat": 4,
9
+ "nbformat_minor": 5
10
+ }
notebooks/03_model_analysis.ipynb ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [],
3
+ "metadata": {
4
+ "language_info": {
5
+ "name": "python"
6
+ }
7
+ },
8
+ "nbformat": 4,
9
+ "nbformat_minor": 5
10
+ }
observability/grafana/dashboards/api_metrics.json ADDED
File without changes
observability/grafana/dashboards/model_metrics.json ADDED
File without changes
observability/grafana/dashboards/system_metrics.json ADDED
File without changes
observability/grafana/provisioning/dashboards.yaml ADDED
File without changes
observability/grafana/provisioning/datasources.yaml ADDED
File without changes
observability/loki/loki-config.yaml ADDED
File without changes
observability/prometheus/alerts.yml ADDED
File without changes
observability/prometheus/prometheus.yml ADDED
File without changes
observability/promtail/promtail-config.yaml ADDED
File without changes
pyproject.toml ADDED
File without changes
requirements-dev.txt ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ -r requirements.txt
2
+
3
+ pytest
4
+ pytest-asyncio
5
+ pytest-cov
6
+ pytest-mock
7
+
8
+ black
9
+ flake8
10
+ isort
11
+ mypy
12
+
13
+ pre-commit
14
+
15
+ jupyter
16
+ ipykernel
17
+ notebook
18
+
19
+ locust
requirements.txt ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ fastapi
2
+ uvicorn[standard]
3
+ pydantic
4
+ pydantic-settings
5
+
6
+ pandas
7
+ numpy
8
+ scikit-learn
9
+
10
+ autogluon.tabular
11
+ flaml
12
+ pycaret
13
+
14
+ mlflow
15
+ dvc
16
+
17
+ evidently
18
+
19
+ pyarrow
20
+ fastparquet
21
+
22
+ pyyaml
23
+ python-box
24
+ ensure
25
+ python-multipart
26
+ prometheus-client
27
+ python-json-logger
28
+
29
+ httpx
30
+ requests
scripts/evaluate.py ADDED
File without changes
scripts/init_db.py ADDED
File without changes