SlideShare una empresa de Scribd logo
1 de 41
TurboCharge Your Continuous Delivery
Pipeline with Containers
Yaniv Donenfeld, Solutions Architect
Amazon Web Services
What to expect from the session
• Best practices for containers in continuous
delivery solutions
• Toolset to implement such solutions
• Demos
Why use containers?
• Process isolation
• Portable
• Fast
• Efficient
Why use containers for continuous delivery?
• Roll out features as quickly as possible
• Predictable and reproducible environment
• Fast feedback
Demo application architecture
Nginx Proxy
Ruby on Rails
web app
PostgreSQL
on RDS
Amazon EC2 Container Service
• Highly scalable container management service
• Easily manage clusters for any scale
• Flexible container placement
• Integrated with other AWS services
• Extensible
• Amazon ECS concepts
• Cluster and container instances
• Task definition and task
Development and deployment workflow
Orchestration
layer
Code repository Build
environment
Test
environment
Deployment
environment
Source
Stage 1 - Source
Development environment
Code repository
Source
AWS CodeCommit
• Private Git repository
• Fully managed
• Secure
• Highly available and scalable
• Alternatives
• GitHub
• Bitbucket
Docker and Docker Toolbox
• Docker (Linux > 3.10) or Docker Toolbox (OS X,
Windows)
• Define app environment with Dockerfile
Dockerfile
FROM ruby:2.2.2
RUN apt-get update -qq && apt-get install -y build-
essential libpq-dev
RUN mkdir -p /opt/web
WORKDIR /tmp
ADD Gemfile /tmp/
ADD Gemfile.lock /tmp/
RUN bundle install
ADD . /opt/web
WORKDIR /opt/web
Docker Compose
Define and run multi-container applications:
1. Define app environment with Dockerfile
2. Define services that make up your app in
docker-compose.yml
3. Run docker-compose up to start and run
entire app
docker-compose.yml
proxy:
build: ./proxy
ports:
- "80:80"
links:
- web
web:
build: ./web
command: bundle exec rails server -b 0.0.0.0
environment:
- SECRET_KEY_BASE=secretkey
expose:
- "3000"
Amazon ECS CLI
• Easily create Amazon ECS clusters &
supporting resources such as EC2 instances
• Run Docker Compose configuration files on
Amazon ECS
Amazon ECS CLI
> ecs-cli configure
> ecs-cli compose build
> ecs-cli compose up --local
It’s Dem-o-clock!
Stage 2 - Build
Build environment
Build
environment
Partners
Jenkins
• Extensible
• Flexible builds
• Ant or Maven based projects
• Docker images
• Optionally runs in Docker container
CloudBees Docker Build and Publish plugin
Amazon EC2 Container Registry
• Private Docker Repository
• v2 Docker Registry
• AWS Identity and Access Management
(IAM) and AWS Auth integration
• Low latency push, pulls, and inspection
• Alternatives:
• DockerHub
• Docker Trusted Registry
Stage 3 - Test
Test environment
Test
environment
rspec and capybara-webkit
require 'rails_helper.rb'
feature 'Signing in' do
scenario 'can sign in' do
visit '/users/sign_in'
within("#new_user") do
fill_in 'Email', :with => 'test@test.com'
fill_in 'Password', :with => 'password'
end
click_button 'Log in'
expect(page).to have_content('Signed in successfully.')
end
end
Jenkins
• Run tests directly via Docker run
• Run tests in a Docker slave on Amazon ECS
CloudBees Jenkins ECS plugin
Jenkins slave Dockerfile
FROM jenkinsci/jnlp-slave
USER root
RUN apt-get update -qq && 
apt-get install -y -qq git curl wget build-essential […]
RUN apt-get install -y qt5-default libqt5webkit5-dev
RUN apt-get install -y xvfb x11-xkb-utils xfonts-100dpi xfonts-
75dpi xfonts-scalable xfonts-cyrillic x11-apps
ENV RUBY_VERSION 2.2.2
RUN echo 'gem: --no-document' >> /usr/local/etc/gemrc &&
mkdir /src && cd /src && git clone
https://github.com/sstephenson/ruby-build.git &&
cd /src/ruby-build && ./install.sh &&
cd / && rm -rf /src/ruby-build && ruby-build $RUBY_VERSION
Jenkins slave Dockerfile
RUN gem update --system && gem install bundler
# Install Gems
WORKDIR /tmp
ADD Gemfile /tmp/
ADD Gemfile.lock /tmp/
RUN bundle install
USER jenkins
It’s Dem-o-clock!
Stage 4 - Deploy
Deployment environment
Deployment
environment
Amazon ECS CLI
> ecs-cli up
> ecs-cli compose up
> ecs-cli ps
AWS Elastic Beanstalk
• Deploy and manage applications without
worrying about the infrastructure
• AWS Elastic Beanstalk manages your database,
Elastic Load Balancing (ELB), Amazon ECS
cluster, monitoring, and logging
• Docker support
• Single container (on Amazon EC2)
• Multi container (on Amazon ECS)
Putting it all together
Putting it all together
Orchestration
layer
AWS CodePipeline
Model and automate your software release
processes
• Rapid delivery
• Configurable workflow
• Customizable
• Highly integrated
It’s Dem-o-clock!
Takeaways
• Use Amazon ECS CLI to run application
• Run Jenkins jobs in containers
• Let AWS CodePipeline orchestrate your pipeline
Yaniv Donenfeld
TurboCharge Your Continuous Delivery
Pipeline with Containers
donenfel@amazon.com

