SlideShare a Scribd company logo
1 of 58
Cyansible
Blending Blue/Green Deployments
@Betterment
Techcrunch Disrupt
May 2010
90,000 customers,
more every minute.
Fastest growing automated
investing service
$2B+
Who are we?
betterment : investing
::
devops : engineering
it’s 2012.
let’s ship some code.
Betterment@2012
A Better Migration: From Snowflakes to Stormtroopers
Wednesday, July 22, 6:30p - 8:00p @ AWS Pop-up Loft |Shameless Plug:
it’s 2015.
let’s ship new code…
without interrupting
production
● Predictable
● Repeatable
● Minimal Human Interaction
● Zero User Interruption
● Contained Failure
Dream Delivery
Blue/Green Deployments
http://martinfowler.com/bliki/BlueGreenDeployment.html
DNSELB
Pre-flight Checklist
❏Stateless Servers
❏Server Health Check
❏Duplicate Full Stack
including RDS Replica
Wait. Two Databases?
“There's still the issue of dealing with missed transactions
while the green environment was live, but depending on
your design you may be able to...
● feed transactions to both environments in such a way
as to keep the blue environment as a backup when the
green is live. Or you may be able to...
● put the application in read-only mode before cut-over,
run it for a while in read-only mode, and then switch it to
read-write mode.”
http://martinfowler.com/bliki/BlueGreenDeployment.html
“Code𝓲 always works
on Schema𝓲+1”
(A.K.A. old code works on new schema)
Publish, Migrate, Deploy
Jenkins’ Job
1. Build
2. Test
3. Package
4. Publish
5. Run Migrations
6. Invoke Ansible
7. Cull Zombies
Ansible’s Job
1. Check for S3 deliverables
2. Spin up new EC2 Instance(s)
3. Apply role(s) to instance(s)
4. Find instance(s) in ELB
5. Add new instance(s) to ELB & tag
o status: in-use
6. Remove & tag instances
o status: zombie
Bootstrapping Ansible
./exec/ directory
contains Jenkins entry points
Ansible code lives
in the repo it provisions.
Publish it like an app.
./exec/brochure-deploy.sh
brochure-deploy.yml
you are
here.
00:00:10.888
provision-new-ec2-
instances
brochure-deploy >
identify-elb-
AZs
brochure-deploy > provision-new-ec2-instances >
ec2-
deploy
brochure-deploy > provision-new-ec2-instances >
AMI Hierarchy
brochure-deploy.yml
you are
here.
00:01:18.415
configure-instances
brochure-deploy >
roles/deploy/brochure/tasks/main.y
ml
brochure-deploy > configure-instances
brochure-deploy.yml
you are
here.
00:04:49.414
brochure-deploy.yml
you are
here.
00:04:50.188
find-instances-in-elb
brochure-deploy >
brochure-deploy.yml
you are
here.
00:04:50.911
add-instances-to-elb
brochure-deploy >
brochure-deploy.yml
you are
here.
00:05:06.295
decommission-instances
brochure-deploy >
brochure-deploy.yml
you are
here.
00:05:21.226
EC2
INSTANCE
● Predictable
● Repeatable
● Minimal Human Interaction
● Zero User Interruption
● Contained Failure
Dream Delivery Achieved
The Future
● Long Running Instances + Docker
o Huge speed improvement
● Post Monolith, Abandon Jenkins?
o Travis CI for Build/Test
o Tower for Deployment Orchestration
● Ansible Galaxy?
Questions?
alan@betterment.com
@nonrational
github.com/nonrational
careers@betterment.com
All code snippets & diagrams contained in this presentation are property of Betterment, but please learn from them.
All photographs / GIFs used in this presentation are someone else’s.
Street Fighter, Back To The Future, Indiana Jones, Futurama, and Arrested Development are someone else’s property
too.

More Related Content

What's hot

What's hot (20)

Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Continuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub ActionsContinuous Testing with Molecule, Ansible, and GitHub Actions
Continuous Testing with Molecule, Ansible, and GitHub Actions
 
Ansible Introduction
Ansible Introduction Ansible Introduction
Ansible Introduction
 
Using Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud EnvironmentsUsing Ansible for Deploying to Cloud Environments
Using Ansible for Deploying to Cloud Environments
 
Ansible
AnsibleAnsible
Ansible
 
Introduction to ansible galaxy
Introduction to ansible galaxyIntroduction to ansible galaxy
Introduction to ansible galaxy
 
Automating aws infrastructure and code deployments using Ansible @WebEngage
Automating aws infrastructure and code deployments using Ansible @WebEngageAutomating aws infrastructure and code deployments using Ansible @WebEngage
Automating aws infrastructure and code deployments using Ansible @WebEngage
 
Deploying PHP Applications with Ansible
Deploying PHP Applications with AnsibleDeploying PHP Applications with Ansible
Deploying PHP Applications with Ansible
 
Introducing Ansible
Introducing AnsibleIntroducing Ansible
Introducing Ansible
 
Ansible Oxford - Cows & Containers
Ansible Oxford - Cows & ContainersAnsible Oxford - Cows & Containers
Ansible Oxford - Cows & Containers
 
DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!DevOps for Humans - Ansible for Drupal Deployment Victory!
DevOps for Humans - Ansible for Drupal Deployment Victory!
 
Ansible - Hands on Training
Ansible - Hands on TrainingAnsible - Hands on Training
Ansible - Hands on Training
 
Monitor-Driven Development Using Ansible
Monitor-Driven Development Using AnsibleMonitor-Driven Development Using Ansible
Monitor-Driven Development Using Ansible
 
Infrastructure = Code
Infrastructure = CodeInfrastructure = Code
Infrastructure = Code
 
docker build with Ansible
docker build with Ansibledocker build with Ansible
docker build with Ansible
 
How Ansible Makes Automation Easy
How Ansible Makes Automation EasyHow Ansible Makes Automation Easy
How Ansible Makes Automation Easy
 
Getting Started with Ansible
Getting Started with AnsibleGetting Started with Ansible
Getting Started with Ansible
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
Ansible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers GaliciaAnsible introduction - XX Betabeers Galicia
Ansible introduction - XX Betabeers Galicia
 
Ansible Crash Course
Ansible Crash CourseAnsible Crash Course
Ansible Crash Course
 

Viewers also liked

Viewers also liked (8)

V2 and beyond
V2 and beyondV2 and beyond
V2 and beyond
 
Ansible roles done right
Ansible roles done rightAnsible roles done right
Ansible roles done right
 
Ansible, best practices
Ansible, best practicesAnsible, best practices
Ansible, best practices
 
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...AnsibleBuilding a Docker-ized Microservice  In Node, Using Ansible - AnsibleF...
AnsibleBuilding a Docker-ized Microservice In Node, Using Ansible - AnsibleF...
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 
Ansible - Introduction
Ansible - IntroductionAnsible - Introduction
Ansible - Introduction
 
Ansible tips & tricks
Ansible tips & tricksAnsible tips & tricks
Ansible tips & tricks
 
Ansible presentation
Ansible presentationAnsible presentation
Ansible presentation
 

Similar to Cyansible

Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2
Docker, Inc.
 

Similar to Cyansible (20)

Db2 cloud provisioning
Db2 cloud provisioningDb2 cloud provisioning
Db2 cloud provisioning
 
New AWS Services
New AWS ServicesNew AWS Services
New AWS Services
 
Production Grade Kubernetes Applications
Production Grade Kubernetes ApplicationsProduction Grade Kubernetes Applications
Production Grade Kubernetes Applications
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2Immutable infrastructure with Docker and EC2
Immutable infrastructure with Docker and EC2
 
Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2Immutable Infrastructure with Docker and EC2
Immutable Infrastructure with Docker and EC2
 
Serverless ETL and Optimization on ML pipeline
Serverless ETL and Optimization on ML pipelineServerless ETL and Optimization on ML pipeline
Serverless ETL and Optimization on ML pipeline
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
CI/CD with Kubernetes, Helm & Wercker (#madScalability)
CI/CD with Kubernetes, Helm & Wercker (#madScalability)CI/CD with Kubernetes, Helm & Wercker (#madScalability)
CI/CD with Kubernetes, Helm & Wercker (#madScalability)
 
Optimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot InstancesOptimize Content Processing in the Cloud with GPU and Spot Instances
Optimize Content Processing in the Cloud with GPU and Spot Instances
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
 
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
Salvatore Incandela, Fabio Marinelli - Using Spinnaker to Create a Developmen...
 
Kubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of ContainersKubernetes - Sailing a Sea of Containers
Kubernetes - Sailing a Sea of Containers
 
Embulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダEmbulk - 進化するバルクデータローダ
Embulk - 進化するバルクデータローダ
 
Spring, Functions, Serverless and You
Spring, Functions, Serverless and YouSpring, Functions, Serverless and You
Spring, Functions, Serverless and You
 
DevOps with Serverless
DevOps with ServerlessDevOps with Serverless
DevOps with Serverless
 
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵 [AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
 
2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure
2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure
2016 - Open Mic - IGNITE - Open Infrastructure = ANY Infrastructure
 
OpenStack Preso: DevOps on Hybrid Infrastructure
OpenStack Preso: DevOps on Hybrid InfrastructureOpenStack Preso: DevOps on Hybrid Infrastructure
OpenStack Preso: DevOps on Hybrid Infrastructure
 
Habitat hack slides - Infracoders Meetup Graz
Habitat hack slides - Infracoders Meetup GrazHabitat hack slides - Infracoders Meetup Graz
Habitat hack slides - Infracoders Meetup Graz
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Pharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodologyPharm-D Biostatistics and Research methodology
Pharm-D Biostatistics and Research methodology
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

Cyansible

Editor's Notes

  1. Background on who we are: Betterment is online investing service, helping people to better manage and grow their wealth through smarter technology disrupt the investing financial industry Largest and fastest growing automated investing service More than 90,000 customers and quickly growing
  2. Betterment is online investing service, helping people to better manage and grow their wealth through smarter technology Invest in a diversified portfolio Automate everything for you - from rebalancing and dividend reinvestment to automatic deposits Tax efficient
  3. very, very confusing at times and have the potential to waste a lot of your time before you figure out the right approach the dream of devops is to create an environment where the path of least resistance also yields the most efficient, sane result. betterment is totally onboard with that mission from the ground up.
  4. it’s gonna take all night it’s friday night. i have no date, a 2-liter bottle of shasta, and my all-rush mixtape. let’s rock.
  5. Deploy Once a Month At 2AM Unpredictable pre-prod Rented Iron By definition, long-running LoadBalancer with “status.txt” file Manual Package Installation “Python2.4 must be default”
  6. AWS VPC AZ Subnets EC2 ELB Multi-AZ RDS
  7. predictable deployments
  8. DNS Update Unpredictable TTLs Never for Consumer Traffic Okay for Internal Traffic Elastic Load Balancer Re-use “pre-warmed” long-running ELBs Multiple AZs Health Checks Connection Draining Sticky Sessions
  9. Goes without saying you need HTTPS long-running machine columns still are a pain to provision. give me machines on tap. Ansible means i can stand up stacks of Stateless Sessions / Servers Stateful Authentication Cookies HTTPS Everywhere Column Health Awareness Health Check Routes Two Full-stack “Columns” Rent 2x N-machine columns Elastic Cloud + Ansible 2x Web / App / Database Nodes
  10. New EC2 Cluster hits production DB Migration Constraints Old Code always works on New Schema Win: Simplicity Lose: “Instant” Standby Stack
  11. Don’t optimize for rollbacks Fast Rollforward Speedy Fix&Ship Fast Failure curl healthcheck route before publicizing fail tolerance percent: 0% Emergency Rollback Ship previous git-hash.
  12. ansible parallelization
  13. super ugly, but awesome. ensure that hash matches master scalability!
  14. Monolith ⇒ SOA 2 ⇒ ~10 applications One repo to rule them all Version Ansible w/ Apps .tgz,.war deliverables ./exec ./roles/{deploy,provision} ./playbooks/shared
  15. TODO:
  16. Y’all ready for this?
  17. CYAN!
  18. Sometimes, things do go wrong.
  19. database still at v1, old code continues to run….
  20. If the deployment fails halfway through, zombie killer will take care of the “ready” or “pending” instances that are not in ELBs. If the deployment succeeds, instances tagged “zombie” will also be reaped.
  21. predictable deployments