Approcci DevOps per il
Rilascio Continuo di Modelli
ML su Azure
Igor Antonacci – Automation Lover
Luca Milan – IT & DevOps addicted
Combinare le pratiche DevOps e le potenzialità di
GitHub per il rilascio continuo e condizionato
di prodotti di AI su Azure.
Platinum Sponsor
Gold Sponsor
Technical Sponsor
Agenda
❑Introduzione
❑DevOps & Machine Learning = MLOps
❑Tools e Metodologie
❑Demo Time
© Copyright Microsoft Corporation. All rights reserved.
Computer Science
AI
Development
IT
Operations
ML: Peculiarità
Matrice
Matematica
Strumenti
Dedicati
Ciclo di
Vita
Modalità
Rilascio
Codice
Dati
Modello
ML: Ciclo di Vita
Training
Data
Learning
Process
Learned
Function
Scoring
or
Serving
Get fresh data and training again
Machine Learning senza Python
DevOps Pipeline 4 ML
Data or Algorithm
updated
Function Code
updated
Infrastructure
updated
ML.NET
Training
Deploy
Model
Pulumi Up
Deploy
Function
Yes
DevOps
Done
No
Build & Test
Triggers
C# Code
Scoring/Serving
Micro UI
ML Training
Predictor
Micro UI
Code + Data
Github Pipelines
(Re)Feed ML Pipeline
Solution
Overview
IGOR ANTONACCI
© Copyright Microsoft Corporation. All rights reserved.
Obiettivo organizzativo
All’interno di un Team di sviluppo, facilitare il dispiegamento di
Modelli di IA attraverso:
• la COOPERAZIONE tra Data Scientists e IT Operations
• L’AUTOMAZIONE del processo di Analisi, Sviluppo, Test e
rilascio di un modello
© Copyright Microsoft Corporation. All rights reserved.
MLOps
“With Machine Learning Model Operationalization Management (MLOps),
we want to provide an end-to-end machine learning development process
to design, build and manage reproducible, testable, and evolvable ML-
powered software.”
(cit. ML Ops: Machine Learning Operations (ml-ops.org))
Solution Architecture
Prediction Pipeline
v0.1.0-abcdef
Training Model Pipeline
Micro-UI Pipeline
Branching model
for Data Scientists
MAIN
experiment / model-refininig_001
experiment / ml-net_release-change_001
Pull Request
✓ Model
(Code)
✓ Test
✓ Dataset
✓ Review
✓ Approve
✓ Merge
GitHub Actions to the
rescue
COMMIT
✓ Model (Code)
✓ Test
✓ Dataset
✓ Build
✓ Test
✓ Training
Pull-request
✓ Review
✓ Approve
✓ Merge
Training Model
GitHub Environments
✓ on push
✓ on pull-request
✓ …
Job #1 Job #2
Action 1 – Setup .NET Core
Action 2 – Build project
Action 3 – Test project
Action N – …
Action 1 – GitVersion
Action 2 – Create Release
Action 3 – Publish Artifacts
Action N – …
Depends on
Secrets
✓ on push
✓ on pull-request
✓ …
Job #1 Job #2
Action 1 – Setup .NET Core
Action 2 – Build project
Action 3 – Test project
Action N – …
Action 1 – GitVersion
Action 2 – Create Release
Action 3 – Publish Artifacts
Action N – …
Depends on
Environment
Approvers
GitHub Environments
COMMIT
✓ Model (Code)
✓ Test
✓ Dataset
✓ Build
✓ Test
✓ Training
✓ Trained Model
✓ Dataset
Pull-request
✓ Review
✓ Approve
✓ Merge
Approvazione
Promozione
✓ Review
✓ Approve
Serving “Environment”
Training Model
Dispatch Message
▪ event_type: model-created
▪ message: |
{
"ML_MODEL_VERSION": vX.Y.Z-xxxx,
"ML_MODEL_URI":
https://github.com/igoran/.../${{
env.VERSION_NAME }}.zip
}
GitHub as Artifact
Repository
COMMIT
✓ Model (Code)
✓ Test
✓ Dataset
✓ Build
✓ Test
✓ Training
✓ Trained Model
✓ Dataset
Pull-request
✓ Review
✓ Approve
✓ Merge
Approvazione
Promozione
✓ Review
✓ Approve
Serving “Environment”
Dispatch Message
▪ event_type: model-created
▪ message: |
{
"ML_MODEL_VERSION": vX.Y.Z-xxxx,
"ML_MODEL_URI":
https://github.com/igoran/.../${{
env.VERSION_NAME }}.zip
}
Training Model
0.1.0-c28c8ba
GH Actions – Workflow
Dispatch
COMMIT
✓ Model (Code)
✓ Test
✓ Dataset
✓ Build
✓ Test
✓ Training
✓ Trained Model
✓ Dataset
Pull-request
✓ Review
✓ Approve
✓ Merge
Approvazione
Promozione
✓ Review
✓ Approve
Serving “Environment”
Training Model
Dispatch Message
▪ event_type: model-created
▪ message: |
{
"ML_MODEL_VERSION": vX.Y.Z-xxxx,
"ML_MODEL_URI":
https://github.com/igoran/.../${{
env.VERSION_NAME }}.zip
}
GH Actions – Workflow
Dispatch
SETUP INFRA
✓ Build
✓ Test
Azure
Deployment
Slots
model-created
✓ Trained Model
✓ Dataset
Download Model
PROD DEV
Predictor
MicroUI Pipeline
DEPLOY
✓ Build
✓ Test
FrontEnd Dev
Scoring/Serving
Micro UI
ML Training
Predictor
Micro UI
Code + Data
Github Pipelines
(Re)Feed ML Pipeline
Solution
Overview
© Copyright Microsoft Corporation. All rights reserved.
PULUMI
▪ Infrastructure-as-Code Framework
▪ Multi-Platform Providers (AWS, Azure, GCP … )
▪ (Multi-)Language oriented
▪ C#, Python, Go …
▪ CLI ed Engine multi piattaforma (pulumi)
▪ NO YAML ☺
▪ Ambienti “sandboxed” →Stacks
DEMO
Platinum Sponsor
Gold Sponsor
Technical Sponsor

