Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Managing Your Application Lifecycle on AWS: Continuous Integration and Deployment

3,108 views

Published on

AWS offers a number of services that help you easily develop, build, deploy and run applications in the cloud. In this session you’ll learn best practices for managing your application lifecycle with these tools with a particular focus on development speed and release agility. Through interactive demonstrations, this session shows you how to get an application running using AWS Elastic Beanstalk, CloudFormation and CodeDeploy. You will also see how advanced techniques such as blue/green deployment, AMI baking, customer resources and in-place deployment reduce deployment friction and rapid change in your environment.

Speaker: Adrian White, Solutions Architect, Amazon Web Services

Published in: Technology
  • Be the first to comment

Managing Your Application Lifecycle on AWS: Continuous Integration and Deployment

  1. 1. Managing Your Application Lifecycle on AWS Continuous Integration and Deployment Adrian White, Solutions Architect Amazon Web Services
  2. 2. Business 101 Technical 201 Technical 301 Technical 401 Technical Session Grading
  3. 3. What are we covering today? • Consistency through the development, test and release lifecycle • Improve quality over time • Increase velocity of application change • AWS deployment and management approaches • What does deployment look like in the future?
  4. 4. Task tracker Continuous integration / Automated testing / Release management Artifact repository Source code management Deployment service AWS OpsWorks AWS Elastic Beanstalk AWS CloudFormation AWS CodeDeploy Local development Application lifecycle management workflow
  5. 5. AWS Code and Deployment Tools MonitorProvisionDeployTestBuildCode Elastic Beanstalk OpsWorks Cloud Watch Cloud Formation Code Deploy Code Commit Code Pipeline
  6. 6. Local development challenges • Source code management design • “But it works on my machine” • Portable development environments • Distributed teams work on tasks in parallel
  7. 7. Source code management features • Fast and easy branching • Pull requests for distributed development workflows • Code review • Audit, logging, security
  8. 8. Feature branching, Gitflow and Pull requests Inspired by https://www.atlassian.com/git/tutorials/comparing-workflows/feature-branch-workflow/ Master Develop Release Feature Hotfix
  9. 9. Container image factories
 (for consistency) …
  10. 10. CodeCommit • Private Git on AWS • Massive scaled version controlled projects • High service availability and resiliency • Encrypted at rest • Pay as you go pricing • Import from SVN, Git, Microsoft TFS • Use IAM to control access to repositories
  11. 11. CodeCommit workflow git clone create repository Create repository Receive clone request Sync local / remote repos modify local files git add / commit / push Receive push request Update remote repo git pull Receive push request Update remote repo List repos, list branches Display response Receive requests Send responses
  12. 12. Why use a release automation service? Automate workflow Release quickly Ensure quality
  13. 13. CodePipeline • Customizable workflow engine • Integrate with partner and custom systems • Visual editor and status Continuous delivery and release automation, just like Amazon Build 1) Build 2) Unit test 1) Deploy 2) UI test Source Beta Production 1) Deploy 2) Load test Gamma 1) Deploy region1 2) Deploy region2 3) Deploy region3
  14. 14. How do you ship application changes? • Deployment approaches – In place vs discrete stacks • Where is state in the system? – Stateless vs stateful application components • Frequency and speed of change
  15. 15. Why use a deployment service? Automate deployments Manage complexity Avoid downtime
  16. 16. Shipping artifacts to existing environments
  17. 17. Shipping artifacts to existing environments
  18. 18. Shipping artifacts to existing environments
  19. 19. Shipping artifacts to existing environments
  20. 20. Shipping artifacts to existing environments
  21. 21. Shipping artifacts to existing environments
  22. 22. AWS CodeDeploy helps with this! Now available in Sydney (ap-southeast-2)
  23. 23. CodeDeploy • Scale from 1 instance to thousands • Deploy without downtime • Centralize deployment control and monitoring Staging CodeDeployv1, v2, v3 Production Dev Coordinate automated deployments, just like Amazon Application revisions Deployment groups
  24. 24. Step 1: Package your application (with an AppSpec file) version: 0.0 os: linux files: - source: chef/ destination: /etc/chef/codedeploy - source: target/hello.war destination: /var/lib/tomcat6/webapps hooks: ApplicationStop: - location: deploy_hooks/stop-tomcat.sh BeforeInstall: - location: deploy_hooks/install-chef.sh AfterInstall: - location: deploy_hooks/librarian-install.sh ApplicationStart: - location: deploy_hooks/chef-solo.sh ValidateService: - location: deploy_hooks/verify_service.sh
  25. 25. Step 1: Package your application (with an AppSpec file) version: 0.0 os: linux files: - source: chef/ destination: /etc/chef/codedeploy - source: target/hello.war destination: /var/lib/tomcat6/webapps hooks: ApplicationStop: - location: deploy_hooks/stop-tomcat.sh BeforeInstall: - location: deploy_hooks/install-chef.sh AfterInstall: - location: deploy_hooks/librarian-install.sh ApplicationStart: - location: deploy_hooks/chef-solo.sh ValidateService: - location: deploy_hooks/verify_service.sh
  26. 26. Step 1: Package your application (with an AppSpec file) version: 0.0 os: linux files: - source: chef/ destination: /etc/chef/codedeploy - source: target/hello.war destination: /var/lib/tomcat6/webapps hooks: ApplicationStop: - location: deploy_hooks/stop-tomcat.sh BeforeInstall: - location: deploy_hooks/install-chef.sh AfterInstall: - location: deploy_hooks/librarian-install.sh ApplicationStart: - location: deploy_hooks/chef-solo.sh ValidateService: - location: deploy_hooks/verify_service.sh
  27. 27. Step 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 • Amazon EC2 tag • On-premises tag
  28. 28. Step 3: Deploy! aws deploy create-deployment --application-name MyApp --deployment-group-name TargetGroup --s3-location bucket=MyBucket,key=MyApp.zip AWS CLI & SDKs AWS Console CI / CD Partners GitHub
  29. 29. 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
  30. 30. Rolling update – Deploy without downtime v1v1 v1 Load Balancer
  31. 31. Rolling update – Deploy without downtime v1v2 v1 Load Balancer
  32. 32. Rolling update – Deploy without downtime v2v2 v1 Load Balancer
  33. 33. Rolling update – Deploy without downtime v2v2v2 Load Balancer
  34. 34. Rolling update – Deploy without downtime v2v2 v2 Load Balancer
  35. 35. Health Tracking – Catch deployment problems v2v2 v2 Load Balancer
  36. 36. Health tracking – Catch deployment problems v3 v2 v2Stop Load Balancer
  37. 37. Health tracking – Catch deployment problems v2v2 v2 Load Balancer Rollback
  38. 38. Product integrations
  39. 39. Demo: CodeDeploy & Atlassian Bamboo
  40. 40. Shipping artifacts to new environments • What if we can quickly and easily build new environments every time? • CloudFormation – Deploying AMIs – Deploying containers – ECS • CodeDeploy to manage discrete application versions
  41. 41. Shipping artifacts – Discrete environments AWS CloudFormation Discrete stacks Amazon Route53 CI / Release management
  42. 42. Shipping artifacts – Immutability via containers ECS cluster Amazon EC2 Container Service Immutable infrastructure with Docker and Amazon EC2 Container Service (ECS)
  43. 43. Shipping artifacts – Immutability via containers ECS now supports ELB, health checks, scale-up and scale-down and update management ECS Task Definition ECS cluster with tasks
  44. 44. ECS Task Definitions { "containerDefinitions": [ { "name": "wordpress", "links": [ "mysql" ], "image": "wordpress", "essential": true, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ], "memory": 500, "cpu": 10 }, { "environment": [ { "name": "MYSQL_ROOT_PASSWORD", "value": "password" } ], "name": "mysql", "image": "mysql", "cpu": 10, "memory": 500, "essential": true } ], "family": "hello_world" }
  45. 45. Demo: Docker with AWS ECS &
 Atlassian Bamboo
  46. 46. Futures: what are you really deploying? • Application bundles? • AMIs? • Docker containers? • Lambda functions? • Microservices architectures
  47. 47. Featherweight compute abstractions • Lambda and compute-less architectures – Short lived microservices – Event driven compute / architectures • ECS tasks – Short lived + Long lived microservices • Elastic Beanstalk containers – Long lived microservices
  48. 48. • Service-Oriented Architecture (SOA)
 • Everything gets a service interface
 • Primitives
 • “Microservices”
  49. 49. Thousands of teams +
 
 Microservices architecture + Multiple environments + Continuous delivery
 
 

  50. 50. = 50 million deployments a year Thousands of teams +
 
 Microservices architecture + Multiple environments + Continuous delivery
 
 

  51. 51. Continuous Delivery @ Outsmart Games Taking it to the next level with Blood Gate Nathan Smith, Technical Director
  52. 52. Outsmart Games
  53. 53. How do we enable rapid delivery of updates to Blood Gate?
  54. 54. Building Mobile App Local Dev
  55. 55. Delivering Mobile App QA ☑ 1 week+ 1 hour AppStore
  56. 56. Content Manager
  57. 57. Content Manager Publishing S3 & CloudFront < 1 min Designers /Artists /Publishers QA
  58. 58. Content Manager CI/CD Elastic Beanstalk Dev (Build System)
  59. 59. Backend Services • Multiplayer • Anti-cheat • Multiple Devices • Social
  60. 60. Microservices Architecture Deployment
  61. 61. Service A Edge Middle Tier Service B Worker Admin Deployment
  62. 62. Dynamic Configuration Archaius DynamoDB ?
  63. 63. Service Discovery Route 53 ELB
  64. 64. Failure Isolation & Monitoring
  65. 65. Alerting on Failure Cloud Watch
  66. 66. Understanding Failure
  67. 67. Why Docker?
  68. 68. Delivering Microservices Dev Docker Hub (Build System)
  69. 69. Delivering Microservices Elastic Beanstalk Dev Docker Hub Ops Success? / Rollback?Cloud Watch (Build System)
  70. 70. Blue/Green or Rolling?
  71. 71. Future • Further automation • Lambda • Instances with multiple containers
  72. 72. Summary 1. Cloud Build 2. Content Manager 3. Microservices Backend
  73. 73. Outcomes • Milestone every 2 weeks • Tooling for Designers/Artists/Publishers • Game goes live soon!
  74. 74. Thank you! Nathan Smith, Technical Director nathan.smith@outsmartgames.com
  75. 75. Where to go next… • AWS Training & Certification – http://aws.amazon.com/training/ • Deployment and Management at AWS – http://aws.amazon.com/application-management/ • Code Management and Deployment – https://aws.amazon.com/blogs/aws/code-management-and- deployment/ • Amazon EC2 Container Service – http://aws.amazon.com/ecs/

×