# edquestofficial/mlops-end-to-end architecture

> Architecture diagram of the GitHub repository edquestofficial/mlops-end-to-end, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/edquestofficial/mlops-end-to-end
- Repository: https://github.com/edquestofficial/mlops-end-to-end

## Overview

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: [`06_kubeflow_deployment_with_k8s/icecream_pipeline/ml_pipeline.py`](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/ml_pipeline.py) (Kubeflow pipeline), [`04_docker_experiment/app.py`](https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/app.py) (Inference app), [`02_mlflow_experminent/model_pipeline.py`](https://github.com/edquestofficial/mlops-end-to-end/blob/main/02_mlflow_experminent/model_pipeline.py) (MLflow pipeline), [`01_model_train/linear_regression_model.pkl`](https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/linear_regression_model.pkl) (Trained model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Local analysis"]
  node_n1["Ice cream notebook<br/>training notebook"]
  node_n2["Salary notebook<br/>classification notebook"]
  node_n3[("Trained model<br/>pickle artifact")]
end

subgraph group_g2["Tracking and CI"]
  node_n4["MLflow pipeline<br/>tracking pipeline<br/>[model_pipeline.py]"]
  node_n5["Evaluation results<br/>metrics output<br/>[eval.json]"]
  node_n6["CI pipeline<br/>automation pipeline<br/>[model_pipeline.py]"]
  node_n7["GitHub Actions<br/>workflow<br/>[pipeline.yml]"]
end

subgraph group_g3["Container serving"]
  node_n8["Inference app<br/>container app<br/>[app.py]"]
  node_n9["Linear logic<br/>model helper"]
  node_n10[("Packaged model<br/>pickle artifact")]
  node_n11["Docker image<br/>container build"]
end

subgraph group_g4["Kubernetes deployment"]
  node_n12["Model pipeline<br/>k8s model code<br/>[model_pipeline.py]"]
  node_n13["MLflow API<br/>serving api<br/>[mlflow_api.py]"]
  node_n14["MLflow client<br/>model client<br/>[mlflow_client.py]"]
  node_n15["Model deploy<br/>k8s workload"]
  node_n16["MLflow UI<br/>k8s workload"]
  node_n17["Shared config<br/>k8s config<br/>[configmap.yaml]"]
end

subgraph group_g5["Kubeflow pipeline"]
  node_n18["Kubeflow pipeline<br/>pipeline orchestrator<br/>[ml_pipeline.py]"]
  node_n19["Preprocess step<br/>pipeline component<br/>[preprocess.py]"]
  node_n20["Train step<br/>pipeline component<br/>[train.py]"]
  node_n21["Eval step<br/>pipeline component<br/>[evaluate.py]"]
  node_n22["Deploy step<br/>pipeline component<br/>[deploy.py]"]
  node_n23["Ice cream data<br/>dataset<br/>[ice_cream.csv]"]
end

subgraph group_g6["Ops setup"]
  node_n24["Storage setup<br/>cluster provisioning"]
end

node_n1 -->|"trains"| node_n3
node_n2 -.->|"reuses flow"| node_n3
node_n1 -->|"evolves into"| node_n4
node_n4 -->|"writes"| node_n5
node_n4 -->|"hardens into"| node_n6
node_n6 -->|"runs in"| node_n7
node_n3 -->|"served by"| node_n8
node_n9 -->|"supports"| node_n8
node_n8 -->|"packaged by"| node_n11
node_n10 -->|"loads"| node_n8
node_n12 -->|"exposes"| node_n13
node_n14 -->|"connects"| node_n13
node_n13 -->|"deployed as"| node_n15
node_n16 -->|"coexists with"| node_n15
node_n17 -->|"configures"| node_n15
node_n18 -->|"wires"| node_n19
node_n18 -->|"wires"| node_n20
node_n18 -->|"wires"| node_n21
node_n18 -->|"wires"| node_n22
node_n23 -->|"feeds"| node_n19
node_n19 -->|"outputs"| node_n20
node_n20 -->|"produces"| node_n21
node_n21 -->|"gates"| node_n22
node_n24 -.->|"supports"| node_n18

click node_n1 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/ice_cream_vs_temp.ipynb"
click node_n2 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/logistic_regression.ipynb"
click node_n3 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/linear_regression_model.pkl"
click node_n4 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/02_mlflow_experminent/model_pipeline.py"
click node_n5 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/02_mlflow_experminent/eval.json"
click node_n6 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/03_cicd_in_ml/model_pipeline.py"
click node_n7 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/.github/workflows/pipeline.yml"
click node_n8 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/app.py"
click node_n9 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/linear_regression.py"
click node_n10 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/linear_regression_model.pkl"
click node_n11 "https://github.com/edquestofficial/mlops-end-to-end/tree/main/04_docker_experiment/dockerfile"
click node_n12 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/model_code/model_pipeline.py"
click node_n13 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/api/mlflow_api.py"
click node_n14 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/api/mlflow_client.py"
click node_n15 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/k8s/model-deployment.yml"
click node_n16 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/k8s/mlflow-ui-deployment.yaml"
click node_n17 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/k8s/configmap.yaml"
click node_n18 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/ml_pipeline.py"
click node_n19 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/preprocess.py"
click node_n20 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/train.py"
click node_n21 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/evaluate.py"
click node_n22 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/deploy.py"
click node_n23 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/data/ice_cream.csv"
click node_n24 "https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/local_provisioning/local_path_storage.yaml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_n1,node_n2,node_n3 toneBlue
class node_n4,node_n5,node_n6,node_n7 toneAmber
class node_n8,node_n9,node_n10,node_n11 toneMint
class node_n12,node_n13,node_n14,node_n15,node_n16,node_n17 toneRose
class node_n18,node_n19,node_n20,node_n21,node_n22,node_n23 toneIndigo
class node_n24 toneTeal
```

## Components

### Local analysis

Notebook-first model training and exported artifacts.

- [Ice cream notebook](https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/ice_cream_vs_temp.ipynb): training notebook · Exploratory regression training on temperature vs ice cream data. · `01_model_train/ice_cream_vs_temp.ipynb`
- [Salary notebook](https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/logistic_regression.ipynb): classification notebook · Second training example using logistic regression on salary data. · `01_model_train/logistic_regression.ipynb`
- [Trained model](https://github.com/edquestofficial/mlops-end-to-end/blob/main/01_model_train/linear_regression_model.pkl): pickle artifact · 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](https://github.com/edquestofficial/mlops-end-to-end/blob/main/02_mlflow_experminent/model_pipeline.py): tracking pipeline · Scripted training and evaluation flow for experiment tracking. · `02_mlflow_experminent/model_pipeline.py`
- [Evaluation results](https://github.com/edquestofficial/mlops-end-to-end/blob/main/02_mlflow_experminent/eval.json): metrics output · Persisted evaluation payload separate from the model artifact. · `02_mlflow_experminent/eval.json`
- [CI pipeline](https://github.com/edquestofficial/mlops-end-to-end/blob/main/03_cicd_in_ml/model_pipeline.py): automation pipeline · Repository-ready training script intended for automated execution. · `03_cicd_in_ml/model_pipeline.py`
- [GitHub Actions](https://github.com/edquestofficial/mlops-end-to-end/blob/main/.github/workflows/pipeline.yml): workflow · 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](https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/app.py): container app · Simple prediction service that loads a local model and serves predictions. · `04_docker_experiment/app.py`
- [Linear logic](https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/linear_regression.py): model helper · Inference/training helper used by the Dockerized demo. · `04_docker_experiment/linear_regression.py`
- [Packaged model](https://github.com/edquestofficial/mlops-end-to-end/blob/main/04_docker_experiment/linear_regression_model.pkl): pickle artifact · Model file baked into or mounted alongside the containerized demo. · `04_docker_experiment/linear_regression_model.pkl`
- [Docker image](https://github.com/edquestofficial/mlops-end-to-end/tree/main/04_docker_experiment/dockerfile): container build · 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](https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/model_code/model_pipeline.py): k8s model code · Training and evaluation code used by the Kubernetes deployment stage. · `05_model_deployment_with_k8s/model_code/model_pipeline.py`
- [MLflow API](https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/api/mlflow_api.py): serving api · Request-handling layer that coordinates model access for deployment. · `05_model_deployment_with_k8s/api/mlflow_api.py`
- [MLflow client](https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/api/mlflow_client.py): model client · Client boundary for retrieving or registering models via MLflow. · `05_model_deployment_with_k8s/api/mlflow_client.py`
- [Model deploy](https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/k8s/model-deployment.yml): k8s workload · Kubernetes deployment for the model-serving service. · `05_model_deployment_with_k8s/k8s/model-deployment.yml`
- [MLflow UI](https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/k8s/mlflow-ui-deployment.yaml): k8s workload · Cluster component exposing the MLflow interface. · `05_model_deployment_with_k8s/k8s/mlflow-ui-deployment.yaml`
- [Shared config](https://github.com/edquestofficial/mlops-end-to-end/blob/main/05_model_deployment_with_k8s/k8s/configmap.yaml): k8s 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](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/ml_pipeline.py): pipeline orchestrator · Top-level Kubeflow DAG that wires preprocessing, training, evaluation, and deployment. · `06_kubeflow_deployment_with_k8s/icecream_pipeline/ml_pipeline.py`
- [Preprocess step](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/preprocess.py): pipeline component · Data preparation stage for the Kubeflow workflow. · `06_kubeflow_deployment_with_k8s/icecream_pipeline/components/preprocess.py`
- [Train step](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/train.py): pipeline component · Model training stage in the Kubeflow workflow. · `06_kubeflow_deployment_with_k8s/icecream_pipeline/components/train.py`
- [Eval step](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/evaluate.py): pipeline component · Evaluation stage that gates downstream deployment. · `06_kubeflow_deployment_with_k8s/icecream_pipeline/components/evaluate.py`
- [Deploy step](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/components/deploy.py): pipeline component · Deployment stage for publishing the trained model. · `06_kubeflow_deployment_with_k8s/icecream_pipeline/components/deploy.py`
- [Ice cream data](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/icecream_pipeline/data/ice_cream.csv): dataset · 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](https://github.com/edquestofficial/mlops-end-to-end/blob/main/06_kubeflow_deployment_with_k8s/local_provisioning/local_path_storage.yaml): cluster provisioning · Local persistent storage configuration for the Kubernetes/Kubeflow environment. · `06_kubeflow_deployment_with_k8s/local_provisioning/local_path_storage.yaml`

## Connections

- 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.
