Top Banner
Déployer en continu Benoît Lafontaine OCTO Technology
67

Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Jun 23, 2015

Download

Technology

Presentation played at USIEVENT 2013, see the presentation on youtube: http://www.youtube.com/watch?v=UcDtH5s406M&feature=share&list=PLyzb9DL11tdZBlz6nY8TZxMcqVf04K5wY
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Déployer en continu

Benoît Lafontaine OCTO Technology

Page 2: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Quelques chiffres

Facebook : > 2 déploiements par jour Flick : > 10 déploiements par jour Etsy : > 25 déploiements par jour Amazon : (1 déploiement toutes les 10 secondes sur 10000 machines)

Page 3: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Définitions

Page 4: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Continuous integration

A intervalle régulier, voire à chaque commit, le code est :

!   Compilé !   Testé !   Assemblé !   Déployé sur un environnement d’intégration

Page 5: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Continuous delivery

A intervalle régulier, voire à chaque commit, le code est :

!   Compilé !   Testé !   Assemblé !   Déployé sur un environnement d’intégration

!  Livré à l’équipe suivante (QA, MEP…)

Page 6: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Continuous deployment

A intervalle régulier, voire à chaque commit, le code est :

!   Compilé !   Testé !   Assemblé !   Déployé sur un environnement d’intégration !   Testé sur cet environnement (automatiquement) !  Déployé en production !!!

Page 7: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

POURQUOI, POURQUOI, POURQUOI ?

Page 8: Deployer en continu, Benoît Lafontaine, USIEVENT 2013
Page 9: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Feedback

Page 10: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

C’est pas déjà ce qu’on fait avec les méthodes Agiles ?

Page 11: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Page 12: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Page 13: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Dev

Code livré

Page 14: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Dev ???

Code livré

Page 15: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Page 16: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Dev FEEDBACKS

Page 17: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Pourquoi on le fait pas ?

Page 18: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

La peur

Page 19: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Perte de temps

Page 20: Deployer en continu, Benoît Lafontaine, USIEVENT 2013
Page 21: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Qualité ?

Page 22: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Page 23: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Beaucoup de changements =

Beaucoup de risques

Page 24: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Page 25: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Code produit

Temps

Code livré

Peu de changements =

Peu de risques

Page 26: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

John Allspaw, Etsy http://www.slideshare.net/jallspaw/ops-metametrics-the-currency-you-pay-for-change

Page 27: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Réduire la taille des déploiements…

Minimise les risques Réduit le « Time To Repair » (TTR) Réduit le temps d’indisponibilité

Page 28: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Déployer en continu c’est :

Construire un meilleur produit grâce à plus de feedbacks Gagner du temps en huilant son processus de déploiement Améliorer la qualité en limitant les risques d’une livraison

Page 29: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

COMMENT, COMMENT, COMMENT ?

Page 30: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Automatiser !

Page 31: Deployer en continu, Benoît Lafontaine, USIEVENT 2013
Page 32: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

DEVOPS

Page 33: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Déployer en 1 clic

Page 34: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

QUESTIONS, QUESTIONS, QUESTIONS !!!

Page 35: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question#1 : 0 commits ?

Page 36: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Vas-y commit…

Page 37: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Garantir la qualité

Intégration continue TESTS ! (automatisés bien sûr)

!   TDD !   Tests d’IHM !   Tests de performance !   …

Page 38: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Garantir la qualité

Page 39: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question #2 : En construction ?

Page 40: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

dissocier le déploiement de code de l'activation de fonctionnalité

Page 41: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Feature flipping

Page 42: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Flipping code

Page 43: Deployer en continu, Benoît Lafontaine, USIEVENT 2013
Page 44: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question #3 : Downtime ?

Page 45: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Blue green deployment

Page 46: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question #4 : Migration de schémas de BDD ?

Page 47: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Migration de schéma : solution

Séparer les scripts de migration en

!   Scripts d’expansion (ADD)

!   Scripts de contraction (DROP)

!   ALTER

Page 48: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Cas d’exemple

Page 49: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Exemple : Modification du champs adresse

Version N E

critu

re Lecture

Page 50: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Exemple : Modification du champs adresse

Version N

Ecr

iture

Lecture

Page 51: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Exemple : Modification du champs adresse

Version N+1

Ecr

iture

Lecture

Page 52: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Exemple : Modification du champs adresse

Version N+2

Lecture Ecr

iture

Page 53: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Exemple : Modification du champs adresse

Version N+2

Lecture Ecr

iture

Page 54: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Exemple : Modification du champs adresse

Version N+2

Lecture Ecr

iture

Page 55: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question #5 : Est-ce qu’on active ?

Page 56: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Canary Release

Page 57: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question #6 : Et si ça explose ?

Page 58: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Rappel : réduire la taille des déploiements réduit les risques

Page 59: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Mesurer et superviser

Page 60: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Arrêt d’urgence

Page 61: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Toute anomalie en production provoque !  une alerte visible par tous !  L’arrêt d’urgence, on ne peut plus commiter

« L’objectif est d’aller aussi vite que possible pour produire du code de qualité, pas plus

vite »

Page 62: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

N’accepter l’erreur qu’une seule fois

1 erreur => 1 action

Page 63: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Question #7 : Rollback ?

Page 64: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

“we don’t roll back, we fix the code”

John Allspaw - Etsy

Page 65: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Take away : pourquoi déployer en continu

Gagner en temps Gagner en qualité Plus de feedbacks

Page 66: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Take away : comment déployer en continu

!   Automatisez vos déploiements

!   Dissociez la livraison de code et l’activation de fonctionnalité avec du feature flipping

!   Sécurisez les déploiements avec les tests et les patterns de déploiements (blue-green, canary release)

!   Profitez des erreurs pour améliorer votre processus

Page 67: Deployer en continu, Benoît Lafontaine, USIEVENT 2013

Merci

Benoît Lafontaine

[email protected] @joel1di1

https://github.com/joel1di1