Weitere ähnliche Inhalte Ähnlich wie CI/CD pipelines on AWS - Builders Day Israel (20) Mehr von Amazon Web Services (20) CI/CD pipelines on AWS - Builders Day Israel1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Builders’ Day
Jerusalem
CI/CD pipelines on AWS
Lior Pollack, Solutions Architect, AWS
Oren Reuveni, Solutions Architect, AWS
2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
https://secure.flickr.com/photos/mgifford/4525333972
Why are we
here today?
3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What we'll cover
DevOps concept
The Amazon DevOps story
AWS CI/CD Portfolio
4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Software moves
faster today
5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is DevOps?
6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
What is DevOps?
• Cultural philosophies
• Practices
• Tools
7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps Culture
• Dev & Ops coming together
• No more “silos”
• Shared responsibility
• Ownership
• Visibility and communication
8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
DevOps Practices
• Microservices
• Moving away from “monolithic” application architecture
to many individual services
• Continuous
• Continuous Integration
• Continuous Delivery & Deployment
• Monitoring and logging, feedback cycle
• Infrastructure as Code
• Model your AWS resources using code
9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Reliability
Benefits of DevOps
Speed
Scale
Rapid DeliveryImproved Collaboration
Security
10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
A look back at
development at
Amazon..
https://secure.flickr.com/photos/pixelthing/15806918992/
11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
2001
Development transformation at Amazon: 2001-2009
2009
monolithic application + teams microservices + 2 pizza teams
12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Things went much
better under this
model and teams
were releasing faster
than ever, but we
felt that we could
still improve.
13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
In 2009, we
ran a study to
find out where
inefficiencies
might still exist
14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We were just waiting.
WaitWrite
Code WaitBuild
Code WaitDeploy
to Test
Deploy
to
Prod
Mins Days Mins Days Mins Days Mins
15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We were just waiting.
WaitWrite
Code WaitBuild
Code WaitDeploy
to Test
Deploy
to
Prod
Weeks
Mins Days Mins Days Mins Days Mins
16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We were just waiting.
WaitWrite
Code WaitBuild
Code WaitDeploy
to Test
Deploy
to
Prod
Weeks
Mins Days Mins Days Mins Days Mins
Hours
17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
We built tools to
automate our software
release process
https://secure.flickr.com/photos/lindseygee/5894617854/
18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Automated actions and
transitions; from check-
in to production
Development benefits:
• Faster
• Safer
• Simplification &
standardization
• Visualization of the
process
Pipelines
19. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
This has continued to work out really well:
In 2014:
• Thousands of service teams across Amazon
• Building microservices
• Practicing continuous delivery
• Many environments (staging, beta, production)
50 million deploys
20. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Where do you
?
21. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
• Integration
tests with
other systems
• Load testing
• UI tests
• Penetration
testing
Release processes have four major phases
Source Build Test Production
• Check-in
source code
such as .java
files.
• Peer review
new code
• Compile code
• Unit tests
• Style checkers
• Code metrics
• Create
container
images
• Deployment
to production
environments
22. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Release processes levels
Source Build Test Production
Continuous integration
Continuous delivery
Continuous deployment
23. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
AWS CodePipelineAWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodeStar
24. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Software release steps
25. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Software release steps
AWS CodeCommit
26. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Software release steps
AWS CodeBuild
27. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fully managed build service that compiles source
code, runs tests, and produces software packages
Scales continuously and processes multiple builds
concurrently
You can provide custom build environments suited
to your needs via Docker images
Pay by the minute for the compute resources you use
Integrated with AWS CodePipeline and Jenkins
AWS CodeBuild
28. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
buildspec.yml Example
version: 0.1
environment_variables:
plaintext:
JAVA_HOME: "/usr/lib/jvm/java-8-openjdk-amd64"
phases:
install:
commands:
- apt-get update -y
- apt-get install -y maven
pre_build:
commands:
- echo Nothing to do in the pre_build phase...
build:
commands:
- echo Build started on `date`
- mvn install
post_build:
commands:
- echo Build completed on `date`
artifacts:
type: zip
files:
- target/messageUtil-1.0.jar
discard-paths: yes
• Variables to be used by phases of
build
• Examples for what you can do in the
phases of a build:
• You can install packages or run
commands to prepare your
environment in ”install”
• Run syntax checking, commands in
“pre_build”
• Execute your build tool/command in
“build”
• Test your app further or ship a
container image to a repository in
post_build
• Create and store an artifact in S3
29. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Third-party
tooling
Software release steps
30. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Deploying your
applications
https://secure.flickr.com/photos/simononly/15386966677
31. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Software release steps
AWS CodeDeploy
Cloudformation / SAM
32. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Automates code deployments to any instance
Handles the complexity of updating your
applications
Avoid downtime during application deployment
Rollback automatically if failure detected
Deploy to Amazon EC2 or on-premises servers, in
any language and on any operating system
Integrates with third-party tools and AWS
AWS CodeDeploy
33. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
appspec.yml Example
version: 0.0
os: linux
files:
- source: /
destination: /var/www/html
permissions:
- object: /var/www/html
pattern: “*.html”
owner: root
group: root
mode: 755
hooks:
ApplicationStop:
- location: scripts/deregister_from_elb.sh
BeforeInstall:
- location: scripts/install_dependencies.sh
ApplicationStart:
- location: scripts/start_httpd.sh
ValidateService:
- location: scripts/test_site.sh
- location: scripts/register_with_elb.sh
• Remove/add instance to ELB
• Install dependency packages
• Start Apache
• Confirm successful deploy
• More!
• Send application files to one
directory and configuration
files to another
• Set specific permissions on
specific directories & files
34. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
v2 v2 v2 v2 v2 v2
one at a time
half at a time
all at once
v2 v2 v2 v1 v1 v1
v2 v1 v1 v1 v1 v1 Agent Agent
Dev Deployment group
OR
Prod Deployment group
Agent
AgentAgent
Agent Agent
Agent
Choose Deployment Speed and Group
35. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Serverless Application Model (SAM)
CloudFormation extension optimized for
serverless
New serverless resource types: functions, APIs,
and tables
Supports anything CloudFormation supports
Open specification (Apache 2.0)
https://github.com/awslabs/serverless-application-model
36. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
SAM template
AWSTemplateFormatVersion: '2010-09-09’
Transform: AWS::Serverless-2016-10-31
Resources:
GetHtmlFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: s3://sam-demo-bucket/todo_list.zip
Handler: index.gethtml
Runtime: nodejs4.3
Policies: AmazonDynamoDBReadOnlyAccess
Events:
GetHtml:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
ListTable:
Type: AWS::Serverless::SimpleTable
Tells CloudFormation this is a SAM
template it needs to “transform”
Creates a Lambda function with the
referenced managed IAM policy,
runtime, code at the referenced zip
location, and handler as defined.
Also creates an API Gateway and
takes care of all
mapping/permissions necessary
Creates a DynamoDB table with 5
Read & Write units
37. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
NEW: Can deploy AWS Lambda.
Uses AWS SAM to deploy serverless applications
Supports Lambda Alias Traffic Shifting enabling
canaries and blue|green deployments
Can rollback based on CloudWatch Metrics/Alarms
Pre/Post-Traffic Triggers can integrate with other
services (or even call Lambda functions)
AWS CodeDeploy + Lambda
38. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Source Build Test Production
Third-party
tooling
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
AWS Code Services
Software release steps
39. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Continuous delivery service for fast and
reliable application updates
Model and visualize your software release
process
Builds, tests, and deploys your code every
time there is a code change
Integrates with third-party tools and AWS
AWS CodePipeline
40. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
41. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Code Services
Source Build Test Production
Third-party
tooling
Software release steps
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
AWS CodeStar
42. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Introducing: AWS CodeStar
Quickly develop, build, and deploy applications on AWS
Start developing on AWS in minutes
Work across your team, securely
Manage software delivery easily
Choose from a variety of project templates
43. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Demo
44. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Summary
We’ve seen a quick run through today of the benefits of continuous delivery
on our software release process:
• Continuous integration (build/test) helps shrink our feedback loop
greatly
• We can get our software out in front of our users much more rapidly
• By moving faster we can actually ensure better quality
• AWS Code services enables continuous delivery, and allows integration
with almost any service or tool you can think of!
45. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Builders’ Day
Jerusalem
Thank You!
Lior Pollack, Solutions Architect, AWS
Oren Reuveni, Solutions Architect, AWS