cloud powered
play

Cloud-Powered Continuous Integration and Deployment Jinesh Varia - PowerPoint PPT Presentation

Cloud-Powered Continuous Integration and Deployment Jinesh Varia jvaria@amazon.com @jinman About Me Jinesh Varia @jinman jvaria@amazon.com linkedin/in/jinman http://jinesh.varia.in Cloud Architectures Cloud Best Practices


  1. Push to an AMI or Pull from an Instance Apache Your Code Fetch on boot Your Code Fetch on boot Tomcat Apache Apache Struts Struts Struts Tomcat Log4J Log4J scripts Tomcat Fetch on boot Spring Hibernate Spring Amazon Amazon Struts Your Code Chef/puppet S3 S3 Your Code Apache Log4J A p a c c h h e e Log4J T o A m c c A p a a a a p c c t t a h h c c A e e T Tomcat H h h e e A p o i a a m m b p c c c c e e T a h h a a r r o c c e e T t t A n n m h h S c c e e o t p a a m m r r a a t t J a a c c u u c c E e e t t T a a t t h h E o Spring t t e T e A H m S s s Y c c Spring t o o p i r r u u m m a a b a a u u r r c c c c e e t t CHEF t t a a h h L r r JEE t t e e T i n n H s s Y L C C S n o o o o t o u u a a i u u g d d g r r m m t J t b r r e e 4 4 u u c c x x E e e e e J J t t a a Hibernate E r r t t n n Puppet Puppet C L C S s s Y S o o o p o t a a d g g d r r u u r r J t t 4 e 4 e i i r r u u E e e J J t t L E Linux JEE n n i S H g g L C C Y s s n p i o o o o u u r r b b d d g g u u i i e e e 4 e 4 r r x x J J L Hibernate n n r r i H g g J n n S L C C n i a E a p o o o u u b b E t E t r r g d d g e e e e i i e e 4 4 x x J J JEE Linux r r n n n J n L H g g S Hibernate E a a i i p E E t t n n b b r r e e u e e i i JEE u x x r r n n L n n J H g g i a E a i n n t E E t b b u e e e e u x x r r L n J n i a a E n n E t E t u e e JEE u x x L i n n Linux u u x x Linux JEE Amazon EC2 Amazon EC2 Linux Amazon EC2 JeOS AMI Java AMI Linux Java AMI Golden AMI and Golden AMI and JeOS AMI and library of JeOS AMI and library of Fetch binaries on boot Fetch binaries on boot recipes (install scripts) recipes (install scripts) Inventory of AMIs Inventory of AMIs Java App Stack Frozen Pizza Model Take N Bake Pizza Model Made to order Pizza Model

  2. Repo Instances Package Package Builder Builder Scripts Config Cloud-init CloudFormation Push Templates Code Config Tests Version Version CI CI Deploy Deploy Control Control Server Server Server Server Pull Commit to Git/master Code Dev Build Run Tests Base AMIs Send Build Report to Dev Stop everything if build failed Cloud Continuous Deployment (Simple)

  3. "UserData": { "Fn::Base64": { "Fn::Join": [ "", [ "#!/bin/bash -ex\n", "yum -y install git-core\n", "yum -y install php-pear\n", "pear install Crypt_HMAC2-1.0.0\n", "pear install HTTP_Request-1.4.4\n", "pear channel-discover pear.amazonwebservices.com\n", "pear install aws/sdk\n",

  4. "AppDatabase": {"Type": "AWS::CloudFormation::Stack", "Metadata": { … }, "Properties": { "TemplateURL": { "Fn::Join": [ "/", [ { … }, "RDS_MySQL_55.template" ] ] },

  5. Chef Server Reports (config, package dependencies) Puppet Master (Manifest, config and mappings) Managed Instances Chef S Chef S Puppet M Puppet M Scripts Config recipes New Code CloudFormation Push Templates Code Config Tests Version Version CI CI Deploy Deploy Control Control Server Server Server Server Pull Commit to Git/master Code Dev Build Run Tests Base AMIs Send Build Report to Dev Stop everything if build failed Cloud Continuous Deployment

  6. Automate deployment to multiple Availability Zones (Fault Tolerant Zones) Deploy Deploy Server Server Availability Zone 3 Availability Zone 1 Availability Zone 2 AWS Region

  7. Blue Green Deployments

  8. High Error Rate Monitoring Load Balancing (CloudWatch) (ELB) v1.1 v1.2 v1.2 v1.1 Web Server Fleet (Amazon EC2) v1.2 v1.2 v1.1 v1.1 Database Fleet (RDS or DB on EC2)

  9. Auto Scaling Auto Scaling Group (Min, Max # of instances, Availability Zones .. ) Health Check (Maintain Min # active…) Launch Configuration (AMIID, Instance type, UserData, Security Groups..) Scaling Trigger (Metric, Upper Threshold, Lower Threshold, Time interval …) Types of Scaling (Scale by Schedule, Scale by Policy) Alarm (Notification Email, SMS, SQS, HTTP) Availability Zones and Regions

  10. Load Balancing (ELB) Auto scaling Max instances Min instances v1.1 v1.2 v1.2 v1.1 Scaling Trigger Custom Metrics Upper Threshold “Auto scaling” Lower Threshold Web Server Fleet Increment by v1.2 v1.2 v1.1 v1.1 (Amazon EC2) Database Fleet (RDS or DB on EC2)

  11. Dark Launches with feature flags Deploy != Product Launch

  12. Feature = ON request Load Balancing (ELB) Happy New feature Path v1.1 Code Path v1.2 v1.2 v1.1 v1.1 v1.1 v1.1 Web Server Fleet (Amazon EC2) v1.2 v1.1 v1.1 v1.1 v1.1 Database Fleet (RDS or DB on EC2)

  13. Dialing up A B Control Treatment

  14. Load Balancing (ELB) 99% 1% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 Web Server Fleet v1.1 v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 ….. Database Fleet (RDS or DB on EC2)

  15. Load Balancing (ELB) 90% 10% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 Web Server Fleet v1.1 v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 ….. Database Fleet (RDS or DB on EC2)

  16. Load Balancing (ELB) 70% 30% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 Web Server Fleet v1.1 v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.2 v1.1 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  17. Load Balancing Rollback (ELB) 70% 30% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 High Error Rate v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 Web Server Fleet Monitoring v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 (CloudWatch) v1.1 v1.1 v1.2 v1.1 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  18. Load Balancing Rollback (ELB) 90% 10% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 Web Server Fleet v1.1 v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 Dev, Test v1.1 v1.1 v1.1 v1.2 v1.1 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  19. Load Balancing (ELB) 70% 30% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 Web Server Fleet v1.1 v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.2 v1.1 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  20. Load Balancing (ELB) 50% 50% A/B Testing Service v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 Web Server Fleet v1.1 v1.1 v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 v1.2 v1.2 v1.1 v1.1 v1.2 v1.1 v1.2 v1.2 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  21. Load Balancing (ELB) 30% 70% A/B Testing Service v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 v1.1 v1.1 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 Web Server Fleet v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 v1.2 v1.2 v1.1 v1.2 v1.1 v1.2 v1.2 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  22. Load Balancing (ELB) 5% 95% A/B Testing Service v1.1 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 v1.2 v1.1 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 v1.2 Web Server Fleet v1.1 v1.1 (Amazon EC2) v1.2 v1.2 v1.2 v1.2 v1.2 v1.2 v1.2 v1.1 v1.2 v1.2 v1.2 v1.2 v1.2 ….. Database Fleet (RDS or DB on EC2)

  23. Split Users by multiple experiments A C B D Control Treatment 1 Treatment 2 Treatment 3

  24. Load Balancing (ELB) 90% 3% 5% 2% v1.2.1 v1.2.2 v1.1 v1.2 v1.1 v1.1 v1.1 Web Server Fleet (Amazon EC2) v1.2.1 v1.2.2 v1.1 v1.1 v1.2 v1.1 v1.1 Database Fleet (RDS or DB on EC2)

  25. Blue Green Deployments : RDBMS? Mastering the Tradeoffs: 1. Hot deployment techniques 2. Simple Backup and Restore (RDS User-initiated Snapshots) 3. Break huge jobs into series of multiple backward-compatible tasks and decouple Application deployment and DB migration

  26. Example V2.1 Timeline ID NAME ADDRESS ORDERID (Char) 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425

  27. 6 Steps Example 1. Add a new column V2.1 DB V1.1 Timeline ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425

  28. 6 Steps Example 1. Add a new column 2. Change all software to write to both columns (old and new) V2.1 DB V1.1 Deployment Timeline ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425 3632342 Mark Fox cxxxx 567890 567890

  29. 6 Steps Example 1. Add a new column 2. Change all software to write to both columns (old and new) 3. Migrate the old column V2.1 data to new column (for older rows) DB DB V1.1 V1.2 Deployment Timeline ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 333424 45322 Rob Smith xxxx 234 234 2342342 Jane Smith xxxx 23424 23424 2342265 Anne Lee xxxx 2342425 2342425 3632342 Mark Fox cxxxx 567890 567890

  30. 6 Steps Example 1. Add a new column 2. Change all software to write to both columns (old and new) 3. Migrate the old column V2.1 V2.2 data to new column (for older rows) 4. Change all software to read from the new column DB DB V1.1 V1.2 Deployment Timeline ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 333424 45322 Rob Smith xxxx 234 234 2342342 Jane Smith xxxx 23424 23424 2342265 Anne Lee xxxx 2342425 2342425 3632342 Mark Fox cxxxx 567890 567890

  31. 6 Steps Example 1. Add a new column 2. Change all software to write to both columns (old and new) 3. Migrate the old column V2.1 V2.2 V2.3 data to new column (for older rows) 4. Change all software to read from the new column DB DB V1.1 V1.2 5. Change all the software to only write to the new column Deployment Timeline ID NAME ADDRESS ORDERID ORDERID_INT 23234 Joe Doe xxx 333424 333424 45322 Rob Smith xxxx 234 234 2342342 Jane Smith xxxx 23424 23424 2342265 Anne Lee xxxx 2342425 2342425 3632342 Mark Fox cxxxx 567890 567890 433453 Mark Lee cxxxxx 4352342422

  32. 6 Steps Example 1. Add a new column 2. Change all software to write to both columns (old and new) 3. Migrate the old column V2.1 V2.2 V2.3 data to new column (for older rows) 4. Change all software to read from the new column DB DB DB V1.1 V1.2 V1.2 5. Change all the software to only write to the new column 6. Drop the old column Deployment Timeline ID NAME ADDRESS ORDERID_INT 23234 Joe Doe xxx 333424 45322 Rob Smith xxxx 234 2342342 Jane Smith xxxx 23424 2342265 Anne Lee xxxx 2342425 3632342 Mark Fox cxxxx 567890 433453 Mark Lee cxxxxx 4352342422

  33. Increasing the speed of Iteration

  34. Break your problem into small batches Stream of small deployments Incremental changes Easy rollbacks

  35. Deploy new software quickly Revert a bad change quickly Cost of Mistakes

  36. Dynamism of the cloud makes its easy

  37. Give me Week1 data Application Layer Small Small Small Small Large CPU Large CPU Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week Week 1 2 1 3 2 1 1 3 2 4 5 1 4 3 2 2 5 3 1 4 6 Writes Reads

  38. Cloud-powered Continuous Delivery Continuous Continuous Continuous Optimization Integration Deployment

  39. Cloud-powered Continuous Optimization Goal: Optimize on multiple dimensions : Cost, Performance, HA, Security, Response Time Benefit on optimize for cost - Immediate recurring cost savings Metric: understanding utilization Continuous Optimization

  40. When you turn off your cloud resources, you actually stop paying for them

  41. Daily CPU Load 14 12 10 8 Load 25 % Savings 6 4 2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 Hour By the time of day

  42. www.MyWebSite.com (dynamic data) Amazon Route 53 media.MyWebSite.com (DNS) (static data) Elastic Load Balancer Amazon CloudFront Auto Scaling group : Web Tier Amazon EC2 Auto Scaling group : App Tier Amazon RDS Amazon S3 Amazon RDS Availability Zone #1 Availability Zone #2

  43. 50 % Savings Web Servers 1 5 9 13 17 21 25 29 33 37 41 45 49 Week during a year

  44. 75 % Savings RDS DB Servers 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 Days of the Month during a month

  45. Continuous optimization in your architecture and cloud infrastructure results in recurring savings in your next month’s bill

  46. Cost-aware instances Free Memory Free CPU ��� ������� Free HDD At 1-min ����� intervals ����������������� �������� �������������� “You could save a bunch of money by switching to a small instance , Click on CloudFormation Script to Save”

  47. Choosing the right pricing model On-demand Instances Reserved Instances Spot Instances

  48. Steady State Usage Total Cost for 1 Year-term of 2 application servers Usage Fee One-time Fee Total Savings Option 1 $1493 - $1493 - On-Demand only Option 2 ~20% $1008 $227 $1234 On-Demand + Reserved Option 3 ~35% $528 $455 $983 All reserved Total Cost for 3 Year-term of the same 2 application servers Usage Fee One-time Fee Total Savings Option 1 $4479 - $4479 - On-Demand only Option 2 ~30% $3024 $350 $3374 On-Demand + Reserved Option 3 ~50% $1584 $700 $2284 All reserved

  49. 450,000 On Demand 1-year RI 3-year RI 400,000 350,000 300,000 250,000 200,000 2 150,000 3 100,000 1 50,000 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1-year RI versus On Demand: 1 cost savings realized after first 6 months of usage 3-year RI versus On Demand: 2 cost savings realized after first 9 months of usage. 3-year RI versus 1-year RI: 3 Net savings of 3-year RI versus 1-year RI begin by month 13 and continue throughout the RI term (additional 23 months of savings)

  50. Common Pattern: Reserved + On-Demand

  51. Elasticity is one of the fundamental properties of the cloud that drives many of its economic benefits

  52. Cloud-powered Continuous Delivery Continuous Continuous Continuous Optimization Integration Deployment

  53. Summary Invest in areas where you get to learn from your customers quickly Automate everything else Cloud Continuous Integration Release early, Release often, Iterate Quickly Get fast feedback Distributed Builds, Automated Tests in Parallel Cloud Continuous Deployment Reduce the cost of mistakes Increase the speed of iteration Leverage cloud for Blue Green Deployments Cloud Continuous Optimization Keep Optimizing and further reduce costs of infrastructure

  54. Thank you! Jinesh Varia jvaria@amazon.com Twitter: @jinman Credits to Jon Jenkins, Paul Duvall and several engineers at Amazon

  55. http://aws.amazon.com

  56. Optimize by Implementing Elasticity Infrastructure Cost $ Large You just lost Capital customers Expenditure Predicted Demand Opportunity Opportunity Traditional Cost Cost Hardware Wastage Wastage Actual Demand Cloud Automated Elasticity time

Recommend


More recommend