Más contenido relacionado

La actualidad más candente

(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
Amazon Web Services
 
如何無痛上雲端? 以Elastic Beanstalk Java Container為例
如何無痛上雲端? 以Elastic Beanstalk Java Container為例如何無痛上雲端? 以Elastic Beanstalk Java Container為例
如何無痛上雲端? 以Elastic Beanstalk Java Container為例
Yuen-Kuei Hsueh
 
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Amazon Web Services
 

La actualidad más candente (20)

Docker and java
Docker and javaDocker and java
Docker and java
 
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
(DVO305) Turbocharge YContinuous Deployment Pipeline with Containers
 
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice(CMP406) Amazon ECS at Coursera: A general-purpose microservice
(CMP406) Amazon ECS at Coursera: A general-purpose microservice
 
Advanced Container Management and Scheduling
Advanced Container Management and SchedulingAdvanced Container Management and Scheduling
Advanced Container Management and Scheduling
 
AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)
 
(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale(CMP302) Amazon ECS: Distributed Applications at Scale
(CMP302) Amazon ECS: Distributed Applications at Scale
 
AWS November Webinar Series - From Local Development to Production Using the ...
AWS November Webinar Series - From Local Development to Production Using the ...AWS November Webinar Series - From Local Development to Production Using the ...
AWS November Webinar Series - From Local Development to Production Using the ...
 
Scheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECSScheduling Containers on Amazon ECS
Scheduling Containers on Amazon ECS
 
Getting Started with Docker On AWS
Getting Started with Docker On AWSGetting Started with Docker On AWS
Getting Started with Docker On AWS
 
DevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous DeliveryDevOps On AWS - Deep Dive on Continuous Delivery
DevOps On AWS - Deep Dive on Continuous Delivery
 
Version Control ThinkVitamin
Version Control ThinkVitaminVersion Control ThinkVitamin
Version Control ThinkVitamin
 
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
(DEV302) Hosting ASP.Net 5 Apps in AWS with Docker & AWS CodeDeploy
 
Amazon ECS Container Service Deep Dive
Amazon ECS Container Service Deep DiveAmazon ECS Container Service Deep Dive
Amazon ECS Container Service Deep Dive
 
Amazon Web Services EC2 Container Service (ECS)
Amazon Web Services EC2 Container Service (ECS)Amazon Web Services EC2 Container Service (ECS)
Amazon Web Services EC2 Container Service (ECS)
 
Serverless Apps with Open Whisk
Serverless Apps with Open Whisk Serverless Apps with Open Whisk
Serverless Apps with Open Whisk
 
Building A CICD Pipeline for Deploying to Containers
Building A CICD Pipeline for Deploying to ContainersBuilding A CICD Pipeline for Deploying to Containers
Building A CICD Pipeline for Deploying to Containers
 
如何無痛上雲端? 以Elastic Beanstalk Java Container為例
如何無痛上雲端? 以Elastic Beanstalk Java Container為例如何無痛上雲端? 以Elastic Beanstalk Java Container為例
如何無痛上雲端? 以Elastic Beanstalk Java Container為例
 
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
Managing Docker & ECS Based Applications with AWS Elastic Beanstalk - DevDay ...
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...
 
Building a CI/CD Pipeline for Containers - DevDay Los Angeles 2017
Building a CI/CD Pipeline for Containers - DevDay Los Angeles 2017Building a CI/CD Pipeline for Containers - DevDay Los Angeles 2017
Building a CI/CD Pipeline for Containers - DevDay Los Angeles 2017
 

Destacado

Destacado (8)

3 Secrets to Becoming a Cloud Security Superhero
3 Secrets to Becoming a Cloud Security Superhero 3 Secrets to Becoming a Cloud Security Superhero
3 Secrets to Becoming a Cloud Security Superhero
 
AWS APAC Webinar Week - Launching Your First Big Data Project on AWS
AWS APAC Webinar Week - Launching Your First Big Data Project on AWSAWS APAC Webinar Week - Launching Your First Big Data Project on AWS
AWS APAC Webinar Week - Launching Your First Big Data Project on AWS
 
Real-time Analytics with Open-Source
Real-time Analytics with Open-SourceReal-time Analytics with Open-Source
Real-time Analytics with Open-Source
 
Amazon QuickSight
Amazon QuickSightAmazon QuickSight
Amazon QuickSight
 
AWS Customer Presentation: Coca Cola Turkey migrates SAP ERP to AWS-SAPPHIRE ...
AWS Customer Presentation: Coca Cola Turkey migrates SAP ERP to AWS-SAPPHIRE ...AWS Customer Presentation: Coca Cola Turkey migrates SAP ERP to AWS-SAPPHIRE ...
AWS Customer Presentation: Coca Cola Turkey migrates SAP ERP to AWS-SAPPHIRE ...
 
TCS: Leveraging AWS for SAP on Oracle implementations
TCS: Leveraging AWS for SAP on Oracle implementationsTCS: Leveraging AWS for SAP on Oracle implementations
TCS: Leveraging AWS for SAP on Oracle implementations
 
AWS May 2016 Webinar Series - AWS Services Overview
AWS May 2016 Webinar Series - AWS Services OverviewAWS May 2016 Webinar Series - AWS Services Overview
AWS May 2016 Webinar Series - AWS Services Overview
 
1. 利用微服務架構建立雲端影音平台 (Building Media Platform by Microservices Architecture)
1.	利用微服務架構建立雲端影音平台 (Building Media Platform by Microservices Architecture)1.	利用微服務架構建立雲端影音平台 (Building Media Platform by Microservices Architecture)
1. 利用微服務架構建立雲端影音平台 (Building Media Platform by Microservices Architecture)
 

Similar a TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft

Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 

Similar a TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft (20)

Continuous Delivery to Amazon ECS - AWS August Webinar Series
Continuous Delivery to Amazon ECS - AWS August Webinar SeriesContinuous Delivery to Amazon ECS - AWS August Webinar Series
Continuous Delivery to Amazon ECS - AWS August Webinar Series
 
Continuous Delivery to Amazon EC2 Container Service
Continuous Delivery to Amazon EC2 Container ServiceContinuous Delivery to Amazon EC2 Container Service
Continuous Delivery to Amazon EC2 Container Service
 
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
컴퓨팅 서비스 업데이트 - EC2, ECS, Lambda (김상필) :: re:Invent re:Cap Webinar 2015
 
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
GlobalAzureBootCamp 2018
GlobalAzureBootCamp 2018GlobalAzureBootCamp 2018
GlobalAzureBootCamp 2018
 
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
Day 3 - DevOps Culture - Continuous Integration & Continuous Deployment on th...
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeSession Slides from DEVintersection Europe
Session Slides from DEVintersection Europe
 
My session slides from unityConnect 2016 in Haarlem
My session slides from unityConnect 2016 in HaarlemMy session slides from unityConnect 2016 in Haarlem
My session slides from unityConnect 2016 in Haarlem
 
Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura Frank
 
Building Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with DockerBuilding Efficient Parallel Testing Platforms with Docker
Building Efficient Parallel Testing Platforms with Docker
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...
Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...
Moving to Containers: Building with Docker and Amazon ECS - CON310 - re:Inven...
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
DevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm WebinarDevOps with Azure, Kubernetes, and Helm Webinar
DevOps with Azure, Kubernetes, and Helm Webinar
 

Más de Amazon 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 AWS
Amazon 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 Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon 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
 

Más 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
 

Último

Último (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

TurboCharge Your Continuous Delivery Pipeline with Containers - Pop-up Loft

Notas del editor

  1. In this session we want to highlight how containers can help you deliver high quality software. We will dive deep into a set of tools that you can use to apply the concepts we’ll describe today. And, of course, this wouldn’t be complete if we wouldn’t show you how to actually do it, so we’ll have few demos along the way. So, let’s get going!
  2. I believe you are all familiar with the benefits of using containers, but here’s a quick refresher. Containers are similar to hardware virtualization (like EC2), however instead of partitioning a machine, containers isolate the processes running on a single operating system. Containers are portable, a container image is consistent and immutable -- no matter where I run it, or when I start it, it’s the same. Containers start quickly because the operating system is already running, but they also improve the speed of dev process. Finally, containers are efficient. You can allocate exactly the resources you want – specific cpu, ram, disk, network. Since it shares the same OS kernel & libs, containers use less resources than running the same processes on different virtual machines (different way to get isolation)
  3. That’s great, but how can containers actually help for CD? Continuous delivery is all about reducing risk and delivering value faster by producing reliable software in short iterations. That means that your software is deployable throughout its lifecycle, it means that you can get fast and automated feedback on the production readiness of their software whenever you make some changes, and it means that you can perform push-button deployments of any version of the software to any environment. Containers reduce the risk of introducing errors as they provide a consistent and predictable environment throughout the software lifecycle and given their lightweight they can increase speed and agility.
  4. As we said earlier, throughout the session we’ll be showing few demos. We will be using a sample RoR application (an Instagram clone) fronted by a Nginx proxy, both running in Docker containers. The app will also be using a PostgreSQL database on Amazon RDS.
  5. …. Amazon EC2 Container Service. Amazon ECS is a scalable container management service, doesn’t matter if you want to run 10s or 1000s of containers, Amazon ECS will seamlessly scale and provide consistent performance. ECS provides a set of schedulers that can be used to place containers on the cluster, but it also exposes the cluster state through a set of APIs that would allow you to create your own scheduler. ECS is also highly integrated with other AWS Service, e.g. ELB, CloudWatch. Just a quick reminder of some core concepts of ECS: a cluster is a set of resources, container instances are EC2 instances with ECS agent, task definition defines what containers, what resources and task ins an instance of a def.
  6. For such an application, this is what the dev/deployment workflow would typically look like: Devs write code on their machine and Push changes to Code repository Push triggers a build, artifacts are build Test are run, if all green… New version is deployed in prod Orchestration tool that is the brain, knows how to move the code/build from one stage to the next one We’ll now dive deep into each stage and explore where and how containers can be used.
  7. The first step of a development process is the source code.
  8. This would be your local development machine. You write some code, test it locally, make some more changes. Once you’re happy with your changes you will push them to a code repository. This can be a distributed system, so multiple devs on the same team can work on the same project. What tools do we need to achieve this?
  9. Let’s start with the code repo, and the tool we’d like to highlight here is AWS CodeCommit, a fully managed git repo. This means you don’t need to host, maintain, back up, and scale your own source control servers. CodeCommit also encrypts your files in transit and at rest to provide a secure solution and thanks to the integration with AWS Identity and Access Management (IAM) you can assign user-specific permissions to your repositories. Last but not least, CodeCommit is designed to keep your repositories highly available and accessible. There are other tools available that can provide similar functionalities, such as Github or Bitbucket. For our demo, we’ll be using Github.
  10. When we talk about containers, we refer more and more often to Docker containers. Docker is available for different Linux distro with a recent kernel and on Mac and Windows through Docker toolbox. With Docker we can define the environment our application will be executed in and specify any additional dependency using a Dockerfile.
  11. In this example, we start from a Ruby base image and install some additional packages using the OS package manager. We then specify our app specific dependencies using a Gemfile and finally we copy our source code. This Dockerfile can now be used to build an image we can use to run our containers, and we can use the same image throughout the different lifecycle stages.
  12. One of the interesting things about Docker, it’s its growing tools ecosystem. One of them, Docker Compose, allows you to run complex applications that can include different components. You simply have to define each component env with a Dockerfile, specify how the components make up your application in a docker-compose yaml file and finally with a simple command, docker-compse up, you’ll be able to run all the services included in your app.
  13. Here we have a sample docker-compose yaml file with two service: a proxy and a web app. The proxy service is built from the Dockerfile in the the proxy directory, it exposes port 80 on the container to port 80 on the host and it’s linked to the web service (this will allow us to refer to the web service container as ‘web’ from the proxy service container). The web container is also built from a Dockerfile, in the web direcotry, it’s a Rails app so we specify the command we want to be executed and it exposes port 3000 to any linked services, not on the host machine.
  14. If are already using Compose, you’ll be glad to hear that, as announced earlier today, we now have a tool that will allow you to run your application both locally and on an ECS cluster using the same docker-compse yaml file: the Amazon ECS CLI. With the ECS CLI you’ll be able to run the same Docker compose commands in your local environmetn and up, start, stop, and ps on Amazon ECS. The Amazon ECS CLI is available today for your to download and it’s open source, so we’d like to see you getting involved.
  15. Init configures the cli, similar to ‘eb init’ Compose up –local runs on dev machine
  16. Let’s switch to the demo and see these tools in action!
  17. Backup video
  18. Backup video
  19. Now that we made some changes to our code, let’s have a look at the setup we have to build the new artifacts.
  20. At this stage, containers will be used in two ways: to provide an execution environment for the build jobs and as an output of the build process itself. We’ll see how we can run our builds on an ECS cluster, but also how to produce container images that can then be used throughout the rest of the workflow.
  21. Some of our partners have created integrated CD solutions with Amazon ECS. For this talk and demo we’ll be focusing on one of these solutions, Jenkins.
  22. One tool that is frequently used for builds is Jenkins. Jenkins is an open tool that can easily be extended using plugins, it provides a flexible environment to build your Ant or Maven based project, but also, and this quite interesting for us, it can be used to build Docker images. Not only that, but you can have Jenkins itself running inside a Docker container, so you can have your whole CD workflow containerized.
  23. A Jenkins plugin we want to highlight is the CloudBees Docker Build and Publish plugin. This is what we use to build our container images and push them to a Docker Registry. We simply have to specify the repository name we want to push the image to, a tag for it – in this case we tag it using the Jenkins build number – and the registry we want to use. For our demo we will use Dockerhub. Here we are using the ….
  24. …. Amazon EC2 Container Registry -- announced and available later this year -- sign up if you're interested. By using Amazon EC2 Container Registry you can use the familiar Docker CLI commands to push, pull, and manage your images. The service provides all of the benefits of the AWS ecosystem including fine-grained access controls through IAM Policies, CloudTrail logging for auditing, and seamless integration with Amazon EC2 Container Service.
  25. Once our build is complete, we are ready to run some tests
  26. We will take our rspec tests and turn them into acceptance tests that we can run against a live endpoint using a gem called capybara-webkit. Working with this gem requires you to install some tricky dependencies, including qt, qt-webkit, and the headless x server xvfb. Fortunately thanks to Docker we can encapsulate all of these into a container that can be run anywhere.
  27. To fit our tests into our CD pipeline we need a test driver. Again we turn to Jenkins to execute our tests.
  28. As we start building more tests, the time taken to execute them will become large enough that we’ll want to distribute their execution across many machines. ECS can help here. With the Cloudbees Jenkins ECS plugin, you’re also able to run your test jobs on an Amazon ECS cluster. This plugin will simply connect to your ECS cluster, create a new task definition for your test job, start a new task, and tear everything down when the test completes.
  29. This is the Dockerfile that sets up our jenkins slave and that we’ll use to run our tests.
  30. This is the Dockerfile that sets up our jenkins slave and that we’ll use to run our tests.
  31. Backup video
  32. We’ll get back to our demo in a short while.
  33. Now that we have the build and test stage cover, all is left to do is actually deploy our new version to our production env. We will deploy our application to…
  34. As mentioned earlier, with the Amazon ECS CLI, you are able to run your application both locally and on ECS using the same docker-compse yaml file. Here to run our app on the ECS cluster we simply use the ‘ecs compose up’ command and this will convert the docker-compose yaml into an ECS task definition and run a task with that def. We can also inspect what containers are running using the ‘ecs’ compose ps’ command. Note that here we didn’t use the –local option.
  35. AWS CodeDeploy …fully automates your code deployments, allowing you to deploy reliably and rapidly. You can consistently deploy your application across your development, test, and production ... helps maximize your application availability during the software deployment process. It peforms rolling updates across your instances and tracks application health according to configurable rules … is platform and language agnostic and works with any application. You can easily reuse your existing setup code. CodeDeploy can also integrate with your existing software release process or continuous delivery toolchain (e.g., Jenkins). CodeDeploy can be used to deploy to ECS using a shell script…
  36. An easy way to deploy Docker containers within a pipeline is using AWS Elastic Beanstalk. Beanstalk supports a single container deployment directly on an EC2 instance and multi-container deployment on ECS. The benefits of Beanstalk is that it can manage your resources: your DB, ELB, ECS cluster and it also provides monitoring and logging for your app. It’s also easy to set up multiple environments within one application so you can have an integ stack that is similar to your production stack. Elastic Beanstalk is ideal if you want to leverage the benefits of containers but just want the simplicity of deploying applications from development to production by uploading a container image. You can work with Amazon ECS directly if you want more fine-grained control for custom application architectures.
  37. The final piece of our workflow is an orchestration tool…
  38. … that knows how to get the code from the code repo, build our artifacts, test them and deploy. This tool is….
  39. …AWS CodePipeline. With CodePipeline you can automate your software release process, allowing you to release new features to users very quickly. You can also model the different stages of your software release process with a graphical interface and by running each change through your standardized release process you can assure the quality of your code.
  40. Let’s now see how all these tools and services work together end-to-end
  41. Backup video
  42. Finally, a few things you might want to take with you from this session: use the ECS CLI to run your app locally and ECS, especially if already using Docker Compose. Make your build environment hihgly scalable by running build jobs in containers and finally, let codePipeline orchestrate your workflow.