E1 - CI, CD for ML systems

ordinary software

Developer
   ↓
Pull Request
   ↓
CI
├── lint
├── unit tests
├── security checks
└── build
   ↓
merge
   ↓
CD
   ↓
deploy application
CI - continuous integration

  • checks if the proposed change is safe enough to integrate into the shared codebase

CD - continuous deployment/delivery

  • deals with moving an accepted change toward an environment such as staging or production

changeCI validated change CDdeployed change

ML

detector-ml/
│
├── src/
│   ├── preprocess.py
│   ├── train.py
│   ├── evaluate.py
│   └── score.py
│
├── tests/
│   ├── test_preprocess.py
│   └── test_score.py
│
├── components/
│   ├── preprocess.yml
│   ├── train.yml
│   └── evaluate.yml
│
├── pipelines/
│   └── training.yml
│
├── environments/
│   └── training.yml
│
├── infra/
│   └── main.bicep
│
└── .github/
    └── workflows/

pull-request CI

PR
 ↓
checkout repository
 ↓
install test dependencies
 ↓
lint/static checks
 ↓
unit tests
 ↓
pipeline/component validation
 ↓
security checks
 ↓
PASS / FAIL
test cheap things cheaply
unit tests

  • tests a small isolated piece

integration test

  • tests whether multiple pieces work together

smoke test

  • tests if the basic system is working at all

infrastructure CI/CD

Bicep change
   ↓
syntax/lint validation
   ↓
ARM validation
   ↓
WHAT-IF
   ↓
review proposed changes
main.bicep
   ↓
GitHub Actions
   ↓
authenticate
   ↓
Azure deployment
   ↓
ARM
   ↓
desired infrastructure state

ML pipeline CD

merge
 ↓
authenticate to Azure
 ↓
register/update required ML assets
 ↓
submit Azure ML training pipeline
GitHub Actions
      ↓
Azure ML
      ↓
actual training compute
GitHub coordinates, Azure ML executes

model deployment CD

approved model:v29
       ↓
deployment workflow
       ↓
create green
       ↓
smoke test
       ↓
canary
       ↓
monitor
       ↓
promote traffic

workflow separation

.github/workflows/

ci.yml  # for PR tests and validation
infra-deploy.yml  # for  aprooved infra change andBicep deployment
train.yml  # for scheduled/approved trigger and Azure ML training pipeline
model-deploy.yml  # for approved candidate and safe endpoint rollout

environments

secrets

GitHub Actions
      ↓
GitHub-issued OIDC token
      ↓
Microsoft Entra trusts
specified GitHub identity
      ↓
Azure access token
      ↓
Azure operations