AI day2021 approcci DevOps per il rilascio continuo di modelli di machine learning su Azure

  • 1.
    Approcci DevOps peril Rilascio Continuo di Modelli ML su Azure Igor Antonacci – Automation Lover Luca Milan – IT & DevOps addicted Combinare le pratiche DevOps e le potenzialità di GitHub per il rilascio continuo e condizionato di prodotti di AI su Azure.
  • 2.
  • 3.
    Agenda ❑Introduzione ❑DevOps & MachineLearning = MLOps ❑Tools e Metodologie ❑Demo Time
  • 4.
    © Copyright MicrosoftCorporation. All rights reserved. Computer Science AI Development IT Operations
  • 5.
  • 6.
    ML: Ciclo diVita Training Data Learning Process Learned Function Scoring or Serving Get fresh data and training again
  • 7.
  • 8.
    DevOps Pipeline 4ML Data or Algorithm updated Function Code updated Infrastructure updated ML.NET Training Deploy Model Pulumi Up Deploy Function Yes DevOps Done No Build & Test Triggers C# Code
  • 9.
    Scoring/Serving Micro UI ML Training Predictor MicroUI Code + Data Github Pipelines (Re)Feed ML Pipeline Solution Overview
  • 11.
  • 12.
    © Copyright MicrosoftCorporation. All rights reserved. Obiettivo organizzativo All’interno di un Team di sviluppo, facilitare il dispiegamento di Modelli di IA attraverso: • la COOPERAZIONE tra Data Scientists e IT Operations • L’AUTOMAZIONE del processo di Analisi, Sviluppo, Test e rilascio di un modello
  • 13.
    © Copyright MicrosoftCorporation. All rights reserved. MLOps “With Machine Learning Model Operationalization Management (MLOps), we want to provide an end-to-end machine learning development process to design, build and manage reproducible, testable, and evolvable ML- powered software.” (cit. ML Ops: Machine Learning Operations (ml-ops.org))
  • 14.
  • 15.
    Branching model for DataScientists MAIN experiment / model-refininig_001 experiment / ml-net_release-change_001 Pull Request ✓ Model (Code) ✓ Test ✓ Dataset ✓ Review ✓ Approve ✓ Merge
  • 16.
    GitHub Actions tothe rescue COMMIT ✓ Model (Code) ✓ Test ✓ Dataset ✓ Build ✓ Test ✓ Training Pull-request ✓ Review ✓ Approve ✓ Merge Training Model
  • 17.
    GitHub Environments ✓ onpush ✓ on pull-request ✓ … Job #1 Job #2 Action 1 – Setup .NET Core Action 2 – Build project Action 3 – Test project Action N – … Action 1 – GitVersion Action 2 – Create Release Action 3 – Publish Artifacts Action N – … Depends on Secrets ✓ on push ✓ on pull-request ✓ … Job #1 Job #2 Action 1 – Setup .NET Core Action 2 – Build project Action 3 – Test project Action N – … Action 1 – GitVersion Action 2 – Create Release Action 3 – Publish Artifacts Action N – … Depends on Environment Approvers
  • 18.
    GitHub Environments COMMIT ✓ Model(Code) ✓ Test ✓ Dataset ✓ Build ✓ Test ✓ Training ✓ Trained Model ✓ Dataset Pull-request ✓ Review ✓ Approve ✓ Merge Approvazione Promozione ✓ Review ✓ Approve Serving “Environment” Training Model Dispatch Message ▪ event_type: model-created ▪ message: | { "ML_MODEL_VERSION": vX.Y.Z-xxxx, "ML_MODEL_URI": https://github.com/igoran/.../${{ env.VERSION_NAME }}.zip }
  • 19.
    GitHub as Artifact Repository COMMIT ✓Model (Code) ✓ Test ✓ Dataset ✓ Build ✓ Test ✓ Training ✓ Trained Model ✓ Dataset Pull-request ✓ Review ✓ Approve ✓ Merge Approvazione Promozione ✓ Review ✓ Approve Serving “Environment” Dispatch Message ▪ event_type: model-created ▪ message: | { "ML_MODEL_VERSION": vX.Y.Z-xxxx, "ML_MODEL_URI": https://github.com/igoran/.../${{ env.VERSION_NAME }}.zip } Training Model 0.1.0-c28c8ba
  • 20.
    GH Actions –Workflow Dispatch COMMIT ✓ Model (Code) ✓ Test ✓ Dataset ✓ Build ✓ Test ✓ Training ✓ Trained Model ✓ Dataset Pull-request ✓ Review ✓ Approve ✓ Merge Approvazione Promozione ✓ Review ✓ Approve Serving “Environment” Training Model Dispatch Message ▪ event_type: model-created ▪ message: | { "ML_MODEL_VERSION": vX.Y.Z-xxxx, "ML_MODEL_URI": https://github.com/igoran/.../${{ env.VERSION_NAME }}.zip }
  • 21.
    GH Actions –Workflow Dispatch SETUP INFRA ✓ Build ✓ Test Azure Deployment Slots model-created ✓ Trained Model ✓ Dataset Download Model PROD DEV Predictor
  • 22.
  • 23.
    Scoring/Serving Micro UI ML Training Predictor MicroUI Code + Data Github Pipelines (Re)Feed ML Pipeline Solution Overview
  • 24.
    © Copyright MicrosoftCorporation. All rights reserved. PULUMI ▪ Infrastructure-as-Code Framework ▪ Multi-Platform Providers (AWS, Azure, GCP … ) ▪ (Multi-)Language oriented ▪ C#, Python, Go … ▪ CLI ed Engine multi piattaforma (pulumi) ▪ NO YAML ☺ ▪ Ambienti “sandboxed” →Stacks
  • 25.
  • 27.