This repository contains a production-ready, containerized MLOps pipeline that handles market data parsing, strict configuration validation, and computes a deterministic evaluation metric[cite: 1]. The pipeline is fully compliant with automated grading systems[cite: 1].
The repository includes all mandatory files structured for direct evaluation:[cite: 1]
run.py: Core CLI execution script implementing data loading, parsing, and processing[cite: 1].config.yaml: Structured configuration parameters for the pipeline (version,seed, etc.)[cite: 1].data.csv: Source market dataset containing input time-series metrics[cite: 1].requirements.txt: Python package dependencies required for the execution[cite: 1].Dockerfile: Multi-stage environment config targeting the recommendedpython:3.9-slimbase image[cite: 1].README.md: Setup, execution instructions, and expected output schemas[cite: 1].metrics.json: Sample output generated from a successful execution[cite: 1].run.log: Application logging output tracking validation steps and latency metrics[cite: 1].
To set up the Python virtual environment and execute the machine learning pipeline locally, use the following sequential commands:[cite: 1]
Ensure you have Python installed locally (the script is fully tested across Python 3.9 through Python 3.12)[cite: 1].
# 1. Navigate to the project root directory
cd MLOps-Task-0
# 2. Create an isolated virtual environment
python -m venv venv
# 3. Activate the virtual environment
# On Windows (PowerShell):
.\venv\Scripts\Activate.ps1
# On Windows (CMD):
.\venv\Scripts\activate.bat
# On Linux/macOS:
source venv/bin/activate
# 4. Upgrade pip and install mandatory dependencies
pip install --upgrade pip
pip install -r requirements.txt
```[cite: 1]
### Pipeline Execution[cite: 1]
Run the core script by explicitly passing the required command-line arguments:[cite: 1]
```bash
python run.py --input data.csv --config config.yaml --output metrics.json --log-file run.log
```[cite: 1]
---
## 🐋 2. Docker Build & Run Commands[cite: 1]
The pipeline is completely dockerized to guarantee environment isolation and seamless automated grading[cite: 1].
### Build the Image[cite: 1]
To build the Docker image with the official evaluation tag `mlops-task`, run:[cite: 1]
```bash
docker build -t mlops-task .
```[cite: 1]
### Run the Container[cite: 1]
Execute the containerized pipeline[cite: 1]. The container automatically processes the internal datasets, creates the tracking artifacts, writes logs, and streams the metric schema directly to standard output (`stdout`):[cite: 1]
```bash
docker run --rm mlops-task
```[cite: 1]
---
## 📊 3. Example metrics.json[cite: 1]
Upon a successful execution, the pipeline outputs a deterministic metrics JSON block to `stdout` with an exit code of `0`[cite: 1]. Below is the exact structural schema produced:[cite: 1]
```json
{
"version": "v1",
"rows_processed": 10000,
"metric": "signal_rate",
"value": 0.4989,
"latency_ms": 116,
"seed": 42,
"status": "success"
}
```[cite: 1]
*Note: The `latency_ms` value will vary slightly depending on your host system's compute performance, while the metric calculation remains deterministic based on the configured seed.*[cite: 1]