How edquestofficial/mlops-end-to-end works
1. Overall structure
- This repository is a progression of self-contained MLOps examples, not one single application.
- Each numbered folder adds a layer: basic model training, experiment tracking, CI/CD, containerization, Kubernetes deployment, and Kubeflow pipelines.
2. Core ML problem domain
- The repeated toy dataset is an “ice cream vs temperature” regression problem, with one additional classification/regression experiment using salary and logistic regression.
- Most artifacts revolve around training a simple model, serializing it, and then reusing that artifact in deployment demos.
3. Training and notebook layer
- 01_model_train contains exploratory notebooks plus saved model pickles (linear_regression_model.pkl, logistic_regression_model.pkl) and CSV input data.
- This is the “offline analysis” boundary: data is read from local files, models are trained in notebooks, and artifacts are exported for later stages.
4. Experiment tracking layer
- 02_mlflow_experminent introduces MLflow-oriented model training and evaluation.
- The presence of eval.json suggests metrics/results are persisted separately from the model artifact, making evaluation a first-class output alongside the trained model.
- model_pipeline.py indicates the logic has moved from notebook-only work into a reusable pipeline script.
5. CI/CD-focused ML pipeline
- 03_cicd_in_ml keeps the same style of ML pipeline but adds repository-ready structure for automation.
- requirements.txt plus a pipeline script signal that this folder is intended to be executed by a CI job rather than manually from a notebook.
- The .github/workflows/pipeline.yml at the repo root is the main automation boundary for this stage.
6. Containerized inference demo
- 04_docker_experiment packages a small model-serving workflow into a Docker image.
- app.py, linear_regression.py, and the saved model file indicate a simple prediction service or demo app that loads a local pickle and runs inference against CSV-backed sample data.
- The Dockerfile and requirements file define the runtime boundary: Python app inside a container with model artifact baked in.
7. Kubernetes deployment with MLflow-backed model access
- 05_model_deployment_with_k8s is a more complete deployment architecture.
- It separates concerns into:
- model_code/ for training/evaluation and data preparation,
- api/ for the serving API,
- k8s/ for Kubernetes manifests,
- k8s_setup_and_clean/ for environment lifecycle scripts.
- This folder is the first clear split between model lifecycle code and deployment infrastructure.
8. Serving API and model client boundary
- Inside 05_model_deployment_with_k8s/api, mlflow_api.py and mlflow_client.py imply the service interacts with MLflow for model retrieval or registration rather than only loading a local pickle.
- config/config.ini and logger.py indicate the API is configurable and instrumented, which matters for deployment and observability.
- The API is containerized separately from the model/image used by the backend, showing a service boundary between request handling and model management.
9. Kubernetes resources
- The k8s directory defines the runtime infrastructure: model-deployment.yml, mlflow-ui-deployment.yaml, mlflow-ui-service.yaml, configmap.yaml, and hpa-model.yaml.
- This suggests a multi-component cluster layout with:
- a model-serving workload,
- an MLflow UI component,
- shared configuration via ConfigMap,
- autoscaling via HPA.
- The Dockerfile.mlflow also implies a dedicated image for the MLflow-side runtime.
10. Kubeflow pipeline architecture
- 06_kubeflow_deployment_with_k8s/icecream_pipeline is the most modular version.
- The pipeline is split into reusable steps under components/: preprocess.py, train.py, evaluate.py, and deploy.py.
- ml_pipeline.py is the orchestrator that wires these components into a pipeline suitable for Kubeflow execution.
11. Pipeline data flow
- In the Kubeflow version, data flows from data/ice_cream.csv into preprocessing, then training, then evaluation, then deployment.
- This is a clear DAG-like workflow, unlike the earlier notebook stages where everything happened sequentially in one file.
- utils/client.py suggests a helper boundary for cluster or pipeline interactions, likely to support Kubeflow or related services.
12. External systems and environment provisioning
- The repo references several operational dependencies that affect architecture: Docker, Kubernetes, MLflow, and Kubeflow.
- local_provisioning/local_path_storage.yaml indicates local persistent storage setup for cluster-based workflows.
- The README.md files in the deeper folders likely document setup assumptions for running MLflow, MinIO, or Kubeflow on a local Kubernetes cluster.
13. Repository-level automation
- .github/workflows/pipeline.yml is the main CI entry point, while hello-world.yml.disabled appears to be an unused example workflow.
- The GitHub Actions layer likely validates or demonstrates automated execution of the ML pipeline rather than serving the model itself.
14. How to draw the architecture
- A good diagram would show a progression of stages rather than one monolithic system:
- local notebooks and CSVs,
- ML training scripts and artifacts,
- MLflow experiment tracking,
- Dockerized inference,
- Kubernetes deployment with API and MLflow UI,
- Kubeflow pipeline with modular steps.
- The key boundaries are between data preparation, model training, model artifact storage, serving/API, and cluster orchestration.
Main entry points: ml_pipeline.py Kubeflow pipeline · app.py Inference app · model_pipeline.py MLflow pipeline · linear_regression_model.pkl Trained model
Components 24
Local analysis
Notebook-first model training and exported artifacts.
- Ice cream notebook · Exploratory regression training on temperature vs ice cream data.
01_model_train/ice_cream_vs_temp.ipynb - Salary notebook · Second training example using logistic regression on salary data.
01_model_train/logistic_regression.ipynb - Trained model · Serialized model produced from the local training stage.
01_model_train/linear_regression_model.pkl
Tracking and CI
Reusable training pipeline plus experiment outputs and GitHub Actions automation.
- MLflow pipeline · Scripted training and evaluation flow for experiment tracking.
02_mlflow_experminent/model_pipeline.py - Evaluation results · Persisted evaluation payload separate from the model artifact.
02_mlflow_experminent/eval.json - CI pipeline · Repository-ready training script intended for automated execution.
03_cicd_in_ml/model_pipeline.py - GitHub Actions · Main CI entry point for running the ML pipeline.
.github/workflows/pipeline.yml
Container serving
Dockerized prediction demo built around a local model artifact.
- Inference app · Simple prediction service that loads a local model and serves predictions.
04_docker_experiment/app.py - Linear logic · Inference/training helper used by the Dockerized demo.
04_docker_experiment/linear_regression.py - Packaged model · Model file baked into or mounted alongside the containerized demo.
04_docker_experiment/linear_regression_model.pkl - Docker image · Container build definition for the inference demo.
04_docker_experiment/dockerfile
Kubernetes deployment
Model serving API and cluster manifests for MLflow-backed deployment.
- Model pipeline · Training and evaluation code used by the Kubernetes deployment stage.
05_model_deployment_with_k8s/model_code/model_pipeline.py - MLflow API · Request-handling layer that coordinates model access for deployment.
05_model_deployment_with_k8s/api/mlflow_api.py - MLflow client · Client boundary for retrieving or registering models via MLflow.
05_model_deployment_with_k8s/api/mlflow_client.py - Model deploy · Kubernetes deployment for the model-serving service.
05_model_deployment_with_k8s/k8s/model-deployment.yml - MLflow UI · Cluster component exposing the MLflow interface.
05_model_deployment_with_k8s/k8s/mlflow-ui-deployment.yaml - Shared config · ConfigMap used to share deployment settings.
05_model_deployment_with_k8s/k8s/configmap.yaml
Kubeflow pipeline
Modular pipeline components orchestrated as a DAG.
- Kubeflow pipeline · Top-level Kubeflow DAG that wires preprocessing, training, evaluation, and deployment.
06_kubeflow_deployment_with_k8s/icecream_pipeline/ml_pipeline.py - Preprocess step · Data preparation stage for the Kubeflow workflow.
06_kubeflow_deployment_with_k8s/icecream_pipeline/components/preprocess.py - Train step · Model training stage in the Kubeflow workflow.
06_kubeflow_deployment_with_k8s/icecream_pipeline/components/train.py - Eval step · Evaluation stage that gates downstream deployment.
06_kubeflow_deployment_with_k8s/icecream_pipeline/components/evaluate.py - Deploy step · Deployment stage for publishing the trained model.
06_kubeflow_deployment_with_k8s/icecream_pipeline/components/deploy.py - Ice cream data · Shared CSV input used by the Kubeflow pipeline.
06_kubeflow_deployment_with_k8s/icecream_pipeline/data/ice_cream.csv
Ops setup
Cluster provisioning and lifecycle helpers.
- Storage setup · Local persistent storage configuration for the Kubernetes/Kubeflow environment.
06_kubeflow_deployment_with_k8s/local_provisioning/local_path_storage.yaml
Connections 24
- Ice cream notebook → Trained model: trains · Notebook produces the serialized regression artifact.
- Salary notebook → Trained model: reuses flow · Second notebook shows a parallel modeling experiment.
- Ice cream notebook → MLflow pipeline: evolves into · Notebook logic is refactored into a reusable tracked pipeline.
- MLflow pipeline → Evaluation results: writes · Tracked run persists evaluation output.
- MLflow pipeline → CI pipeline: hardens into · Experiment pipeline is adapted for CI execution.
- CI pipeline → GitHub Actions: runs in · GitHub Actions is the automation boundary for the CI pipeline.
- Trained model → Inference app: served by · Serialized model is loaded by the Dockerized app.
- Linear logic → Inference app: supports · Helper logic backs the inference application.
- Inference app → Docker image: packaged by · The demo app is containerized using the Docker build.
- Packaged model → Inference app: loads · Containerized app consumes the packaged model artifact.
- Model pipeline → MLflow API: exposes · Deployment-oriented model code is served through the API layer.
- MLflow client → MLflow API: connects · Client boundary mediates model lookup and API interactions.
- MLflow API → Model deploy: deployed as · API is deployed as a Kubernetes workload.
- MLflow UI → Model deploy: coexists with · MLflow UI is another cluster component in the deployment.
- Shared config → Model deploy: configures · Shared configuration feeds the serving deployment.
- Kubeflow pipeline → Preprocess step: wires · Pipeline orchestrator connects preprocessing stage.
- Kubeflow pipeline → Train step: wires · Pipeline orchestrator connects training stage.
- Kubeflow pipeline → Eval step: wires · Pipeline orchestrator connects evaluation stage.
- Kubeflow pipeline → Deploy step: wires · Pipeline orchestrator connects deployment stage.
- Ice cream data → Preprocess step: feeds · CSV dataset is input to preprocessing.
- Preprocess step → Train step: outputs · Prepared data flows into training.
- Train step → Eval step: produces · Trained model is evaluated before release.
- Eval step → Deploy step: gates · Evaluation result informs deployment.
- Storage setup → Kubeflow pipeline: supports · Persistent storage underpins local Kubeflow execution.