devops in the public sector: how the democratic party implemented devops to migrate democrats.org to...

61
AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015 AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015 DevOps in the Public Sector How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS Leo Zhadanovsky Nick Gaw Sunil Chopra Alberto Manrique ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Upload: amazon-web-services

Post on 13-Aug-2015

373 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

DevOps in the Public SectorHow the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

Leo ZhadanovskyNick Gaw

Sunil ChopraAlberto Manrique

©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Page 2: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

DevOps

Page 3: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

What is DevOps?• « DevOps is the practice of operations and

development engineers participating together in the entire service lifecycle, from design through the development process to production support. »

- theagileadmin.com

Page 4: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Continuous Integration

Page 5: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

What is continuous integration?• Changes to code automatically deployed to mainline

branch– After passing unit and mock tests

• Makes deployments and changes to code iterative, not monolithic

• Bugs are detected quickly• Helps automate deployments• Allows rapid development and deployment

Page 6: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

SOURCE CODEREPOSITORY

PROJECT MANAGEMENT SERVER

CONTINUOUS INTEGRATION SERVER

DEVELOPER

PICKTASKS

SUBMITCODE

SCHEDULEBUILD

RECURRENTBUILDS

CODEFETCHCODE QUALITY

TESTS

TEST RESULTS

BUILD OUTPUT

DOCS

BINARIES& PACKAGES

DEV FACING NOTIFICATIONS

AWS CLOUDFORMATION

AMIS or CONTAINERS

Imm

utable In

frastru

cture

Page 7: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS
Page 8: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

SOURCE CODE REPOSITORY

DNS

CONTINUOUS INTEGRATION SERVER

PROJECT MANAGEMENT SERVER

BUILDS

Page 9: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

AWS code services

AWS CodeCommitComing soon

AWS CodePipelineComing soon

AWS CodeDeployLaunched Nov. 2014

Page 10: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Cloud software development lifecycle

10/13/14

MonitorProvisionDeployTestBuildCode

AWS Elastic Beanstalk

AWS OpsWorks

Amazon CloudWatch

AWS CloudFormation

?

Page 11: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Source controlPrivate Git repositories hosted on Amazon S3

• Full Git compatibility (use with existing tools)• All the benefits of the cloud

(scalable, durable, reliable, low pay-as-you-go pricing)

• No size limits on repositories (store binary files)• Online code tools with browse, edit, diff

10/13/14

Page 12: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

Same Git experience$ git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/aws-cliCloning into 'aws-cli'...Receiving objects: 100% (16032/16032), 5.55 MiB | 1.25 MiB/s, done.Resolving deltas: 100% (9900/9900), done.Checking connectivity... done.$ nano README.rst $ git commit -am 'updated README'[master 4fa0318] updated README 1 file changed, 1 insertion(+)$ git pushCounting objects: 3, done.Delta compression using up to 4 threads.Compressing objects: 100% (3/3), done.Writing objects: 100% (3/3), 297 bytes | 0 bytes/s, done.Total 3 (delta 2), reused 0 (delta 0)remote: To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/aws-cli 4dacd6d..4fa0318 master -> master

Page 13: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Continuous deliveryCustomizable release automation, with integrated build and test

• Model and visualize custom release workflow(source build beta gamma prod)

• Automate builds, tests, and deployments• Enforce custom rules, approvals, and gates• Integrate with third-party and custom tools

10/13/14

Page 14: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS
Page 15: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

DeploymentCoordinate software updates to fleets of EC2 instances

• Rolling updates for no downtime• Deployment health checks and easy rollback• Auto Scaling integration• Works with any application• Reuse existing setup tools

(Bash, Windows PowerShell, Chef, Puppet…)

10/13/14

Page 16: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

9/25/14 Slides not intended for redistribution.

16

Page 17: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Cloud software development lifecycle

10/13/14

MonitorProvisionDeployTestBuildCode

Elastic Beanstalk

OpsWorks

CloudWatchCloudFormationCodeDeploy

CodeCommit CodePipeline

Page 18: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

CODECOMMIT

DNS

CODEPIPELINE

PROJECT MANAGEMENT SERVER

BUILDS

Page 19: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Pain points• Unit tests incomplete• Mock tests maintenance• Expensive test environment• Test environment ≠ production• Deployment cycles

Page 20: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

On-demand

Pay as you go

Elastic

Page 21: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

=Programmable platform

Page 22: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS
Page 23: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS
Page 24: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

If you can program ityou can automate it

Page 25: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

A lot of options…• Configuration management systems

– Puppet– Chef– Saltstack

• Deployment frameworks– CodeDeploy– Elastic Beanstalk– OpsWorks– Ansible– Fabric– Capistrano

• Infrastructure management– CloudFormation

• Containers– Amazon EC2 Container Service

Page 26: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Bake an image Configure dynamically

Time-consuming configuration (startup time)

Static configurations (less change management)

Bootstrapping

Page 27: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Bake an image Configure dynamically

Continuous deployment (latest code)

Environment specific (dev-test-prod)

Bootstrapping

Page 28: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Stack-based deployment serviceAWS CloudFormation

Page 29: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

CloudFormationtemplate

Page 30: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

Headers

Parameters

Mappings

Resources

Outputs

Page 31: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

{ "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 32: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

"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 33: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

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

Page 34: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

CLOUDFORMATIONTEMPLATE

Proceduraldefinition

Create it programmatically

Known configurationStore stack configuration in source control

Parameter drivenDynamic and user-driven

templates

CollaborationShare templates with ease as just files

Page 35: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS
Page 36: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Application versions

+Infrastructure versions

Page 37: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

CLOUDFORMATION TEMPLATE

Page 38: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Continuous deploymentSmall, frequent changes constantly

integrating into production

Page 39: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Key = iteration

Page 40: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Iteration=

Modify the system to better meet the expectations of your users

Page 41: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

11.6 sec.Mean time between

deployments (weekday)

1,079Maximum number of

deployments in a single hour

10,000Mean number of

hosts simultaneously receiving a

deployment

30,000Maximum number of hosts simultaneously

receiving a deployment

Deployments at Amazon.com

(in 2011)

Page 42: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Software deploy

≠Product launch

Page 43: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Data-drivenarchitectures

Page 44: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

Metrics @ Etsy

Page 45: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

Metrics @ Obama for America

Page 46: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Metrics and monitoring options

CloudWatch

… and many more

Page 47: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Continuous integration

Continuous deployment

Page 48: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Continuous deployment

=

Continuous experimentation

Page 49: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Continuous deployment

=

Continuous improvement

Page 50: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

INNOVATE

Page 51: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Speed and agility

Experiment often

Fail quickly at a low cost

More innovation

Experiment infrequently

Failure is expensive

Less innovation

On-premises

Page 52: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Democrats.org in AWS

Nick Gaw

Alberto Manrique

Sunil Chopra

Page 53: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 54: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 55: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 56: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 57: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 58: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 59: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 60: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Page 61: DevOps in the Public Sector: How the Democratic Party Implemented DevOps to Migrate democrats.org to AWS

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015

Thank You.This presentation will be loaded to SlideShare the week following the Symposium.

http://www.slideshare.net/AmazonWebServices

AWS Government, Education, and Nonprofit Symposium Washington, DC I June 25-26, 2015