SlideShare ist ein Scribd-Unternehmen logo
1 von 54
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Steve Sofian
Solutions Architect, Amazon Web Services
CI/CD with AWS Developer Tools and
AWS Fargate
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
What To Expect from This Session
• Review Continuous Integration, Delivery, and Deployment
• Introducing the AWS suite of Continuous Integration Continuous
Deployment services
• Using Docker Images, Amazon ECS Fargate, and CodeBuild,
CodePipeline, CodeCommit, and Amazon ECR for CI/CD
• Building Docker Container Images with AWS CodeBuild
• Orchestrating Deployment Pipelines with AWS CodePipeline
• Demo
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous Integration, Delivery, and
Deployment
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
The Basic Challenge
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
How can we quickly and reliably
deliver good ideas to our
customers?
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Goals
• Frequency reduces difficulty
• Latency between check-in and production is waste
• Consistency improves confidence
• Automation over toil
• Empowered developers make happier teams
• Smaller batch sizes are easier to debug
• Faster delivery improves software development practices
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Source Build Test Production
• Version Control
• Branching
• Code Review
• Compilation
• Unit Tests
• Static Analysis
• Packaging
• Integration Tests
• Load Tests
• Security Tests
• Acceptance
Tests
• Deployment
• Monitoring
• Measuring
• Validation
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Continuous Integration
Continuous Delivery
Continuous Deployment
Source Build Test Production
Feedback
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Software Release Steps:
Source Build Test Production
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Software Release Steps:
Source Build Test Production
AWS CodeCommit
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Software Release Steps:
Source Build Test Production
AWS CodeBuild
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Software Release Steps:
Source Build Test Production
Third Party
Tooling
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Software Release Steps:
Source Build Test Production
AWS CodeDeploy
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Software Release Steps:
Source Build Test Production
EC2 On-Prem
AWS CodeDeploy
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Source Build Test Production
Software Release Steps:
AWS CodePipeline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CI CD Services
Source Build Test Production
Third Party
Tooling
Software Release Steps:
AWS CodeCommit AWS CodeBuild AWS CodeDeploy
AWS CodePipeline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Docker Images
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Why Containers?
Packaged Application
Code and Runtime
Dependencies
Reproducible
Immutable
Portable
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1c2acd7c
8ab2ba66
91bd52b7
d2cccfda
Image Layers
microservice:latest
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
1c2acd7c
8ab2ba66
91bd52b7
d2cccfda
microservice:latestDockerfile
FROM amazonlinux:2017.03
RUN yum install –y nginx
COPY ./app /bin/app
CMD [”/bin/app”]
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Development CI UAT Production
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best Practices
• Pin external dependencies to specific versions for
reproducibility (e.g. no * or ^ in package.json)
• Package only the runtime requirements for production
• Minimize changes in each layer to maximize cachability
• Maintain a .dockerignore file to exclude unneeded files
from the image
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Building Docker Images
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodeBuild
Build and test code with continuous
scaling with pay-as-you-go pricing
• Build and test projects across services and runtimes
including Java, Ruby, Python, Android, Docker, etc.
• Never pay for idle time
• Fully extensible to other services through custom build
environments
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Specification – Phases
Phase Description Examples
install Installation of packages into the
environment
Install testing frameworks
e.g. RSpec, Mocha
pre_build Commands to run before the build
such as login steps or installation of
dependencies
Log in to Amazon ECR.
run Ruby bundler or npm
build Sequence to run the build such as
compilation and/or running tests
Run go build, sbt, Mocha,
RSpec
post_build Commands to run after a build on
success or failure
Build a JAR via Maven or
push a Docker image to
Amazon ECR
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Build Specification – Docker
version: 0.2
phases:
pre_build:
commands:
- $(aws ecr get-login --no-include-email)
- TAG="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)"
- IMAGE_URI="${REPOSITORY_URI}:${TAG}"
build:
commands:
- docker build --tag "$IMAGE_URI" .
post_build:
commands:
- docker push "$IMAGE_URI"
- printf '[{"name":"cicd-demo-container","imageUri":"%s"}]' "$IMAGE_URI" > images.json
artifacts:
files: images.json
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best Practices
• Tag output artifacts to source control revisions
(e.g. git SHA, semantic version)
• Avoid using a “latest” or “production” tag
• Optimize for build speed
• Collocate build process with its artifact repository
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deploying Docker Containers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Running Fargate Containers with ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
R u n n in g Far g at e C o n tain e rs w ith E C S
Use ECS APIs to launch Fargate Containers
Stress-free migration – Run Fargate and EC2
launch type tasks in the same cluster
Same Task Definition schema
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Best Practices
• Use Elastic Load Balancing health checks to
prevent botched deploys
• For higher confidence, integrate automated
testing against a new environment or
monitoring of a canary before cutover
• Make sure your application can function
against the same backend schema for
adjacent releases
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Building a Deployment Pipeline
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Deployment Pipeline
The automated manifestation
of the process for getting your
software from version control
and into the hands of your
customers
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Source Build Test Production
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
AWS CodePipeline
Model deployment pipelines through a visual workflow
interface which build, test, and deploy new revisions on
code changes
• Integrates with AWS services, open source and third
party tools for building, testing, and deploying code
• Extend deployment pipelines with custom logic through
AWS Lambda functions or custom actions
• Allows operators to block transitions to “stop the line”
and manual approval steps
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Action
Stage
Pipeline
Transition
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Developers AWS CodeCommit AWS CodePipeline
AWS CodeBuild Amazon ECR
Amazon ECS
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Demo
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
EKS Involves some
more steps to
leverage native
tools. See blog post
here:
https://aws.amazon.
com/blogs/devops/c
ontinuous-
deployment-to-
kubernetes-using-
aws-codepipeline-
aws-codecommit-
aws-codebuild-
amazon-ecr-and-
aws-lambda/
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Resources
A whole site on DevOps: https://aws.amazon.com/devops/
Getting Started with ECS Fargate: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html
Getting Started with CodePipeline: https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-
codecommit.html
Getting Started with CodeBuild: https://aws.amazon.com/codebuild/getting-started/
Getting Started with CodeDeploy: https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-
codedeploy.html
Demo Code is available here: https://github.com/lenworthhenry/dc-summit-2018-
node-ecs-fargate-demo.git
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Thank you!
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.

