Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/characat0/mlops-fundamentals-homework/llms.txt

Use this file to discover all available pages before exploring further.

The .github/workflows/ci.yml pipeline runs automatically on every push to a pull request targeting the main branch. It validates your implementation against the full test suite and linter before any review happens — a green checkmark is worth 1 grading point and signals that your code satisfies both style and correctness requirements.

Pipeline Overview

The pipeline defines a single job, test, with five sequential steps:
StepToolWhat it does
Checkoutactions/checkout@v3Clones the repository into the runner
Set up Pythonactions/setup-python@v4Installs Python 3.9 on ubuntu-latest
Install dependenciespipInstalls flake8, pytest, and all three requirements.txt files
Run Linterflake8Checks the entire repository against .flake8 rules
Run TestspytestRuns data_pipeline/tests then model_serving/tests
Both the linter and test steps run sequentially within the same job. If flake8 reports any error, the job fails before pytest runs.

Full ci.yml

name: CI Pipeline

on:
  pull_request:
    branches:
      - main

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set up Python
        uses: actions/setup-python@v4
        with:
          python-version: '3.9'

      - name: Install dependencies
        run: |
          pip install flake8 pytest
          pip install -r data_pipeline/requirements.txt
          pip install -r model_serving/requirements.txt
          pip install -r drift_monitoring/requirements.txt

      - name: Run Linter
        run: flake8 .

      - name: Run Tests
        run: |
          pytest data_pipeline/tests
          pytest model_serving/tests

Getting a Green Checkmark

1

Fork the repo on GitHub

Navigate to the repository on GitHub and click Fork to create your own copy under your account.
2

Create a solution branch

git checkout -b solution/your-name
3

Implement all TODOs

Fill in every # TODO block in the source files — data_pipeline/src/load.py, data_pipeline/src/process.py, model_serving/app/main.py, and drift_monitoring/src/analyze_drift.py.
4

Run tests locally

pytest data_pipeline/tests model_serving/tests
All 9 tests must pass before you push.
5

Run flake8 locally

flake8 .
Fix every reported issue. The .flake8 config allows lines up to 100 characters and ignores E203.
6

Push and open a Pull Request

Push your branch and open a PR targeting main on the upstream repository.
7

Watch the Actions tab

Navigate to the Actions tab on GitHub and wait for the CI Pipeline workflow to complete. A green tick on all steps means you’re done.
Run both checks locally before pushing to avoid wasting CI runs — each push to the PR branch triggers a fresh pipeline execution.

Troubleshooting

The .flake8 config sets max-line-length = 100. For lines that genuinely cannot be shortened (e.g. long log strings or URLs), append # noqa: E501 to suppress the warning on that line. For most cases, break the line using implicit string continuation or a backslash:
# Too long
logger.info(f"Training samples: {len(train_df)} | Production samples: {len(prod_df)} | Status: ok")

# Fixed — break at a logical boundary
logger.info(
    f"Training samples: {len(train_df)} | "
    f"Production samples: {len(prod_df)} | Status: ok"
)
Each test file uses relative imports (from src.load import load_data). Run pytest from the module root, or set PYTHONPATH explicitly:
# From the repo root — correct
pytest data_pipeline/tests

# If pytest still can't find src/
PYTHONPATH=data_pipeline pytest data_pipeline/tests
PYTHONPATH=model_serving pytest model_serving/tests
The most common cause is uncommitted files. Check your git status before pushing:
git status
git add -A
git commit -m "implement all TODOs"
git push origin solution/your-name
Also verify that your local Python version matches the CI runner (3.9) — some syntax or library behaviour differs between minor versions.

Build docs developers (and LLMs) love