Continuous Deployment with Amazon Web Services
-
Upload
julien-simon -
Category
Technology
-
view
531 -
download
0
Transcript of Continuous Deployment with Amazon Web Services
![Page 1: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/1.jpg)
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Julien Simon Principal Technical Evangelist, AWS [email protected] @julsimon
Continuous Deployment with Amazon Web Services
![Page 2: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/2.jpg)
You’re more than welcome to tweet about this webinar
@julsimon @aws_actus #aws #devops
![Page 3: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/3.jpg)
Agenda
• A few definitions
• The DevOps story at Amazon.com
• The Code* services
• Demo #1: CI/CD on C library
• Demo #2: CI/CD on Java web application
![Page 4: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/4.jpg)
CI, CD, DevOps Continuous Integration: breaking down system integration into small steps by regularly merging code into a shared mainline and fully testing the updated code automatically Continuous delivery: a software engineering approach in which teams produce software in short cycles, ensuring that the software can be reliably released at any time. Continuous deployment: every change is automatically deployed to production DevOps: a set of practices that emphasize the collaboration and communication of both software and operations while automating the process of software delivery and infrastructure changes.
Source: Wikipedia
![Page 5: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/5.jpg)
![Page 6: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/6.jpg)
Monolith development lifecycle
developers
release test build
delivery pipeline app
![Page 7: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/7.jpg)
![Page 8: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/8.jpg)
![Page 9: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/9.jpg)
Service-Oriented Architecture (SOA)" Single-purpose" Connected through APIs" Highly decoupled “Microservices”
![Page 10: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/10.jpg)
Two-pizza teams" Full ownership " Full accountability" Aligned incentives “DevOps”
![Page 11: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/11.jpg)
Missing tools
developers delivery pipeline services
???
![Page 12: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/12.jpg)
Self-service" Technology-agnostic Encourage best practices Single-purpose services
![Page 13: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/13.jpg)
Deployment service" No downtime Health tracking Versioned artifacts Rollbacks
![Page 14: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/14.jpg)
Pipelines Continuous delivery Automated release process Faster and more reliable releases Used by >90% of teams
![Page 15: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/15.jpg)
DevOps development lifecycle
developers delivery pipelines services
release test build
release test build
release test build
release test build
release test build
release test build
![Page 16: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/16.jpg)
= 50 million deployments a year (1.5 deployment every second)
Thousands of teams" × Microservice architecture
× Continuous delivery × Multiple environments
![Page 17: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/17.jpg)
![Page 18: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/18.jpg)
How can we help others do this?
![Page 19: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/19.jpg)
Setting up a delivery pipeline
Testing Staging Production
deploy
deploy
deploy Source Build
release
AWS CodeDeploy
AWS CodePipeline
AWS Code"
Commit
AWS Code"Build
![Page 20: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/20.jpg)
AWS Code* partners
![Page 21: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/21.jpg)
AWS CodeCommit
• Use standard Git tools • Scalability, availability and durability of Amazon S3 • Encryption at rest with customer-specific keys • Pricing: first 5 users free, then $1 / user / month
git pull/push CodeCommit
Git objects in Amazon S3
Git index in Amazon DynamoDB
Encryption key in AWS KMS
SSH or HTTPS
![Page 22: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/22.jpg)
AWS CodeBuild
• New service launched at re:Invent 2016 • Managed build environments (Linux only for now) • Pull sources from Github, S3 or CodeCommit • Build on an AWS-provided image or your Docker container • Supported environments : “base”, Android, Java, Go,
Python, Ruby, Go, Docker • Build commands: inline or in buildspec.yml file • Pricing starts at $0.005 per minute (free tier available)
![Page 23: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/23.jpg)
AWS CodeDeploy
• Easy and reliable deployments: zero downtime, rollbacks • Deploy to any server with agent: Linux / Windows, EC2 / on-premise • Scale with ease: Auto Scaling groups supported • Green-blue deployment supported • Pricing : no extra charge for EC2
Test CodeDeploy v1, v2, v3
Production
Dev
![Page 24: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/24.jpg)
AWS CodePipeline
• Define stages: Source, Build, Test, Deploy, Invoke, Approve • Connect to best-of-breed tools • Build a fast, consistent and traceable release process • S3 is used to stored source and build artefacts • Pricing: $1 / active pipeline / month
Build 1) Build 2) Unit test
1) Deploy beta 2) QA
Source Deploy Deploy SNS Approve
Deploy prod 1) Pull
![Page 25: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/25.jpg)
Demo #1
![Page 26: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/26.jpg)
The Pipeline
• Source: CodeCommit repository • C sources (library for generic data structures) • buildspec.yml: config file for CodeBuild • appspec.yml: config file for CodeDeploy • Also here: https://github.com/juliensimon/data-structures
• Build: CodeBuild ‘base’ environment • Install dependencies • Build librairies • Run unit tests (Cunit)
• Deploy: CodeDeploy • One deployment group with a single instance • Copy libraries to /usr/local/lib
AWS "CodeBuild
AWS "CodeCommit
AWS "CodeDeploy
![Page 27: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/27.jpg)
Demo #2
Expanded version of http://blogs.aws.amazon.com/application-management/post/
Tx2CIB02ZO05ZII/Explore-Continuous-Delivery-in-AWS-with-the-Pipeline-Starter-Kit "
![Page 28: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/28.jpg)
us-east-1a us-east-1c
us-east-1
ProdWebApp01-02 ProdWebApp03-04
DevWebApp01
dev.julien.org
DevWebApp Deployment Group ProdWebApp
Deployment Group
ALB + Certificate
prod.julien.org
JenkinsServer CodeDeploy
CodePipeline
CloudFormation
AWS Code* demo Source (GitHub) à Build (Jenkins) à Deploy Dev (CodeDeploy) à Approve (SNS Email) à Deploy Prod (CodeDeploy) Code "
+ appspec.yml "+ scripts
SNS
![Page 29: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/29.jpg)
![Page 30: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/30.jpg)
Typical issues you may encounter J • EC2 instances are not allowed to access build artefacts in S3 bucket"
à check IAM role • CodeDeploy agent is either not installed or not running"
à install it or start it • appspec.yml and scripts are not included in build artefact"
à check that they’re included in buildspec.yml • Not enough EC2 instances are running to satisfy health constraints of the
deployment configuration"à Add more instances or relax health constraints
• How to debug: • Check artefacts in S3 bucket (file names, directory structure, etc.) • Read deployment logs stored in CloudWatch Logs • https://docs.aws.amazon.com/codedeploy/latest/userguide/troubleshooting.html
![Page 31: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/31.jpg)
Closing words
• Automation is a key factor in technical & business agility
• You can use the same tools as Amazon.com!
• Zero dev infrastructure to purchase & manage
• Minimal cost
• Compatible with your existing CI/CD tools
![Page 32: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/32.jpg)
Next steps
Learn more http://aws.amazon.com/awscode http://blogs.aws.amazon.com/application-management https://aws.amazon.com/fr/new/#dev-tools
Get started http://aws.amazon.com/free http://console.aws.amazon.com
![Page 33: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/33.jpg)
AWS User Groups
Lille Paris Rennes Nantes Bordeaux Lyon Montpellier Toulouse Côte d’Azur (new!)
facebook.com/groups/AWSFrance/
@aws_actus
![Page 34: Continuous Deployment with Amazon Web Services](https://reader031.fdocuments.in/reader031/viewer/2022022413/58ce887b1a28ab210a8b7195/html5/thumbnails/34.jpg)
https://aws.amazon.com/fr/events/webinaires/