SlideShare une entreprise Scribd logo
1  sur  51
© 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Lenworth Henry
Solutions Architect, Amazon Web Services
194353
CI/CD with AWS Developer Tools and
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 Code Build, Code
Pipeline, Code Commit 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
© 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
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.
Running Fargate Containers with ECS
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.
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 Code Pipeline: https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html
Getting Started with Code Build: https://aws.amazon.com/codebuild/getting-started/
Getting Started with Code Deploy: 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!

Contenu connexe

Tendances

AWS Systems manager 2019
AWS Systems manager 2019AWS Systems manager 2019
AWS Systems manager 2019John Varghese
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control TowerCloudHesive
 
Large-Scale AWS Migrations with CSC
Large-Scale AWS Migrations with CSCLarge-Scale AWS Migrations with CSC
Large-Scale AWS Migrations with CSCAmazon Web Services
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeAmazon Web Services
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Amazon Web Services
 
Identity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityIdentity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityAmazon Web Services
 
Containers on AWS: An Introduction
Containers on AWS: An IntroductionContainers on AWS: An Introduction
Containers on AWS: An IntroductionAmazon Web Services
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsAmazon Web Services
 
AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...
AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...
AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...Amazon Web Services
 
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...Amazon Web Services
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudNew Relic
 
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
 

Tendances (20)

AWS Technical Essentials Day
AWS Technical Essentials DayAWS Technical Essentials Day
AWS Technical Essentials Day
 
Introduction to DevOps on AWS
Introduction to DevOps on AWSIntroduction to DevOps on AWS
Introduction to DevOps on AWS
 
AWS Systems manager 2019
AWS Systems manager 2019AWS Systems manager 2019
AWS Systems manager 2019
 
AWS Control Tower
AWS Control TowerAWS Control Tower
AWS Control Tower
 
DevOps on AWS
DevOps on AWSDevOps on AWS
DevOps on AWS
 
AWS Security Best Practices
AWS Security Best PracticesAWS Security Best Practices
AWS Security Best Practices
 
DevOps and AWS
DevOps and AWSDevOps and AWS
DevOps and AWS
 
Large-Scale AWS Migrations with CSC
Large-Scale AWS Migrations with CSCLarge-Scale AWS Migrations with CSC
Large-Scale AWS Migrations with CSC
 
AWS CloudFormation Masterclass
AWS CloudFormation MasterclassAWS CloudFormation Masterclass
AWS CloudFormation Masterclass
 
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_SingaporeCI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
CI-CD with AWS Developer Tools and Fargate_AWSPSSummit_Singapore
 
Introduction to Amazon EC2
Introduction to Amazon EC2Introduction to Amazon EC2
Introduction to Amazon EC2
 
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
Access Control for the Cloud: AWS Identity and Access Management (IAM) (SEC20...
 
Identity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS SecurityIdentity and Access Management: The First Step in AWS Security
Identity and Access Management: The First Step in AWS Security
 
Containers on AWS: An Introduction
Containers on AWS: An IntroductionContainers on AWS: An Introduction
Containers on AWS: An Introduction
 
Introduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless ApplicationsIntroduction to AWS Lambda and Serverless Applications
Introduction to AWS Lambda and Serverless Applications
 
AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...
AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...
AWS Secrets Manager: Best Practices for Managing, Retrieving, and Rotating Se...
 
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
Advanced Deployment Best Practices with AWS CodeDeploy (DEV404-R2) - AWS re:I...
 
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The CloudCloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
Cloud Migration Cookbook: A Guide To Moving Your Apps To The Cloud
 
Serverless Architectures.pdf
Serverless Architectures.pdfServerless Architectures.pdf
Serverless Architectures.pdf
 
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
 

Similaire à CI/CD with AWS Developer Tools and Fargate

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
 
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 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
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)Amazon Web Services
 
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
 
CI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelCI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelAmazon Web Services
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - 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
 
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
 
How Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWSHow Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWSUri Savelchev
 
CI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
CI/CD Pipeline Security: Advanced Continuous Delivery RecommendationsCI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
CI/CD Pipeline Security: Advanced Continuous Delivery RecommendationsAmazon Web Services
 
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...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
 
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
 
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
 

Similaire à CI/CD with AWS Developer Tools and Fargate (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
 
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
 
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
 
DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)DevSecOps 的規模化實踐 (Level: 300-400)
DevSecOps 的規模化實踐 (Level: 300-400)
 
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) -...
 
CI/CD using AWS developer tools
CI/CD using AWS developer toolsCI/CD using AWS developer tools
CI/CD using AWS developer tools
 
CI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day IsraelCI/CD pipelines on AWS - Builders Day Israel
CI/CD pipelines on AWS - Builders Day Israel
 
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
 
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018Deploying Microservices using AWS Fargate (CON315-R1) - AWS re:Invent 2018
Deploying Microservices using AWS Fargate (CON315-R1) - 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
 
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
 
How Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWSHow Zalando integrates Kubernetes with AWS
How Zalando integrates Kubernetes with AWS
 
CI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
CI/CD Pipeline Security: Advanced Continuous Delivery RecommendationsCI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
CI/CD Pipeline Security: Advanced Continuous Delivery Recommendations
 
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
Earn Your DevOps Black Belt: Deployment Scenarios with AWS CloudFormation (DE...
 
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...
 
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...
 
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
 

Plus de 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
 

Plus de 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

  • 1. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Lenworth Henry Solutions Architect, Amazon Web Services 194353 CI/CD with AWS Developer Tools and 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 Code Build, Code Pipeline, Code Commit 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
  • 13. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production AWS CodeCommit
  • 14. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production AWS CodeBuild
  • 15. © 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
  • 16. © 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
  • 17. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Software Release Steps: Source Build Test Production AWS CodeDeploy
  • 18. © 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
  • 19. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. AWS CI CD Services Source Build Test Production Software Release Steps: AWS CodePipeline
  • 20. © 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
  • 21. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Docker Images
  • 22. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Why Containers? Packaged Application Code and Runtime Dependencies Reproducible Immutable Portable
  • 23. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. 1c2acd7c 8ab2ba66 91bd52b7 d2cccfda Image Layers microservice:latest
  • 24. © 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”]
  • 25. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 26. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Development CI UAT Production
  • 27. © 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
  • 28. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building Docker Images
  • 29. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 30. © 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
  • 31. © 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
  • 32. © 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
  • 33. © 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
  • 34. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Deploying Docker Containers
  • 35. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 36. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 37. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 38. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Running Fargate Containers with ECS
  • 39. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Running Fargate Containers with ECS 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
  • 40. © 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
  • 41. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Building a Deployment Pipeline
  • 42. © 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
  • 43. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Source Build Test Production
  • 44. © 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
  • 45. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Action Stage Pipeline Transition
  • 46. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Developers AWS CodeCommit AWS CodePipeline AWS CodeBuild Amazon ECR Amazon ECS
  • 47. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Demo
  • 48. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 49. © 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/
  • 50. © 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 Code Pipeline: https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-simple-codecommit.html Getting Started with Code Build: https://aws.amazon.com/codebuild/getting-started/ Getting Started with Code Deploy: 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
  • 51. © 2018, Amazon Web Services, Inc. or its affiliates. All rights reserved. Thank you!