J.L. Boucho, J.Corioland - Azure et les Microservices - Global Azure Bootcamp 2016 Paris
1. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
1
Azure et les Microservices
Jean-Luc BOUCHO Julien CORIOLAND
Architecte, Manager Azure Technical Evangelist
@JeanLucBoucho @jcorioland
5. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Martin Flower & James Lewis (http://martinfowler.com/articles/microservices.html)
« The microservice architectural style is an approach to developing a single
application as a suite of small services, each running in its own process and
communicating with lightweight mechanisms, often an HTTP resource API.
These services are built around business capabilities and independently
deployable by fully automated deployment machinery »
• Objectif : construire des Applications / Systèmes…
– Plus robustes
– Plus scalables
– Plus évolutifs
– Plus denses
Architecture Microservices
5
8. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
Architecture Microservices
8
Principes
- Découpage en Services
Métiers capables
d’évoluer de manière
indépendante
- Gouvernance
« Produit »
- Communication
interservices légère (pas
d’ESB)
- Gestion des Données
décentralisée
- Infrastructure
automatisée
Challenges
- Granularité du Service
- Dépendances
interservices
- Gestion des services
- Transactions multi-
services
- Synchronisation des
Données
- Gestion de la sécurité
Approches
- DDD
- Mécanismes de
résilience (circuit breaker,
retries, fallback…)
- DevOps (CI/CD)
- Cloud
- Container
- API Gateway
- Suivi des Performances
- Agrégation des Logs
9. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Netflix
• Linkedin
• Amazon
• Ebay
• Google
• ING
• …
Adoption… #Microservices
9
Shop Example (http://fr.slideshare.net/smancke/fros-con2014-microservicesarchitecture)
10. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Docker Swarm et Docker Compose
• Mesosphere DCOS, avec Apache Mesos et Marathon
-> Azure Container Service
• Kubernetes
• Red Hat OpenShift
• Pivotal Cloud Foundry
-> Azure VMs
-> Azure Service Fabric
Plateformes Microservices
10
12. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
Machine Virtuelles VS Conteneurs
Host OS
Hypervisor
Host OS
Container Engine
Guest
OS
Guest
OS
Guest
OS
App
Framework
App C
App
Framework
App
Framework
AppA
AppA’
AppB
AppB’
AppC
AppC’
AppC’’
App
Framework
App B
App
Framework
App A
14. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
API DBWeb
Docker Hub/
Repository
Update, customize, add code
Pull
images
Publish
Deploy
containers
WebWeb Web
API
API
DB
15. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Azure Virtual Machine
– Utilisation des images « Container Apps » de la Marketplace
– Création via Docker Machine
– Utilisation de Docker Virtual Machine Extension for Linux
Docker sur Azure
20. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Azure Container Service
– Utilisation d’un cluster d’hôtes
– Automatisation de la création de l’infrastructure
– Choix entre Docker Swarm ou Apache Mesos (Marathon et Chronos)
Docker sur Azure #2
24. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
La plateforme Microsoft Azure Service Fabric
Service FabricHigh Availability
Hyper-Scale
Hybrid Operations
High Density
Microservices
Rolling Upgrades
Stateful Services
Low Latency
Fast Startup &
Shutdown
Code Orchestration &
Lifecycle Management
Replication &
Failover
Simple
programming
models
Resource Management
Self-healingData Partitioning
Automated Rollback
Health
Monitoring
Placement
Constraints
Azure Private cloud Other clouds
25. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Azure Service Fabric est GA
– Création de Clusters via ARM &
Portail
– Améliorations de Performance,
Densité & Scalabilité
– Améliorations API
• Preview
– Support Linux
– Support Java
– Containers Docker & Windows
– Clusters On-Premises
//BUILD 2016
25
26. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Service Type = Package de Code + Config + Data
– Unité de versioning et de mise à jour
• Code (EntryPoint)
– Tout exécutable
– “Reliable Services” API, stateless ou statefull (ReliableDictionary ou ReliableQueue)
– “Reliable Actors” API, stateless ou statefull
– Containers Docker
Principes (1/2)
26
28. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
var requestQueue =
await this.StateManager.GetOrAddAsync<IReliableQueue<CustomerRecord>>(“requests");
var personDictionary =
await this.StateManager.GetOrAddAsync<IReliableDictionary<Guid, Person>>(“ppl");
...
using (var tx = this.StateManager.CreateTransaction())
{
var customerRequestResult = await requestQueue.TryDequeueAsync(tx);
await personDictionary.AddAsync(tx, customerId, customerRequestResult.Value.person);
await tx.CommitAsync();
}
Transaction de modification
28
29. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Monitoring
– Statut de bonne santé
– Métriques pour les Actors et Services
• Diagnostique et Troubleshooting
– Logs de la plateforme (création de l’application, mises à jour…)
– Logs custom : avec tracing ETW
– Outillage
• Visual Studio Diagnostics Events Viewer
• Windows Event Viewer
• Windows Azure Diagnostics + Operational Insights
• Intégration possible avec d’autres outils: Kibana, Elasticsearch, …
Supervision
29
30. Global Azure Bootcamp#GlobalAzure @AZUGFR PARIS - FRANCE
• Service Fabric : http://aka.ms/ServiceFabric
• Documentation : http://aka.ms/ServiceFabricDocs
• Examples : http://aka.ms/ServiceFabricSamples
• SDK : http://aka.ms/ServiceFabricSDK
• Service Fabric pour Windows Server :
http://aka.ms/ServiceFabricWS2012R2
• Inscription à Service Fabric pour Linux : http://aka.ms/SFlinuxpreview
• Feedback : http://aka.ms/ServiceFabricForum
Liens
30
Virtual Machines
Each VM has independent, full OS
Full isolation
Separate app frameworks
Support features such as live migration
Containers
Shared Host OS
Near instant start-up
Processes in containers are isolated
Dependent app services and libraries are tied to container (layers)
All containers on a host will share the OS version
Tagline de Docker en ce moment : Build, Ship, Run, Any App, Anywhere
Aller sur la documentation Azure Container Service sur azure.com pour trouver le Get Started
Trouver le template ACS qui correspond au déploiement que l’on souhaite puis Deploy to Azure
Expliquer quelques uns des paramètres nécessaires pour la création du template
Aller montrer un déploiement existant
Connexion en SSH au master
ssh -i /c/Users/benjat/.ssh/benjatswarm benjat@benjatswarmmgmt.northeurope.cloudapp.azure.com -A -p 2200
docker ps pour voir le swarm manage
docker -H 10.0.0.5:2375 pour aller voir le swarm join