Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

MLOps Platform Technical Assignment

Role Level

G13

Problem Statement

The objective of this project is to build a representative, robust MLOps application utilizing a Python backend and an Angular GUI. The platform provides full-lifecycle model management, including capabilities to register, version, approve, deploy, monitor, and seamlessly roll back machine-learning models. It features strong guardrails ensuring that unapproved or archived models cannot be deployed to sensitive environments.

Architecture Summary

The system is divided into two primary tiers:

  • Backend: A FastAPI application that handles business logic, state transitions (like approving or archiving versions), simulated asynchronous deployments, and metric delivery. It integrates with a PostgreSQL database via SQLAlchemy.
  • Frontend: A standalone Angular 18 Single-Page Application (SPA) leveraging Angular Material for a responsive, modern UI. State and API integration are managed cleanly via RxJS and Angular's HTTP Client.

Architecture Diagram

The entire application runs in isolated, orchestrated Docker containers for identical development and production behaviors.

Technology Stack

  • Backend: Python 3.11+, FastAPI, SQLAlchemy, PostgreSQL, Pytest
  • Frontend: Angular 18, TypeScript, Angular Material, RxJS, Vitest, Playwright
  • Infrastructure: Docker, Docker Compose

Setup and Run Instructions

  1. Clone the repository.
  2. Set up the environment variables by copying the example file:
    cp .env.example .env
  3. Run the application using Docker Compose (this provisions both the frontend, backend, and database containers):
    docker compose up --build
  4. Access the Angular UI at http://localhost:4200
  5. Access the backend API at http://localhost:8000

Test Commands

A comprehensive test suite validates end-to-end functionality, from backend business logic to component rendering and automated browser interaction.

Option 1: Run via Docker (Recommended)

If you don't want to install Node.js or Python locally, you can run the tests inside isolated, ephemeral Docker containers:

  • Backend (Unit & Integration):
    docker compose run --rm backend-test
  • Frontend (Component Tests):
    docker run --rm -v $(pwd)/frontend:/app -w /app mcr.microsoft.com/playwright:v1.49.0-noble bash -c "npm install --legacy-peer-deps && npm run test -- --watch=false"
  • Frontend (Playwright E2E): (Note: Ensure the platform is running via docker compose up -d first so Playwright can reach http://localhost:4200)
    docker run --rm --network host -v $(pwd)/frontend:/app -w /app mcr.microsoft.com/playwright:v1.49.0-noble bash -c "npm install --legacy-peer-deps && npx playwright test"
    (On macOS, --network host doesn't expose localhost. Instead, use: docker run --rm -e PLAYWRIGHT_BASE_URL=http://host.docker.internal:4200 -v $(pwd)/frontend:/app -w /app mcr.microsoft.com/playwright:v1.49.0-noble bash -c "npm install --legacy-peer-deps && npx playwright test")

Option 2: Run Locally

If you have the dependencies installed on your host machine:

  • Backend (Unit & Integration):
    cd backend && pytest
  • Frontend (Component Tests):
    cd frontend && npm run test
  • Frontend (Playwright E2E):
    cd frontend && npx playwright test

API Documentation Location

The interactive Swagger/OpenAPI documentation is available at: http://localhost:8000/docs

UI Screenshots

Model Inventory
Model Inventory
Create Model
Create Model
Model Created
Model Created
Create Version
Create Version
Version Created
Version Created
Version Approved
Version Approved
Deployment Requested
Deployment Requested
Deployment Validating Stage
Deployment Validating Stage
Deploying Stage
Deploying Stage
Cannot Deploy Archived
Cannot Deploy Archived
Cannot Deploy Unapproved
Cannot Deploy Unapproved
Metrics Page
Metrics Page
CI Tests Passing in GitHub
CI Tests Pass

Sample Workflows

To test the core acceptance scenarios, follow this flow:

  1. Explore Inventory: Visit http://localhost:4200/models to see registered models.
  2. Register Version: Click into a model, and click New Version. Fill out the artifact URI and set stage to DRAFT.
  3. Approve: Once created, click the Approve button on the new version row.
  4. Deploy: Click the Deploy button. Wait ~10 seconds while the simulated deployment runs. You can watch the status transition to SUCCEEDED on the Deployments tab.
  5. Rollback: To rollback a successful deployment, go to the Deployments tab and click the Rollback button, which seamlessly initiates a safe regression to the prior deployment.

Known Limitations

  • The deployment flow is simulated via background tasks. It does not actively spin up Kubernetes pods or provision cloud infrastructure.
  • The application does not currently implement authentication and granular Role-Based Access Control (RBAC).
  • Delete operations for models and model versions are not currently supported.
  • During a deployment rollback, the user cannot select a specific version to roll back to (it automatically defaults to the previous stable state).

Future Improvements

  • Features: Add support for model deletion and enable users to choose specific target versions when performing rollbacks.
  • Security: Integrating Auth0 or Firebase Auth for secure login and permission management.
  • Advanced Monitoring: Real-time WebSocket subscriptions to stream model metrics to the frontend dynamically.
  • Production CI/CD: Adding GitHub Actions workflows for continuous automated testing and deployment.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages