devops and continuous deployment @ wwps government, education, and non-profit symposium 2014

121
AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014 AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014 DevOps on AWS Continuous Integration and Deployment Best Practices on AWS Leo Zhadanovsky, Senior Solutions Architect, AWS | @leozh JP Schneider, DevOps / Internet Jedi, Mozilla Foundation | @jdotp

Upload: john-schneider

Post on 29-Nov-2014

508 views

Category:

Internet


0 download

DESCRIPTION

Leo Zhadanovsky and I talked to a group of Government, Non-profit, and Education representatives about DevOps and how they could use it to speed up their organization.

TRANSCRIPT

Page 1: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014

AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014

DevOps on AWSContinuous Integration and Deployment Best Practices on AWS

Leo Zhadanovsky, Senior Solutions Architect, AWS | @leozh JP Schneider, DevOps / Internet Jedi, Mozilla Foundation |

@jdotp

Page 2: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Who Am I?

I work for AWS

I worked for the DNC 2009-2012

I was embedded in the DevOps Team @ OFA

AWS does not endorse

political candidates

Page 3: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Who Am I?

JP, DevOps for Mozilla Foundation

Previous gig DevOps at OFA 2012

Before that, Ops at Threadless

@jdotp

Mozilla Foundation does endorse animated cats

Page 4: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CONTINUOUS INTEGRATION

Page 5: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

What is Continuous Integration?

Changes to code automatically deployed to mainline branch• After passing unit and mock tests

Makes changes to code, and deployments iterative, not monolithic

Bugs are detected quickly

Allows rapid development

Helps automate deployments

Page 6: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

DEVELOPER

Page 7: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

Page 8: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

Page 9: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

Page 10: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

PICKTASKS

Page 11: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

SUBMITCODE

Page 12: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

SCHEDULEBUILD

Page 13: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

RECURRENTBUILDS

Page 14: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

CODEFETCH

Page 15: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

CODE QUALITYTESTS

TESTRESULTS

Page 16: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

BUILD OUTPUT

Page 17: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

DOCS

BINARIES& PACKAGES

DEV FACING NOTIFICATIONS

Page 18: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014
Page 19: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

SOURCE CODE REPOSITORY

DNS

CONTINUOUS INTEGRATION SERVER

PROJECT MANAGEMENT SERVER

BUILDS

Page 20: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

PAIN POINTS• UNIT TESTS INCOMPLETE• MOCK TESTS MAINTENANCE• EXPENSIVE TEST ENVIRONMENT• TEST ENVIRONMENT ≠ PRODUCTION• DEPLOYMENT CYCLES

Page 21: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

ON-DEMAND

PAY AS YOU GO

ELASTIC

Page 22: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

=

PROGRAMMABLE PLATFORM

Page 23: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 24: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 25: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 26: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

IF YOU CAN PROGRAM ITYOU CAN AUTOMATE IT

Page 27: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

A lot of options…

Configuration Management Systems• Puppet• Chef• Saltstack

Deployment Frameworks• Elastic Beanstalk• OpsWorks• Ansible• Fabric• Capistrano

Infrastructure Management• CloudFormation

Page 28: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Bake an AMI Configure dynamically

Time consuming configuration (startup time)

Static configurations (less change management)

Bootstrapping

Page 29: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Continuous deployment (latest code)

Environment specific (dev-test-prod)

Bootstrapping

Bake an AMI Configure dynamically

Page 30: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Obama for America

awsofa.info

CASE STUDY

Page 31: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

So here’s the Idea

~30th biggest E-commerce operation, globally

~200 distinct new applications, many mobile

Hundreds of new, untested analytical approaches

Processing hundreds of TB of data on thousands of servers

Spikes of hundreds of thousands of concurrent users

Page 32: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

a few constraints…

~30th biggest E-commerce operation, globally

~200 distinct applications, many mobile

Hundreds of new, untested analytical approaches

Processing hundreds of TB of data on thousands of servers

Spikes of hundreds of thousands of concurrent users

Critically compressed budget

Less than a year to execute

Volunteer and near-volunteer development team

Core systems will be used for a single critical day

Constitutionally-mandated completion date

Page 33: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Web-Scale Applications

Page 34: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

500k+ IOPS DB Systems

Page 35: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Services API

Page 36: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 37: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Business as usual..

…for a technology startup

Page 38: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Election Day – OFA Headquarters

Page 39: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Typical Charts

Page 40: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 41: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

How?

Page 42: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

The old approach, even from Amazon

Page 43: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

The old approach.. Might have some problems..

Page 44: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

OFA’s Infrastructure

awsofa.info

Page 45: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Ingredients

Ubuntu nginx boundary Unity jQuery SQLServer hbase NewRelic EC2 node.js Cybersource hive ElasticSearch Ruby Twilio EE S3 ELB boto Magento PHP EMR SES Route53 SimpleDB Campfire nagios Paypal CentOS CloudSearch levelDB mongoDB python securitygroups Usahidhi PostgresSQL Github apache bootstrap SNS OpsView Jekyll RoR EBS FPS VPC Mashery Vertica RDS Optimizely MySQL puppet tsunamiUDP R asgard cloudwatch ElastiCache cloudopt SQS cloudinit DirectConnect BSD rsync STS Objective-C DynamoDB

Page 46: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Infrastructure, Configuration Management & Monitoring

Ubuntu nginx boundary Unity jQuery SQLServer hbase NewRelic EC2 node.js Cybersource hive ElasticSearch Ruby Twilio EE S3 ELB boto Magento PHP EMR SES Route53 SimpleDB Campfire nagios Paypal CentOS CloudSearch levelDB mongoDB python securitygroups Usahidhi PostgresSQL Github apache bootstrap SNS OpsView Jekyll RoR EBS FPS VPC Mashery Vertica RDS Optimizely MySQL puppet tsunamiUDP R asgard cloudwatch ElastiCache cloudopt SQS cloudinit DirectConnect BSD rsync STS Objective-C DynamoDB

Page 47: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Configuration Management: Puppet

In mid-2011, we looked at options for configuration management and chose Puppet

We needed to make it scale, and to get it to work with state-less, horizontally scalable infrastructure

How did we do this?

Page 48: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Bootstrapping Puppet with CloudInit

CloudInit is built into Ubuntu and Amazon Linux• Allows you to

pass bootstrap parameters in Amazon EC2 user-data field, in YAML format

Page 49: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Bootstrapping Puppet with CloudInit

Don’t store creds in puppet manifests, store them in private Amazon S3 buckets

Either pass Amazon S3 creds through CloudInit:

Even better – avoid this by using AWS Identity and Access Management (IAM) roles and AWS Unified CLI’s S3 client

Page 50: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Bootstrapping Puppet with CloudInit

Built-in puppet support

Use certname with %i for instance id to name the node

Puppetmaster must have auto sign turned on• Use security groups and/or NACLs for network-level security

In nodes.pp, use regex to match node names

Page 51: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Puppet Tips

Use a base class to define your standard install

Page 52: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Use runstages

Don’t store credentials in puppet, store them in private Amazon S3 buckets• Use AWS IAM to secure the credentials bucket/folders within that bucket

Puppet Tips

Page 53: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Puppet Tips

Use puppet only for configuration files and what makes your apps unique

For undifferentiated parts of apps, use Amazon S3 backed RPM/Debian repositories• Can be either public or private repos, depending on your needs

• Amazon S3 Private RPM Repos: http://git.io/YAcsbg• Amazon S3 Private Debian Repos: http://git.io/ecCjWQ

Page 54: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Puppet Tips

By using packages for applications deploys, you can set ensure => latest, and just bump the package in the repo to update

Log everything with rsyslog/graylog/loggly/NewRelic/splunk

Page 55: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Scaling the Puppet Masters

Use an Auto Scaling group for puppet masters• Min size => 2, use multiple Availability Zones

Either have them build themselves off of existing puppet masters in the group or off packages stored in Amazon S3 and bootstrapped through user-data

Auto-sign must be on

Page 56: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

One thing that is difficult to prepare for…

Page 57: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

They had this built for the previous 3 months, all on the East Coast.

Page 58: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

They had this built for the previous 3 months, all on the East Coast.

We built this part in 9 hours to be safe.

AWS +Puppet +

Netflix Asgard + WAN Optimization Software +

DevOps =

Cross-Continent Fault-Tolerance On-Demand

Page 59: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

If OFA was run on AWS today, what might that look like?

Take advantage of OpsWorks• This would simplify configuration management