Weitere ähnliche Inhalte

Was ist angesagt?

Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon Web Services
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesAmazon Web Services
 
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...Amazon Web Services
 
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...Amazon Web Services
 
An Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - WebinarAn Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - WebinarAmazon Web Services
 
Deep Dive into Amazon ECS & Fargate
Deep Dive into Amazon ECS & FargateDeep Dive into Amazon ECS & Fargate
Deep Dive into Amazon ECS & FargateAmazon Web Services
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesAmazon Web Services
 
DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIAmazon Web Services
 
CI/CD with AWS Code Services
CI/CD with AWS Code ServicesCI/CD with AWS Code Services
CI/CD with AWS Code ServicesPulkit Gupta
 
DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines Abdul_Mujeeb
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & ProcessesAmazon Web Services
 
DevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterDevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterAmazon Web Services
 

Was ist angesagt? (20)

Amazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for KubernetesAmazon EKS - Elastic Container Service for Kubernetes
Amazon EKS - Elastic Container Service for Kubernetes
 
Deep Dive - CI/CD on AWS
Deep Dive - CI/CD on AWSDeep Dive - CI/CD on AWS
Deep Dive - CI/CD on AWS
 
Build CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation SlidesBuild CICD Pipeline for Container Presentation Slides
Build CICD Pipeline for Container Presentation Slides
 
Intro to Amazon ECS
Intro to Amazon ECSIntro to Amazon ECS
Intro to Amazon ECS
 
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
CI/CD Best Practices for Building Modern Applications - MAD302 - Anaheim AWS ...
 
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
Instrumenting Kubernetes for Observability Using AWS X-Ray and Amazon CloudWa...
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
An Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - WebinarAn Introduction to the AWS Well Architected Framework - Webinar
An Introduction to the AWS Well Architected Framework - Webinar
 
Introduction to Amazon EKS
Introduction to Amazon EKSIntroduction to Amazon EKS
Introduction to Amazon EKS
 
Deep Dive into Amazon ECS & Fargate
Deep Dive into Amazon ECS & FargateDeep Dive into Amazon ECS & Fargate
Deep Dive into Amazon ECS & Fargate
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
DevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and ProcessesDevOps at Amazon: A Look at Our Tools and Processes
DevOps at Amazon: A Look at Our Tools and Processes
 
CI/CD for Modern Applications
CI/CD for Modern ApplicationsCI/CD for Modern Applications
CI/CD for Modern Applications
 
Introducing AWS Fargate
Introducing AWS FargateIntroducing AWS Fargate
Introducing AWS Fargate
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
DEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLIDEV323_Introduction to the AWS CLI
DEV323_Introduction to the AWS CLI
 
CI/CD with AWS Code Services
CI/CD with AWS Code ServicesCI/CD with AWS Code Services
CI/CD with AWS Code Services
 
DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines DevSecOps Basics with Azure Pipelines
DevSecOps Basics with Azure Pipelines
 
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
(DVO202) DevOps at Amazon: A Look At Our Tools & Processes
 
DevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver FasterDevOps on AWS - Building Systems to Deliver Faster
DevOps on AWS - Building Systems to Deliver Faster
 

Ähnlich wie CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore

From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28Amazon Web Services
 
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018Bhuvaneswari Subramani
 
How to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStarHow to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStarAmazon Web Services
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Amazon Web Services
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)Amazon Web Services
 
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...Amazon Web Services
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018
Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018
Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018Amazon Web Services
 
DevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSDevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSatSistemas
 
Ci/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO ClubCi/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO ClubBoaz Ziniman
 
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...Marcia Villalba
 
From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019AWS Summits
 
From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019Amazon Web Services
 
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Amazon Web Services
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryAmazon Web Services
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Amazon Web Services
 

Ähnlich wie CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore (20)

From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28From Code to a Running Container | AWS Floor28
From Code to a Running Container | AWS Floor28
 
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
CI CD using AWS Developer Tools @ AWS Community Day Bengaluru 2018
 
CI/CD@Scale
CI/CD@ScaleCI/CD@Scale
CI/CD@Scale
 
How to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStarHow to Build a CICD Pipeline with AWS CodeStar
How to Build a CICD Pipeline with AWS CodeStar
 
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
Scaling and Automating DevOps with CloudBees and Spot Instances (GPSTEC310) -...
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)
 
