SageMaker Modelling Pipeline

Train · Evaluate · Register (MLOps quality gates)

Fully automated ML training pipeline on AWS: data preprocessing, XGBoost training, evaluation with conditional quality gate (MSE), and governed model registration in SageMaker Model Registry. Triggered via GitHub Actions + OIDC.

Project Summary

MLOps · Pipeline-2 (Train/Evaluate/Register)

AI/ML type

Supervised regression (XGBoost) + automated MLOps

Domain

AWS SageMaker · Model building & registration

DevOps focus

CI/CD for ML (GitHub Actions + OIDC + SageMaker Pipelines)

Key technologies

AWS + CI/CD + containers

SageMaker Pipelines GitHub Actions OIDC → IAM Amazon ECR S3 (artifacts) Model Registry CloudWatch XGBoost / Python quality gates

Problem & Objective

Why this pipeline?

Problems solved

  • Manual training → non‑reproducible experiments, inconsistent evaluation
  • No quality gates → bad models could reach production
  • Lack of governance & traceability

Primary objectives

  • Fully automated train/eval/register pipeline on AWS
  • Conditional registration based on MSE threshold
  • Integrate CI/CD with GitHub Actions + OIDC (no static secrets)

Solution & Architecture

SageMaker Pipeline · quality gate

Overview

SageMaker Pipeline with steps: Process → Train → Evaluate → Conditional Register. Triggered via GitHub Actions (Linux runner) that assumes IAM role through OIDC. Evaluation metrics (MSE) are written to JSON; only models that pass threshold are registered in SageMaker Model Registry with approval workflow enabled. Artifacts stored in S3, images in ECR.

Quality gate: if MSE > threshold, pipeline stops – bad model never registered.
GitHub → OIDC → IAM → SageMaker Pipeline (Process ▸ Train ▸ Eval ▸ Condition) → Registry
1
Git push
2
GitHub Actions
3
OIDC assume
4
SageMaker Pipeline
5
Model Registry

Skills & Technologies

ML engineering + AWS

Primary skills

  • Amazon SageMaker Pipelines (advanced)
  • MLOps: training/evaluation/registry (advanced)
  • CI/CD with GitHub Actions + OIDC (advanced)
  • Docker, ECR, IAM, CloudWatch

Languages & tools

  • Python (SDK, processing/training scripts)
  • YAML (GitHub workflows, pipeline config)
  • XGBoost / scikit-learn

Pipeline execution & governance

conditional registration + approvals

Execution

  • Trigger: push to main or workflow_dispatch
  • GitHub runner: ubuntu-latest, assumes IAM role via OIDC
  • SageMaker Pipeline execution: processing (prep), training (XGBoost), evaluation (MSE to JSON)
  • Conditional step: if metrics pass → register model (status pending/manual approval)

Governance & controls

  • Quality gate on MSE – auto‑reject underperforming models
  • Model Registry approval workflow (manual approval step before production)
  • Least‑privilege IAM roles + KMS encryption for S3
  • CloudWatch logs for every job (traceability)

AWS CI/CD · YAML mapping

GitHub Actions → SageMaker Pipeline

Architecture blockAWS / YAML construct
Source repositoryGitHub (ml-pipeline repo)
CI triggeron: [push, workflow_dispatch]
Runnerubuntu-latest + aws-actions/configure-aws-credentials (OIDC)
OrchestrationSageMaker Pipeline (Process→Train→Evaluate→Condition)
TrainingSageMaker Training Job (XGBoost container)
ProcessingSageMaker Processing (sklearn)
Artifact storageS3 (datasets, model.tar.gz, metrics.json)
Container registryAmazon ECR (custom images)
Model registrySageMaker Model Registry + manual approval
AuthOIDC (GitHub OIDC provider) → IAM role
LogsCloudWatch Logs

YAML steps: checkout, setup-python, pip install, run-pipeline (create/start), wait, publish status.

Assets & references

Code, diagrams, study material

Repository

MLOps CDK repo: reference implementation for GitHub Actions and SageMaker pipeline orchestration.

github.com/03sarah/...

Study Material Resources

Official docs, restricted guides, workflow notes

Request Study Material

SageMaker MLOps · study pack

AWS SageMaker Pipeline deep dive
Official documentation + custom YAML examples
PDF
CDK for ML pipelines
Restricted · infrastructure as code for Pipeline-2
PDF
OIDC + GitHub Actions AWS auth
Step‑by‑step guide with IAM policies
PDF
Model Registry & approval workflows
Governance patterns, manual approval setup
PDF