Oltre il Worker Role, da Serverless computing a VM Scale Set

22
PRESENTA Cosa c’è oltre il Worker Role: dagli Scale Set al “serverless computing” Vito Flavio Lorusso – Senior SDE - Microsoft

Transcript of Oltre il Worker Role, da Serverless computing a VM Scale Set

Page 1: Oltre il Worker Role, da Serverless computing a VM Scale Set

P R E S E N TA

Cosa c’è oltre il Worker Role: dagli Scale Set al “serverless computing”Vito Flavio Lorusso – Senior SDE - Microsoft

Page 2: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 2

• Cosa intendiamo per «scalable» Worker

• In Azure:Come si realizzavano solo 2 anni fa

Quali scelte abbiamo oggi

Agenda

Page 3: Oltre il Worker Role, da Serverless computing a VM Scale Set

3Proudly produced by scalable workers in Camino

Page 4: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 4

Job host

Anatomia di un Worker

My long running job

Job journal

Another long running job

Yet another long running job

Job scheduler

Page 5: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 5

Solo 2 anni fa Worker role

Storage queue

Storage table

Sviluppo/Debug Visual Studio, Eclipse o text editorLinguaggi .NET, Java, PHP (o qualunque runtime su windows)Deploy Creazione di un .cspkg (signed zip)Autoscale CPU, RAM, NetworkCI/CD Visual Studio, PSH o VSTSPersonalizzazione OS

Startup Script

Manutenzione OS Update automatico

OS

.cspkg

code.cloudconfig

.serviceconfig

Page 6: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 6

OggiCome implemento uno scalable worker in Azure?

Functions (serverless è

il futuro!)WebJobs

(facile dai!)Containers! Cos’altro?

Service Fabric (microservizi… serve dire

altro?)

Scale Sets (sempre vicini

al metallo)

Batch? (tutti ne parlano ma non so cosa sia)

Page 7: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 7

Functions

Page 8: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 8

Functions

Storage table

Sviluppo/Debug Visual Studio Code – Debug limitatoLinguaggi .NET, NodeJSDeploy Publish su Git repoAutoscale Basato su trigger o su App Service (CPU, RAM, Network)CI/CD VSTS – GITPersonalizzazione OS

Nessuna

Manutenzione OS Update automatico

OS

App Service

.initcode

[TRIGGER]

Page 9: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 9

Webjobs

Page 10: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 10

WebJobs

Storage table

Sviluppo/Debug Visual Studio o altri editor di codice

Linguaggi .exe - .NET assemblies compiled with the WebJobs SDK .cmd, .bat, .exe (using windows cmd) .sh (using bash) .php (using php) .py (using python) .js (using node)

Deploy Come Web App (Visual Studio, Git, VSTS)

Autoscale Basato su App Service (CPU, RAM, Network)

CI/CD VSTS – GIT

Personalizzazione OS Nessuna

Manutenzione OS Update automatico

OS

App Service

JobHostcode

[TRIGGER]

Scheduler

WebJobs

Page 11: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 11

Batch

Page 12: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 12

Batch

Sviluppo/Debug Visual Studio o altri editor di codice

Linguaggi Powershell, .NET, CLI, Java, Node.js, Python

Deploy Visual Studio, VSTS, Azure Resource Manager

Autoscale Parametri custom con la Batch Library

CI/CD VSTS – ARM

Personalizzazione OS Nessuna

Manutenzione OS Update automatico

OS

Batch

Application Package (.zip)

Page 13: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 13

Service Fabric

Page 14: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 14

Service Fabric

Sviluppo/Debug Visual Studio o altri editor di codice

Linguaggi .NETJava (preview)

Deploy Visual Studio, VSTS, ARM

Autoscale Basato su VM Scale Set (CPU, RAM, Network) o custom

CI/CD VSTS – ARM

Personalizzazione OS Nessuna

Manutenzione OS e Service Fabric Host Update automatico o manuale

VM Scale SetOS

Service Fabric Host

Node Typecode

Storage queue[Custom]

Service Fabric[Local Storage]

(stateful service)

Page 15: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 15

Azure Container Service

Page 16: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 16

Container Service

Sviluppo/Debug Qualunque editor di codice

Linguaggi Qualunque (a seconda del sistema operativo)

Deploy ARM, DockerFile

Autoscale Basato su VM Scale Set (CPU, RAM, Network) o custom (API di ACS)

CI/CD VSTS – ARM

Personalizzazione OS Completa

Manutenzione OS e Docker Host Update manuale

VM Scale SetOS

Docker Host

Docker Container

[Custom]

[Custom] SwarmDCOSMESOS

Page 17: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 17

VM Scale Sets

Page 18: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 18

VM Scale Sets

Sviluppo/Debug Qualunque editor di codice

Linguaggi Qualunque (a seconda del sistema operativo)

Deploy ARM e quello supportato dallo stack applicativo

Autoscale CPU, RAM, Network

CI/CD ARM e quello supportato dallo stack applicativo

Personalizzazione OS Completa

Manutenzione OS e Application host manuale

VM Scale SetOS

Your App HostCustom components

[Custom]

[Custom]Custom code

Page 19: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 19

Wrap UPIniziate dal codice (Functions)

Requisiti perfetti per Batch? Usate Batch!

Scendete di livello solo se avete «veramente» bisogno di più performance o flessibilità

Usate ACS «solo» se la vostra infrastruttura è già docker centrica

Service Fabric è «potentissimo» ma parte da 5-10 nodi in produzione

Page 20: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 20

Q&ADomande e Risposte

Page 21: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 21

Risorse• Link utili

Functions https://docs.microsoft.com/en-us/azure/azure-functi

ons/index WebJobs

https://docs.microsoft.com/en-us/azure/app-service-web/websites-webjobs-resources

Batch https://docs.microsoft.com/en-us/azure/batch/

Service Fabric https://docs.microsoft.com/en-us/azure/service-fabr

ic/

Container Service https://docs.microsoft.com/en-us/azure/container-s

ervice/

VM Scale Sets https://docs.microsoft.com/en-us/azure/virtual-mac

hine-scale-sets/

Page 22: Oltre il Worker Role, da Serverless computing a VM Scale Set

www.wpc2016.it – [email protected] - +39 02 365738.11 22

Contatti OverNet Education

OverNet [email protected]. 02 365738

@overnetewww.facebook.com/OverNetEducationwww.linkedin.com/company/overnet-solutionswww.wpc2016.it