CI/CD using AWS developer tools
CI/CD using AWS developer toolsCI/CD using AWS developer tools
CI/CD using AWS developer tools
 
Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2Community day _aws_ci_cd_v0.2
Community day _aws_ci_cd_v0.2
 
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
AWS DevOps Essentials: An Introductory Workshop on CI/CD Best Practices (DEV3...
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018
Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018
Building a DevOps Pipeline on AWS (DEV326) - AWS re:Invent 2018
 
DevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWSDevOps Spain 2019. Pedro Mendoza-AWS
DevOps Spain 2019. Pedro Mendoza-AWS
 
Ci/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO ClubCi/CD for AWS Lambda Projects - JLM CTO Club
Ci/CD for AWS Lambda Projects - JLM CTO Club
 
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...20201012 - Serverless Architecture Conference - Deploying serverless applicat...
20201012 - Serverless Architecture Conference - Deploying serverless applicat...
 
From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019
 
From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019From Code to a running container | AWS Summit Tel Aviv 2019
From Code to a running container | AWS Summit Tel Aviv 2019
 
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
Set Up a CI/CD Pipeline for Deploying Containers Using the AWS Developer Tool...
 
Improve Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & DeliveryImprove Productivity with Continuous Integration & Delivery
Improve Productivity with Continuous Integration & Delivery
 
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
Serverless Application Debugging and Delivery Best Practices (DEV307-R1) - AW...
 

Mehr von Amazon Web Services

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Amazon Web Services
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Amazon Web Services
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateAmazon Web Services
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSAmazon Web Services
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Amazon Web Services
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Amazon Web Services
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...Amazon Web Services
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsAmazon Web Services
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareAmazon Web Services
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSAmazon Web Services
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAmazon Web Services
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareAmazon Web Services
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWSAmazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckAmazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without serversAmazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...Amazon Web Services
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceAmazon Web Services
 

Mehr von Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Steve Sofian Solutions Architect, Amazon Web Services CI/CD with AWS Developer Tools and AWS Fargate
  • 2. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. What To Expect from This Session • Review Continuous Integration, Delivery, and Deployment • Introducing the AWS suite of Continuous Integration Continuous Deployment services • Using Docker Images, Amazon ECS Fargate, and CodeBuild, CodePipeline, CodeCommit, and Amazon ECR for CI/CD • Building Docker Container Images with AWS CodeBuild • Orchestrating Deployment Pipelines with AWS CodePipeline • Demo
  • 3. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous Integration, Delivery, and Deployment
  • 4. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. The Basic Challenge
  • 5. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 6. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. How can we quickly and reliably deliver good ideas to our customers?
  • 7. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Goals • Frequency reduces difficulty • Latency between check-in and production is waste • Consistency improves confidence • Automation over toil • Empowered developers make happier teams • Smaller batch sizes are easier to debug • Faster delivery improves software development practices
  • 8. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Source Build Test Production • Version Control • Branching • Code Review • Compilation • Unit Tests • Static Analysis • Packaging • Integration Tests • Load Tests • Security Tests • Acceptance Tests • Deployment • Monitoring • Measuring • Validation
  • 9. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Continuous Integration Continuous Delivery Continuous Deployment Source Build Test Production Feedback
  • 10. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline
  • 11. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production
  • 12. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production AWS CodeCommit
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production AWS CodeBuild
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production Third Party Tooling
  • 15. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production AWS CodeDeploy
  • 16. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production EC2 On-Prem AWS CodeDeploy
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Source Build Test Production Software Release Steps: AWS CodePipeline
  • 18. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Source Build Test Production Third Party Tooling Software Release Steps: AWS CodeCommit AWS CodeBuild AWS CodeDeploy AWS CodePipeline
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Docker Images
  • 20. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why Containers? Packaged Application Code and Runtime Dependencies Reproducible Immutable Portable
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1c2acd7c 8ab2ba66 91bd52b7 d2cccfda Image Layers microservice:latest
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1c2acd7c 8ab2ba66 91bd52b7 d2cccfda microservice:latestDockerfile FROM amazonlinux:2017.03 RUN yum install –y nginx COPY ./app /bin/app CMD [”/bin/app”]
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 24. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Development CI UAT Production
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Best Practices • Pin external dependencies to specific versions for reproducibility (e.g. no * or ^ in package.json) • Package only the runtime requirements for production • Minimize changes in each layer to maximize cachability • Maintain a .dockerignore file to exclude unneeded files from the image
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building Docker Images
  • 27. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodeBuild Build and test code with continuous scaling with pay-as-you-go pricing • Build and test projects across services and runtimes including Java, Ruby, Python, Android, Docker, etc. • Never pay for idle time • Fully extensible to other services through custom build environments
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Specification – Phases Phase Description Examples install Installation of packages into the environment Install testing frameworks e.g. RSpec, Mocha pre_build Commands to run before the build such as login steps or installation of dependencies Log in to Amazon ECR. run Ruby bundler or npm build Sequence to run the build such as compilation and/or running tests Run go build, sbt, Mocha, RSpec post_build Commands to run after a build on success or failure Build a JAR via Maven or push a Docker image to Amazon ECR
  • 30. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Build Specification – Docker version: 0.2 phases: pre_build: commands: - $(aws ecr get-login --no-include-email) - TAG="$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | head -c 8)" - IMAGE_URI="${REPOSITORY_URI}:${TAG}" build: commands: - docker build --tag "$IMAGE_URI" . post_build: commands: - docker push "$IMAGE_URI" - printf '[{"name":"cicd-demo-container","imageUri":"%s"}]' "$IMAGE_URI" > images.json artifacts: files: images.json
  • 31. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Best Practices • Tag output artifacts to source control revisions (e.g. git SHA, semantic version) • Avoid using a “latest” or “production” tag • Optimize for build speed • Collocate build process with its artifact repository
  • 32. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deploying Docker Containers
  • 33. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Running Fargate Containers with ECS
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. R u n n in g Far g at e C o n tain e rs w ith E C S Use ECS APIs to launch Fargate Containers Stress-free migration – Run Fargate and EC2 launch type tasks in the same cluster Same Task Definition schema
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Best Practices • Use Elastic Load Balancing health checks to prevent botched deploys • For higher confidence, integrate automated testing against a new environment or monitoring of a canary before cutover • Make sure your application can function against the same backend schema for adjacent releases
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building a Deployment Pipeline
  • 40. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deployment Pipeline The automated manifestation of the process for getting your software from version control and into the hands of your customers
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Source Build Test Production
  • 42. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CodePipeline Model deployment pipelines through a visual workflow interface which build, test, and deploy new revisions on code changes • Integrates with AWS services, open source and third party tools for building, testing, and deploying code • Extend deployment pipelines with custom logic through AWS Lambda functions or custom actions • Allows operators to block transitions to “stop the line” and manual approval steps
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Action Stage Pipeline Transition
  • 44. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Developers AWS CodeCommit AWS CodePipeline AWS CodeBuild Amazon ECR Amazon ECS
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. EKS Involves some more steps to leverage native tools. See blog post here: https://aws.amazon. com/blogs/devops/c ontinuous- deployment-to- kubernetes-using- aws-codepipeline- aws-codecommit- aws-codebuild- amazon-ecr-and- aws-lambda/
  • 49. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Resources A whole site on DevOps: https://aws.amazon.com/devops/ Getting Started with ECS Fargate: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html Getting Started with CodePipeline: https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple- codecommit.html Getting Started with CodeBuild: https://aws.amazon.com/codebuild/getting-started/ Getting Started with CodeDeploy: https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started- codedeploy.html Demo Code is available here: https://github.com/lenworthhenry/dc-summit-2018- node-ecs-fargate-demo.git
  • 50. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you!
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 52. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 53. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 54. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.