41
©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved ©2015, Amazon Web Services, Inc. or its affiliates. All rights reserved AWS CodeDeploy: Manage Deployment Complexity Dean Bryen AWS Solutions Architect @deanbryen

AWS CodeDeploy

Embed Size (px)

Citation preview

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

AWS  CodeDeploy:  Manage  Deployment  Complexity

Dean  BryenAWS  Solutions  Architect

@deanbryen

Prelude

The  Amazon  DevOps Story

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

• Service-­Oriented  Architecture  (SOA)

• Everything  gets  a  service  interface

• Primitives

• “Microservices”

• Decentralized  

• Two-­Pizza  Teams

• Agility,  Autonomy,  Accountability,  and  Ownership

• “DevOps”

• Decentralized  ownership  (self  service)  

• Promote  best  practices  without  being  restrictive

• Technology  agnostic

• Support  agile  practices

• Deployment  Service

• Rolling  Deployments

• Health  Checking

• Versioned  Artifacts  &  Rollbacks

• Continuous  Delivery

• From  check-­in  to  production

• CI/CD  +  Release  Automation

• >90%  of  teams

PipelinesPipelines

=  50  million  deployments a  year

Thousands  of  teams  +Microservices  architectures  +Multiple  environments  +Continuous  delivery?

AWS  CodeDeploy

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

Why  use  a  deployment  service?

Automatedeployments

Managecomplexity

Avoiddowntime

AWS  CodeDeploy

• Scale  from  1  instance  to  thousands• Deploy  without  downtime• Centralize  deployment  control  and  monitoring• On-­Premises  support

Staging

CodeDeployv1,  v2,  v3

Production

Dev

Coordinate  automated  deployments,  just  like  Amazon

ApplicationRevisions

Deployment  Groups

1)  Package  your  application  (with  an  AppSpec)

version: 0.0os: linuxfiles:- source: chef/

destination: /etc/chef/codedeploy- source: target/hello.war

destination: /var/lib/tomcat6/webappshooks:ApplicationStop:

- location: deploy_hooks/stop-tomcat.shBeforeInstall:

- location: deploy_hooks/install-chef.shAfterInstall:

- location: deploy_hooks/knife-install.shApplicationStart:

- location: deploy_hooks/chef-solo.shValidateService:

- location: deploy_hooks/verify_service.sh

1)  Package  your  application  (with  an  AppSpec)

version: 0.0os: linuxfiles:- source: chef/

destination: /etc/chef/codedeploy- source: target/hello.war

destination: /var/lib/tomcat6/webappshooks:ApplicationStop:

- location: deploy_hooks/stop-tomcat.shBeforeInstall:

- location: deploy_hooks/install-chef.shAfterInstall:

- location: deploy_hooks/knife-install.shApplicationStart:

- location: deploy_hooks/chef-solo.shValidateService:

- location: deploy_hooks/verify_service.sh

1)  Package  your  application  (with  an  AppSpec)

Start

BeforeInstall

ApplicationStart

ApplicationStop

Install

ValidateService

DownloadBundle

AfterInstall

End

1)  Package  your  application  (with  an  AppSpec)

version: 0.0os: linuxfiles:- source: chef/

destination: /etc/chef/codedeploy- source: target/hello.war

destination: /var/lib/tomcat6/webappshooks:ApplicationStop:

- location: deploy_hooks/stop-tomcat.shBeforeInstall:

- location: deploy_hooks/install-chef.shAfterInstall:

- location: deploy_hooks/knife-install.shApplicationStart:

- location: deploy_hooks/chef-solo.shValidateService:

- location: deploy_hooks/verify_service.sh

2)  Set  up  your  target  environments

Agent Agent Agent

Staging

Agent Agent

Agent Agent

Agent

Agent

Production

Deployment  GroupDeployment  Group

Group  instances  by:• Auto  Scaling  group• EC2  tag• On-­premises  tag

3)  Deploy!aws deploy create-deployment \

--application-name MyApp \

--deployment-group-name TargetGroup \

--s3-location bucket=MyBucket,key=MyApp.zip

AWS  CLI  &  SDKsAWS  ConsoleCI  /  CD  PartnersGitHub

Deployment  Config – Choose  speed

v2 v1 v1 v1 v1 v1 v1 v1

v2 v2 v2 v2 v1 v1 v1 v1

v2 v2 v2 v2 v2 v2 v2 v2

One-­at-­a-­Time

Half-­at-­a-­Time

All-­at-­Once

Rolling  Update  – Deploy  without  downtime

v1v1 v1

Load  Balancer

Rolling  Update  – Deploy  without  downtime

v1v2 v1

Load  Balancer

Rolling  Update  – Deploy  without  downtime

v2v2 v1

Load  Balancer

Rolling  Update  – Deploy  without  downtime

v2v2 v2

Load  Balancer

Rolling  Update  – Deploy  without  downtime

v2v2 v2

Load  Balancer

Health  Tracking  – Catch  deployment  problems

v3 v2 v2Stop

Load  Balancer

Health  Tracking  – Catch  deployment  problems

v2v2 v2

Load  Balancer

Rollback

Health  Tracking  – Catch  deployment  problems

v2v2 v2

Load  Balancer

Demo

Product  Integrations

AWS  CodePipeline

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

Why  use  a  release  automation  service?

Automateworkflow

Releasequickly

Ensurequality

From  this… …to  this

AWS  CodePipeline

• Inspired  by  Pipelines• Flexible  workflow  engine• Extensible,  plugin  based  architecture

Continuous  delivery  and  release  automation,  just  like  Amazon

Build1)  Build2)  Unit  test

1) Deploy2)  UI  test

Source Beta Production1)  Deploy2)  Load  test

Gamma1)  Deploy  region12)  Deploy  region23)  Deploy  region3

AWS  CodeCommit

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

What's  required  for  source  control  in  the  cloud?

FullyManaged

High  Availability

Security

AWS  CodeCommit

• Data  redundancy  across  AZs• Data  at  rest  encryption• Integrated  with  AWS  Identity  and  Access  Management• No  repo  size  limit

git push CodeCommit

Git objectsin  S3

Git indexin  DynamoDB

Encryption  keyin  KMS

SSH  or  HTTPS

Secure,  scalable,  and  managed  Git source  control

Summary

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

AWS  Code  services

CodeCommitcoming  soon

CodePipelinecoming  soon

CodeDeploylaunched  Nov  2014

Thank  You