Use CloudFormation to recreate environments for prod/dev/test quicklyUtilize PostgreSQL RDS instead of the many manually installed PostgreSQL instancesAnalytics data warehouse took months to build, RedShift would take minutesDocker containers could be used to easily allow developers to replicate their dev environments in prod or stagingUse of immutable infrastructureMore use of CloudFront, resulting in less load on EC2 resources

Page 60: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Mozilla FoundationCASE STUDY

Page 61: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Webmaker.org circa 2012• Included Apps, non-SOA: Thimble, Popcorn, Goggles• ~20 pushes of new software in 2012• Operations and Development interacted mostly through bugzilla

tickets for deploys.• Hosting in physical datacenter at Mozilla

Webmaker.org circa early 2013• Deciding to go 12-factor, SOA in app layer• Weekly pushes of Popcorn on train model• Operations and Development interacted mostly through bugzilla

tickets for deploys.

Page 62: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

April 2013

Webmaker begins rebuilding entire platformSOA, 12-factor in node.js exclusivelyMoving apps into AWS and DevOps / CI

Page 63: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Since April 2013….Openbadges, Webmaker combine for: 1339 Pushes

Pushes Per Day to Staging / Prod

Pushes Per Day (Staging and Prod)

Page 64: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Who?• ~30 Paid Developers • Hundreds of Students • Thousands of Contributors• One DevOps / Internet Jedi• Multiple Teams

How?• Puppet, Jenkins, Fabric• Tight feedback loops:

Newrelic, Opsview• Culture Shift

• Staging Envs• Brave devs iterate,

keeping work in-context• Visible Ops• Cross-train developers in

operations

Page 65: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

What changed?

Page 66: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

1) Know How You Were Doing Before

2) Know What Changed When

3) Know How You Are Now Doing

=

The confidence to try more things and try them faster, with minimum viable planning.

Page 67: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Deployment

Pipeline

Page 68: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

AWS CLOUDFORMATION

STACK-BASED DEPLOYMENT SERVICE

Page 69: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

CLOUDFORMATIONTEMPLATE

Page 70: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 71: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

{ "Description" : "Create RDS with username and password", "Resources" : {

"MyDB" : { "Type" : "AWS::RDS::DBInstance", "Properties" : { "AllocatedStorage" : "500", "DBInstanceClass" : "db.m1.small", "Engine" : "MySQL", "EngineVersion" : "5.5", "MasterUsername" : "MyName", "MasterUserPassword" : "MyPassword" } } }}

Page 72: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

