O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

How to Triple Your Speed of Development Using Automation

309 visualizações

Publicada em

Use AWS coupled with automation tools to speed up your software development.

Publicada em: Tecnologia
  • Seja o primeiro a comentar

How to Triple Your Speed of Development Using Automation

  1. 1. How to Triple Your Speed of Development Using Automation | 26/03/2017 How to Triple Your Speed of Development Using Automation Johanan Liebermann 26/03/2017
  2. 2. AWS and GCP Division Overview | Nov. 2016 © 2016 AllCloud “AWS Managed Service Partners are skilled at cloud infrastructure and application migration, and deliver value to customers by offering proactive monitoring, automation, and management of their customer’s environment.” https://aws.amazon.com/partners/msp/ http://www.allcloud.io/msp AWS Next-Gen (v3) Managed Service Partner (MSP)
  3. 3. How to Triple Your Speed of Development Using Automation | 26/03/2017 Johanan Liebermann Software Developer at AllCloud johanan.liebermann@allcloud.io About Me
  4. 4. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Intro ● Using automation to speed up your development ● Two real use cases (instance-based and container-based) Topics
  5. 5. How to Triple Your Speed of Development Using Automation | 26/03/2017 Intro
  6. 6. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Today’s software world moves fast! ● Tiny startups can challenge giants ● Delivering a product to the masses is easy ● Release cycle takes days, not months ● Time to market can make or break your product The Need for Speed
  7. 7. How to Triple Your Speed of Development Using Automation | 26/03/2017 How?
  8. 8. How to Triple Your Speed of Development Using Automation | 26/03/2017 Automate Everything!
  9. 9. How to Triple Your Speed of Development Using Automation | 26/03/2017 “A set of practices which make software lifecycle more efficient by bridging the gap between development and operations and aiming for automation in every aspect.” DevOps
  10. 10. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Continuous Integration & Continuous Delivery / Deployment ● A major part of DevOps ● Continually building, testing and deploying your code ● Catch problems as soon as possible ● Work on multiple features in parallel ● Ship code often in small chunks CI/CD
  11. 11. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Version Control ● Build Process ● Testing ● Configuration Management ● Infrastructure Provisioning ● Deployment & Release What Areas Can You Automate?
  12. 12. How to Triple Your Speed of Development Using Automation | 26/03/2017 Version Control Managing changes to source code
  13. 13. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Git hooks ○ Trigger build, test and deploy processes ○ Enforce commit message style ○ Enforce coding standards (can’t commit bad code) ○ Notify developers about code-related events ● Automated handling of branches and pull requests ○ GitHub API Version Control Automation
  14. 14. How to Triple Your Speed of Development Using Automation | 26/03/2017 Build Process Generating artifacts from source code
  15. 15. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Build automation tools ○ Make, Maven, Gradle, Grunt, Gulp, Rake... ● Dependency / package managers ○ pip, npm, RubyGems, Conda, Bower... Build Process Automation
  16. 16. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Your artifacts should be properly-versioned ● Your artifacts should be consistently-available ● Many types of artifacts ○ Language-specific - JAR, Gem ○ OS-specific - RPM, Deb, APK, IPA ○ Images - Docker, Vagrant, AMI Handling Artifacts
  17. 17. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Dedicated solutions: Artifactory, Nexus, ECR, Docker Hub ● Simple file storage: S3 Artifact Storage Options
  18. 18. How to Triple Your Speed of Development Using Automation | 26/03/2017 Verifying the quality of your code Testing
  19. 19. How to Triple Your Speed of Development Using Automation | 26/03/2017 Unit Testing Types of Testing Integration Testing Functional Testing
  20. 20. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Making sure a small, isolated piece of code works properly ● Done as part of the build process ● Unit tests should be an integral part of the code ● A failed unit test should always stop the build process ● Typically done using built-in language features or dedicated frameworks (JUnit, pytest, rspec…) ● Provides a fast feedback for new code Unit Testing
  21. 21. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Making sure a couple of components work together properly ● Should be done as part of the deployment / release process ● Usually requires deployment to an environment ● Typically done using dedicated tools or custom scripts ● Typically involves “external” entities such as databases, 3rd party APIs, managed services etc. Integration Testing
  22. 22. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● End-to-end testing of a product ● Should be done as part of the deployment / release process ● Typically simulates user interaction for front-end applications using tools such as Selenium and Appium ● Typically simulates API calls for back-end services using tools such as Ready! API or vREST Functional Testing
  23. 23. How to Triple Your Speed of Development Using Automation | 26/03/2017 Ensuring your servers are properly configured to serve your application Configuration Management
  24. 24. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Typically includes: ○ Installing packages ○ Ensuring configuration files are in the desired state ○ Setting OS-level configuration parameters (file permissions, environment variables...) ○ Configuring services ● Declarative syntax & idempotent in most cases Configuration Management
  25. 25. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Dedicated tools: Ansible, Chef, Puppet, SaltStack ● Built-in functionality: Dockerfiles, ebextensions ● Custom scripts (not recommended) Configuration Management Tools
  26. 26. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Two approaches to managing your infrastructure ○ Mutable infrastructure: modifying existing nodes ○ Immutable infrastructure: replacing existing nodes ● Both options are achievable using CM tools ○ Use CM tools to manage your nodes directly ○ Use CM tools to generate images Mutable vs. Immutable Infrastructure
  27. 27. How to Triple Your Speed of Development Using Automation | 26/03/2017 Infrastructure Provisioning Creating, updating and destroying cloud infrastructure
  28. 28. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Relevant mainly for IaaS ● Typical resources which need provisioning: ○ Compute resources (EC2, ECS, Lambda) ○ Network & security (VPC, ELB, CloudFront) ○ Databases, cache clusters and queues (RDS, DynamoDB, ElastiCache, SQS) ○ Storage (EBS, EFS, S3) ○ Miscellaneous services (IAM, SNS, SES, CloudWatch...) Infrastructure Provisioning
  29. 29. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● An approach in which infrastructure == code ○ Version-controlled ○ Tested ● Provides reproducibility ● Usually declarative & idempotent Infrastructure as Code
  30. 30. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Dedicated tools: CloudFormation, Terraform ● Built-in functionality: Elastic Beanstalk, Heroku Infrastructure Provisioning Tools
  31. 31. How to Triple Your Speed of Development Using Automation | 26/03/2017 Making your code available to the users Deployment & Release
  32. 32. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Back-end services ○ Update or replace instances / containers / Lambda functions ○ Run DB migrations ● Front-end services ○ Run minification & CSS preprocessing ○ Sync S3 buckets ○ Invalidate CDN Deployment Process
  33. 33. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● In-place - simply updating the live nodes ● Canary - deploying to a small amount of nodes first, making sure everything is fine, then updating all the nodes ● Blue/Green - maintaining two identical production environments and switching the activity between them Back-End Deployment Strategies
  34. 34. How to Triple Your Speed of Development Using Automation | 26/03/2017 Sample Pipeline: CodeDeploy
  35. 35. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● A managed deployment service by AWS ● Handles the deployment process for you ● Minimizes downtime ○ In-place rolling updates ○ Built-in support for Blue/Green deployment ● Automatic or manual rollbacks ● Platform-agnostic: use with any OS, any runtime and any CM AWS CodeDeploy
  36. 36. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● A REST API written in Python on Amazon Linux ● Jenkins as an automation server ● Artifactory for artifact storage ● Ansible for CM ● CodeDeploy for deployment Pipeline Setup
  37. 37. How to Triple Your Speed of Development Using Automation | 26/03/2017 The Pipeline 2. Run unit tests 3. Build pip package 4. Build Ansible RPM 1. Checkout 5. Store pip & RPM 6. Push new revision 7. Trigger CodeDeploy 8. Deregister from ELB 9. Install RPM using YUM 10. Run Ansible 11. Verify service 12. Register with ELB Pull RPM & pip - Run pip install - Modify config files - Start service
  38. 38. How to Triple Your Speed of Development Using Automation | 26/03/2017 Sample Pipeline: ECS
  39. 39. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● EC2 Container Service ● The native AWS container management service ● Runs on EC2 ● Contains a private Docker registry (ECR) ● Native integration with Auto Scaling, ELB and IAM ● ECS is free (but ECR has charges) AWS ECS
  40. 40. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● A REST API written in NodeJS ● Jenkins as an automation server ● ECR for artifact storage ● No need for CM (Docker handles it) ● ECS for deployment Pipeline Setup
  41. 41. How to Triple Your Speed of Development Using Automation | 26/03/2017 The Pipeline 2. Build Docker image 3. Run unit tests 4. Push image 1. Checkout 5. Update Task Definition 6. Update Service 7. Replace containers Pull image
  42. 42. How to Triple Your Speed of Development Using Automation | 26/03/2017 Conclusion
  43. 43. How to Triple Your Speed of Development Using Automation | 26/03/2017 ● Implement fully-automated pipelines to leverage the full potential of the cloud ● Automation will boost your speed of development and allow you to focus on your differentiating factors ● Relying on managed services wherever possible will reduce the manpower needed for operating your service and may also reduce your costs Conclusion
  44. 44. How to Triple Your Speed of Development Using Automation | 26/03/2017 Thank You! info@allcloud.io

×