How graviraja/mlops-basics works
Main Components
• Data and Preprocessing Module: Capture code related to data ingestion (data.py files), experimentation (notebooks) and any initial preprocessing.
• Model Training & Inference: Represent the core training (train.py) and inference (inference.py, inference_onnx.py) components. Note that model definitions (model.py) evolve throughout different weeks.
• Experiment Tracking & Logging: Include a dedicated module for Weights & Biases integration as introduced in Week 1.
• Configuration Management: Emphasize the role of Hydra in managing configurations (the configs directories in Week 2 onward).
• Data & Model Versioning: Clearly denote the use of DVC (shown through DVC files and directories) to version both data and models.
• Model Packaging: Create separate nodes for ONNX (Week 4) and Docker (Week 5 and later). For Docker, indicate how container images (via Dockerfile, docker-compose.yml) encapsulate the application.
• CI/CD Pipeline: Highlight the use of GitHub Actions (Week 6) to integrate building, testing, and deployment.
• Container Registry & Cloud Deployments: Mark components for pushing container images (AWS ECR in Week 7) and triggering serverless deployments (AWS Lambda with API Gateway in Week 8).
• Monitoring & Logging: Include the end-stage where logging and monitoring are performed (Week 9 with Kibana, CloudWatch, and Elasticsearch).
Relationships and Data Flow
• That configurations are centrally managed (via Hydra) and feed into the training, inference, and packaging modules.
• That after training, versioned models (via DVC) travel to packaging components (ONNX conversion, Dockerization) before being pushed to container registries.
• That CI/CD (triggered by GitHub Actions) automates building container images and deployment to AWS services.
• Finally, connect the deployed services to the Monitoring setup, showing data/feedback loops that help detect issues.
Architectural Patterns & Design Principles
• Modularity: Each “week” can be viewed as an evolutionary layer or module that builds upon the previous stage.
• Separation of Concerns: Differentiated components for training, configuration, packaging, deployment, and monitoring.
• Automation & Reproducibility: Emphasize CI/CD pipelines and version control (DVC) that ensure consistency across environments.
• Cloud-Native & Containerization: Underline the move from a local environment to containerized, serverless deployments.
Of Key Technologies and Frameworks
• Huggingface Datasets/Transformers, PyTorch Lightning for model building.
• Weights & Biases (W&B) and TorchMetrics for experiment tracking.
• Hydra for managing configurations.
• DVC for data versioning.
• ONNX and ONNXRuntime for model packaging.
• Docker and Docker Compose for containerization.
• GitHub Actions for CI/CD.
• AWS services including ECR, Lambda, API Gateway (for serverless) and S3 (for remote storage in DVC setups).
• Kibana (backed by Elasticsearch and CloudWatch) for monitoring.