"AWS::CloudFormation::Init" : { "config" : {

"packages" : { "yum" : { "mysql" : [], "mysql-server" : [], "httpd" : [], "php" : [], "php-mysql" : [] } }, "sources" : { "/var/www/html" : "https://s3.amazonaws.com/my-builds/build-v4.zip" } }

Page 73: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

{ "Parameters" : { "KeyName" : { "Description" : "Name of an existing EC2 KeyPair to enable SSH access to the instance", "Type" : "String" } },}

Page 74: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CLOUDFORMATIONTEMPLATE

PROCEDURALDEFINITION

Create it programmatically

KNOWN CONFIGURATIONStore stack configuration in source control

PARAMETER DRIVEN

Dynamic and user-driven templates

COLLABORATIONShare templates with ease as just files

Page 75: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 76: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

APPLICATIONVERSIONS

+INFRASTRUCTURE

VERSIONS

Page 77: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

CLOUDFORMATION TEMPLATE

Page 78: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CASE STUDY

NASA/Jet Propulsion LaboratoryCalifornia Institute of Technology

Page 79: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Mars Rover Landing by the #’s

NASA TV = HD stream, 1080p, ~1 mb/s per viewer

Expecting peak of ~1m viewers

All playback devices (iOS, Android, Flash, HTML5, blah)

Once in a lifetime moment in history (no crashy crashy)

FUN FUN FUN

Page 80: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Mars Rover Landing by the #’s

NASA TV = HD stream, 1080p, ~1 mb/s per viewerExpecting peak of ~1m viewersAll playback devices (iOS, Android, Flash, HTML5, blah)Once in a lifetime moment in history (no crashy crashy)

NASA says we can’t use their live stream setupIt’s 6 days before the landingIt’s the same week as the OlympicsAvailable technical resources from JPL: Brett and Khawaja

Page 81: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

The sticky wicket:

HD Video streamsize = 4mbnever changeseasy to cache

manifest.f4msize = 4kbNew every 4 seccaching difficult

Page 82: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

The plan

Design a solution around our limits• Max connections to origin = 6• Max streams per cache node = 20• Local Latency = critical• US-WEST-1 capacity reserved for S3 static images

Test the snot out of it

Hang on!

Page 83: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

TWO GUYS

Page 84: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

ok, so one of them is a rocket scientist..

Page 85: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Mars Science Laboratory - Live Video Streaming Architecture

“The 42 pack”

Page 86: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

LOAD TESTING

Page 87: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014
Page 88: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014
Page 89: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Battle Testing our DeploymentBenchmarking

Page 90: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Dynamic Traffic ScalingUS-East Cache Node Performance25.3 Gbps

Page 91: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Only ~42Mbps

Dynamic Traffic ScalingImpact on US-East FMS Origin Servers

Page 92: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 93: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CONTINUOUS DEPLOYMENT

SMALL, FREQUENT CHANGES CONSTANTLY INTEGRATING INTO

PRODUCTION.

Page 94: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

KEY = ITERATION

Page 95: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

ITERATION=

MODIFY THE SYSTEM TO BETTER MEET THE EXPECTATIONS OF

YOUR USERS

Page 96: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

11.6sMean time between

deployments (weekday)

1,079Max number of

deployments in a single hour

10,000Mean number of

hosts simultaneously

receiving a deployment

30,000Max number of

hosts simultaneously

receiving a deployment

DEPLOYMENTS AT AMAZON.COM

Page 97: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SOFTWARE DEPLOY

≠PRODUCT LAUNCH

Page 98: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 99: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

1.5 BILLION PAGE VIEWS

OCTOBER 2012

$83 MILLION IN TRANSACTIONS4.2 MILLION ITEMS SOLD

CASE STUDY

Page 100: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

30 DEPLOYS PER DAY1 DEPLOY EVERY 20 MINUTES

Page 101: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

"Production is truly the only place you

can validate your code."

Page 102: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 103: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 104: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 105: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

Page 106: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

AWS OPSWORKSINTEGRATED APPLICATION

MANAGEMENT

AWS OPSWORKS UNDER THE HOOD

Page 107: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

DATA-DRIVENARCHITECTURES

Page 108: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

METRICS @ETSY

Page 109: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014METRICS @OBAMA FOR AMERICA

Page 110: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

COST-ORIENTED ARCHITECTURES

Page 111: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

PHP+APACHE+VARNISH

NGINX+NODEJS

vs.

Page 112: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014
Page 113: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CONTINUOUS INTEGRATION

CONTINUOUS DEPLOYMENT

Page 114: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CONTINUOUS DEPLOYMENT

=

CONTINUOUS EXPERIMENTATION

Page 115: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

CONTINUOUS DEPLOYMENT

=

CONTINUOUS IMPROVEMENT

Page 116: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

INNOVATE

Page 117: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

« Want to increase innovation? Lower the cost of failure »

Joi Ito

Page 118: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits SymposiumWashington, DC | June 24, 2014 – June 26, 2014

SPEED AND AGILITY

Experiment Often

Fail quickly at a low cost

More Innovation

Experiment Infrequently

Failure is expensive

Less Innovation

“ON-PREMISE”

Page 119: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014

Q & A

Page 120: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014

aws.amazon.com/training

Expand your technical expertise to design, deploy, and operate

scalable, efficient applications on AWS

Training

aws.amazon.com/certification

Certification

20% off AWS Instructor-Led Training Class*• Code MK20PSSYM314 • Expires September 30, 2014

Get Savings on AWS Training!

* Discount only applies to classes delivered by AWS. Discount does not apply to classes delivered by an APN Training Partner.

aws.amazon.com/training/self-paced-labs

Self-Paced Labs

Get hands-on practice working with AWS technologies in a live environment

Validate your proven technical expertise

with the AWS platform

Expand your skills with AWS

Page 121: DevOps and Continuous Deployment @ WWPS Government, Education, and Non-profit Symposium 2014

AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014

AWS Government, Education, and Nonprofits Symposium Washington, DC | June 24, 2014 - June 26, 2014

DevOps on AWSContinuous Integration and Deployment Best Practices on AWS

Thank You

Leo Zhadanovsky, Senior Solutions Architect, AWS | @leozh JP Schneider, DevOps / Internet Jedi, Mozilla Foundation |

@jdotp