Mais conteĂșdo relacionado Semelhante a CI CD using AWS Developer Tools @ AWS Community Day Chennai 2019 (20) Mais de Bhuvaneswari Subramani (20) CI CD using AWS Developer Tools @ AWS Community Day Chennai 20191. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CHENNAI
2. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CI CD using AWS Developer Tools
Bhuvaneswari Subramani | 10th Aug 2019
3. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Bhuvaneswari Subramani (Bhuvana)
Director, Engineering Operations, Infor
Currently working on Cloud Computing, DevOps &, Performance QA
https://installjournal.blogspot.com
4. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Agenda
âą AWS CI CD Services Overview
âą Use case leveraging AWS CI CD Services
âą Infrastructure Rollouts + WebApp Deployment
âą buildspec, appspec
âą Debugging Build & Deployment
âą Rollback Deployments
âą Metrics to gauge DevOps
5. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CI CD Services - Overview
6. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Software Release Phases
Source Build Test Deploy
Testing
âą Integration Test
âą UI Test
âą Load Test
âą Penetration Tests
Deployment
Deployment to Prod
Environments
Code Management
âą Check-in source code
âą Peer review new code
âą Version Control
âą Multi-enterprise
Package Creation
âą Compile Code
âą Run Unit Tests
âą Create Container
Images
Continuous Integration
Continuous Delivery
7. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Software Release Phases vs
AWS CI CD Services
Source Build Test Deploy
AWS CodeCommit AWS CodeBuild Third Party Tooling AWS CodeDeploy
AWS
CodePipeline
8. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Plight of Self Managed
Source Control Repo
9. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Commit
âą Secure, Scalable, and managed Git Source control
âą Use Standard git tools
âą Scalability, availability and durability of Amazon S3 &
Amazon Dynamo DB
âą No repo size limit
âą Post commit hooks to call out to SNS / Lambda
10. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Visualizer Compare Pull Request
AWS Code Commit
11. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
When there is no
CI CD??
12. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Build
âą Fully managed build service that compiles source code, run
tests, and produces software packages
âą Scales continuously and processes multiple builds
âą You can provide custom build environments suited to your
needs via Docker images
âą Only pay by the minute for the compute resources you use
âą Launched with Services like CodePipeline or Jenkins
13. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Build Project
Where to get the
source code?
Which build
environment to use?
Where to store the
artifact?
Where to store the
build logs?
14. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Deploy
âą Automates code deployments to EC2 / On-prem
âą Handles the complexity of updating your applications
âą Minimal deployment downtime
âą Rollback automatically, if failure detected
âą Supports varied languages and operating systems
âą Integrates with third-party tools like Jenkins
15. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Revision 1
Application
Revision 2
Revision 3
Revision n
Instance 1
Deployment Group
Instance 2
Instance 3
Instance n
Deployments
Deploy
Config
appspe
c.yml
In-place
deployment
AWS Code Deploy Components
16. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Revision 1
Application
Revision 2
Revision 3
Revision n
Instance 1
Deployment Group
Instance 2
Instance 3
Instance n
Deployments
Deploy
Config
appspe
c.yml
In-place
deployment
AWS Code Deploy Components
What to
deploy?
Where to
deploy?
How to
deploy?
17. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS CodePipeline
âą Continuous delivery service for fast and reliable application
updates
âą Model and visualize your software release process
âą Builds, tests and deploys your code on every commit
âą Integrates with third-party tools
18. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Action Action
Stage
Action Action
Stage
Action
Transition
AWS CodePipeline
19. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Quick look @ pricing*
âą AWS CodeCommit: Anyone with an AWS account can get started with AWS
CodeCommit for free. Your account gets 5 active users per month for free (within
limits), after which you pay $1 per additional active user per month.
âą AWS CodeBuild: Only pay by minute for the compute resources you use.
âą AWS CodeDeploy: There is no additional charge for code deployments to Amazon EC2
instances through AWS CodeDeploy. You pay $0.02 per on-premises instance update
using AWS CodeDeploy.
âą AWS CodePipeline: You pay only for what you use. AWS CodePipeline costs $1 per
active pipeline* per month. To encourage experimentation, pipelines are free for the
first 30 days after creation.
* Pricing as on Aug 2019
20. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Infrastructure Rollouts &
Web Application Deployments
AWS CD CD Workflow
21. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Use Case
âą IaC using Cloud Formation Template
âą Create an EC2 Instance
âą Install CodeDeploy agent through UserData
âą Add specific tag `Name = WebApp`
âą Deploy Web Application
âą Install Tomcat & deploy WebApp through instructions from appspec.yml
22. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
23. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Source Build Deploy
24. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Infrastructure Rollout +
Web App Deployment
25. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
buildspec.yml & appspec.yml files
26. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
buildspec.yml
buildspec.yml from Web Application Deployments
27. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
buildspec.yml from Web Application Deployments
buildspec.yml
Create & store an artifact in S3
28. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
appspec.yml
appspec.yml from Web Application Deployments
29. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
appspec.yml
appspec.yml from Web Application Deployments
Files to be copied to the
instance during deploymentâs
install
30. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Debugging, Rollback & Metrics
31. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Debugging Builds
âą Enable Logging in CloudWatch / S3
32. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Debugging Builds
âą Enable Logging in CloudWatch / S3
âą Local Build Support for AWS CodeBuild
âą Get the AWS CodeBuild docker image file from AWS
Github
âą Build the CodeBuild image locally
âą Setup CodeBuild local Agent
âą Use the local agent to build your project
33. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Debugging Deployments
âą CodeDeploy agent generates agent, updater & deployment logs
âą Send them to CloudWatch for debugging
âą CodeDeploy agent logs [EC2/On-prem only]
âą /var/log/aws/codedeploy-agent/codedeploy-agent.log
34. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Debugging Deployments
âą CodeDeploy agent generates agent, updater & deployment logs
âą Send them to CloudWatch for debugging
âą CodeDeploy agent logs [EC2/On-prem only]
âą /var/log/aws/codedeploy-agent/codedeploy-agent.log
âą CodeDeploy deployment logs
âą /opt/codedeploy-agent/deployment-root/deployment-logs/
âą CodeDeploy updater logs
âą /tmp/codedeploy-agent.update.log
35. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Rollback Deployments
âą Rollback in AWS is actually ====>
âą Configure re-deploy by enabling
âą Code deploy -> Rollbacks >
âą Code deploy -> âAutomatic Rollbacksâ
âą Deployment Configuration to enable rollback based on healthy instances
36. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Metrics to gauge DevOps
âą Rapid Delivery with Increased Efficiency
âą Increased Feature releases with reduced TTM
âą Quicker feedback (system/user) to teams & stake holders
âą Greater % of defects detected in testing (Unit & SIT Cycles)
âą Ticket / Incidents volume reduction in PreProd & Prod
âą High Availability
âą Elastic & Scalable Infrastructure
37. © 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps Journey beginsâŠ
https://installjournal.blogspot.com
https://www.linkedin.com/in/bhuvanas/
@installjournal