SlideShare uma empresa Scribd logo
1 de 67
Baixar para ler offline
Building Efficient Parallel
Testing Platforms with Docker
Laura Frank @rhein_wein
Software Engineer @codeship
laura@codeship.com
Automated builds take too long.
PROBLEM
laurel comics
Optimize automated tests by running
them in parallel.
PROPOSED SOLUTION
You’ll quickly reach the limit of how much
you can optimize a test itself.
PROPOSED SOLUTION
Instead, let’s build a more
performant system.
PROPOSED SOLUTION
And let’s do it with containers 💃
PROPOSED SOLUTION
Create a customizable, flexible test
environment that enables us to run
tests in parallel.
GOAL
codeship.com/resources
• The why and how of parallel testing
• DIY with LXC
• Using Docker and the Docker ecosystem
Agenda
ParallelTesting
Spend less time waiting around for your automated
testing steps and deployments to finish.
• Ship newest code to production faster
• Be alerted quickly when tests fail
Why?
If you’re still not sure why testing is important… let’s
have a different conversation. 😊
Developers should have full autonomy over testing
environments, and the way tests are executed.
• Move testing commands to separate pipelines
• Designate commands to be run serially or in parallel
• Declare specific dependencies for each service
Why?
• For local testing, e.g. unit and integration tests run
by a development team
• On internal CI/CD systems
• As part of a hosted CI/CD solution (like Codeship)
Where?
• Split up testing tasks
• Give developer full control of dependencies per task
• Use containers to run multiple tests at once
How?
Run tasks across multiple
processors in parallel
computing environments
TASK PARALLELISM
Distributed Task Parallelism
A distributed system of containerized
computing environments takes the place
of a single multiprocessor machine
A container is a process, not a small VM
Why not VMs?
• Isolation of running builds on infrastructure
• Challenges with dependency management
• No clean interface for imposing resource limits
• Infrastructure is underutilized which makes it
expensive
• People use containers!
Containers, duh!
• Impose resource limits and increase virtualization density
• Run customer code in isolation
• Provide consistent build environment across many build runs
• Run testing tasks in parallel 👍
DIYwith LXC
Codeship has been powered
by containers since the
very beginning
codeship.com/resources
Codeship’s LXC-based Platform
40K builds per day
8M builds per year
Architecture
• Universal container with provided dependencies
• Fixed amount of available containers per VM
• Implement parallel testing pattern using
pipelines with ParallelCI
• Users can have N pipelines running in isolation
during a build
User Commands
Universal Container
Pipeline
Heroku
Deployment Provider
Capistrano
AppEngine
Elastic Beanstalk
etc…
User Commands
Universal Container
Pipeline
User Commands
Universal Container
Pipeline
High-level Build Workflow
test pipelines deploy pipeline
commit deploy
Not just a test runner, but a complete system
build worker
build dispatcher
account/project service
infrastructure service
new code!
build worker
build dispatcher
• receives webhooks
• transforms payload (keep the good bits)
• send payload to account/project service
• read config and start workload
• sends updates upstream
account/project service
• receives payload
• identifies build configuration
• sends config to build machines
infrastructure service
• keep track of infra utilization
• upscale/downscale
worker
Compute Instance
container container
container container
container container
container container
container container
worker
Compute Instance
container container
container container
container container
container container
container container
worker
Compute Instance
container container
container container
container container
container container
container container
worker
Compute Instance
container container
container container
container container
container container
container container
worker
Compute Instance
container container
container container
container container
container container
container container
worker
Compute Instance
container container
container container
container container
container container
container container
Good Stuff
• Extremely simple implementation (no extra scheduler)
• Just Works™
• Pretty okay virtualization density
• No allocation time for builds — slots are always open
Not So Good Stuff
• Parity between dev and test
• Can’t really debug locally
• No useable interface between user and container
• All pipelines run all services and dependencies
We weren’t able to provide the
best, most efficient product to our
customers (or ourselves)
ParallelTestingwith Docker 👌
Create a customizable, flexible test
environment that enables us to run
tests in parallel
GOAL
Big Wins with Docker
Even before 1.0, Docker was a clear choice
• Support and tooling
• Standardization
• Community of motivated developers
Using Docker allowed us
to build a much more flexible testing
platform than with LXC alone
A Docker-based Testing Platform
• Different enough from the LXC-based platform to be
a new tool
• Development started in 2014, beta in 2015
• Official launch February 2016
• Written in golfing (LXC-based platform is in Ruby)
Managing containers with
Docker allowed us to improve our
parallel testing workflow
A New Parallel Workflow
• Introducing services adds additional layer of flexibility
• Loosen coupling between steps and services — execute
N steps against M services
• Parallel and serial steps can be grouped and ordered in
any way
Services
• Pull image from any registry or build from Dockerfile
• Optimize service for testing tasks
• Fully customizable by the user
Steps
• Each step is executed in an independent environment
• Has own set of containers (services)
• Can be nested in serial and parallel groups
Steps
• Two functions
• Run: execute a command against a service
• Push: push image to registry
• Tag matching (simple string or regex) to run steps on
certain branches or tagged releases
T1 T1 T1
User Commands
Universal Container
Pipeline
User Commands
Universal Container
Pipeline
User Commands
Universal Container
Pipeline
High-Level Build Workflow: The “Old” Way
Step
postgres
redis
command
web
Step
command
ruby
T1 T2 T3
Step
postgres
redis
command
web
Step
postgres
redis
command
web
High-Level Build Workflow: The New Way
build worker
build dispatcher
account/project service
build orchestrator
new code!
SQS queue
build worker
build dispatcher
• receives webhooks
• transforms payload (keep the
good bits)
• send payload to central service
• run build steps and services via Docker
• sends updates upstream
account/project service
• identifies build configuration
build orchestrator
• build machine allocation and provisioning
• handles logs
• starts build and sends config to build
machines
SQS queue
Compute Instance
build processor
Step
container
container
container
Step
container
container
container
Step
container
container
container
Compute Instance
build processor
Step
container
container
container
Step
container
container
container
Step
container
container
container
Docker WorkflowTools
• Docker Compose: service and step definition syntax
• Docker Registry: storage for images; previously used
for remote caching
• Docker for Mac and Windows: give users ability to
reproduce CI environments locally
services.yml
db:
image: postgres:9.5
app:
encrypted_dockercfg_path: dockercfg.encrypted
build:
image: user/some-image
dockerfile: Dockerfile.test
cached: true
links:
- db
deploy:
encrypted_dockercfg_path: dockercfg.encrypted
build:
dockerfile: Dockerfile.deploy
- type: serial
steps:
- type: parallel
steps:
- name: rspec
service: app
command: bin/ci spec
- name: rubocop
service: app
command: rubocop
- name: haml-lint
service: app
command: haml-lint app/views
- name: rails_best_practices
service: app
command: bin/railsbp
- service: deploy
type: push
image_name: rheinwein/notes-app
tag: ^master$
registry: https://index.docker.io/v1/
encrypted_dockercfg_path: dockercfg.encrypted
1
2
steps.yml
Docker for Mac and Windows
• All users can test locally
• Jet CLI is available at bit.ly/codeship-jet-tool
• Free, and you don’t need a Codeship account
• Big advantage over the LXC implementation
codeship.com/resources
Your push or deploy step should
never be part of a parallel step group
PRO TIP
Technical Difficulties
Infrastructure
• Build allocation
• Customers can choose specs for their build machines
• Machine provisioning used to be part of the build process
• Now we pool build machines
• Allocation time is ~1 second!
Performance
• Image Caching
• Old way: rely on the registry for caching
• A pull gave us access to each parent layer; rebuilding the image
used the local cache
• 1.10 content addressable breaking change
Performance
• Image Caching
• Great news: 1.11 restored parent/child relationship when you
save the images via docker save
• 1.13 will include --cache-from flag
• Double-edged sword of relying on external tools ¯_( )_/¯
What’s Missing?
libcompose
• Currently use APIs directly for container-level operations
(Jet was also born before Fig was popular)
• Minimal change for our users and builds, but much
easier for our engineers
• Work is underway 🐳
Compose V2 syntax
• Will come with libcompose
Swarm!
• Jet was born pre-Swarm
• We manage build machines on AWS via our
own service
• Previous concerns about security — single tenancy
• Swarm (and services like Carina) are
promising for the future
Swarm!
• Instead of using a single machine per build, we should
schedule containers across a cluster
• Use the best parts of the LXC platform, but with Docker
behind it
codeship.com/resources
You can create a highly efficient
parallel testing platform with LXC
alone, but using Docker tools
makes it more flexible
TL;DR
Wednesday — October 5th
How Secure is your Container? A Docker Engine Security Update - Phil Estes
Docker Orchestration: Beyond the Basics - Aaron Lehmann
When the Going gets Tough, get TUF Going - Riyaz Faizullabhoy and Lily Guo
Thursday — October 6th
Orchestrating Linux Containers while Tolerating Failures - Drew Erny
Unikernels: When you Should and When you Shouldn’t - Amir Chaudhry
Berlin Docker Meetup
thanks!

Mais conteúdo relacionado

Mais procurados

An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesSteffen Gebert
 
Node.js Rocks in Docker for Dev and Ops
Node.js Rocks in Docker for Dev and OpsNode.js Rocks in Docker for Dev and Ops
Node.js Rocks in Docker for Dev and OpsBret Fisher
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSBamdad Dashtban
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Michal Ziarnik
 
DockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDocker, Inc.
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...All Things Open
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineSlawa Giterman
 
Docker SF Meetup January 2016
Docker SF Meetup January 2016Docker SF Meetup January 2016
Docker SF Meetup January 2016Patrick Chanezon
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Edureka!
 
Automate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsAutomate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsDaniel Oh
 
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena TapiaFrom Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena TapiaDocker, Inc.
 
Docker Meetup 08 03-2016
Docker Meetup 08 03-2016Docker Meetup 08 03-2016
Docker Meetup 08 03-2016Docker
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Steffen Gebert
 
DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith  DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith Docker, Inc.
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationOleg Nenashev
 
Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker ImagesBrian DeHamer
 

Mais procurados (20)

An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins PipelinesAn Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
An Open-Source Chef Cookbook CI/CD Implementation Using Jenkins Pipelines
 
Node.js Rocks in Docker for Dev and Ops
Node.js Rocks in Docker for Dev and OpsNode.js Rocks in Docker for Dev and Ops
Node.js Rocks in Docker for Dev and Ops
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
 
Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2Pipeline as code - new feature in Jenkins 2
Pipeline as code - new feature in Jenkins 2
 
DockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @OrbitzDockerCon SF 2015: Enabling Microservices @Orbitz
DockerCon SF 2015: Enabling Microservices @Orbitz
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...
 
2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro
 
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 PipelineDelivery Pipeline as Code: using Jenkins 2.0 Pipeline
Delivery Pipeline as Code: using Jenkins 2.0 Pipeline
 
Docker SF Meetup January 2016
Docker SF Meetup January 2016Docker SF Meetup January 2016
Docker SF Meetup January 2016
 
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
Jenkins Pipeline Tutorial | Continuous Delivery Pipeline Using Jenkins | DevO...
 
Automate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOpsAutomate App Container Delivery with CI/CD and DevOps
Automate App Container Delivery with CI/CD and DevOps
 
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena TapiaFrom Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
From Zero Docker to Hackathon Winner - Marcos Lilljedahl and Jimena Tapia
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker Meetup 08 03-2016
Docker Meetup 08 03-2016Docker Meetup 08 03-2016
Docker Meetup 08 03-2016
 
7+1 myths of the new os
7+1 myths of the new os7+1 myths of the new os
7+1 myths of the new os
 
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
Jenkins vs. AWS CodePipeline (AWS User Group Berlin)
 
DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith  DCSF19 CMD and Conquer: Containerizing the Monolith
DCSF19 CMD and Conquer: Containerizing the Monolith
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
 
Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker Images
 

Semelhante a Building Efficient Parallel Testing Platforms with Docker

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)Amazon Web Services
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realistsKarthik Gaekwad
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for RealistsOracle Developers
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realistsKarthik Gaekwad
 
Session Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeSession Slides from DEVintersection Europe
Session Slides from DEVintersection EuropeRick Van Rousselt
 
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 HaarlemRick Van Rousselt
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...E. Camden Fisher
 
A Tail of Two Containers: How docker made ci great again
A Tail of Two Containers: How docker made ci great againA Tail of Two Containers: How docker made ci great again
A Tail of Two Containers: How docker made ci great againKyle Rames
 
SharePoint Saturday Cambridge 2016 Session
SharePoint Saturday Cambridge 2016 SessionSharePoint Saturday Cambridge 2016 Session
SharePoint Saturday Cambridge 2016 SessionRick Van Rousselt
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerWeb à Québec
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KuberneteszekeLabs Technologies
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterpriseBert Poller
 
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsNordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsTravis Wright
 
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker, Inc.
 
Continuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket PipelinesContinuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket PipelinesAtlassian
 

Semelhante a Building Efficient Parallel Testing Platforms with Docker (20)

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)
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
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
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
A Tail of Two Containers: How docker made ci great again
A Tail of Two Containers: How docker made ci great againA Tail of Two Containers: How docker made ci great again
A Tail of Two Containers: How docker made ci great again
 
SharePoint Saturday Cambridge 2016 Session
SharePoint Saturday Cambridge 2016 SessionSharePoint Saturday Cambridge 2016 Session
SharePoint Saturday Cambridge 2016 Session
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
From Heroku to Amazon AWS
From Heroku to Amazon AWSFrom Heroku to Amazon AWS
From Heroku to Amazon AWS
 
Rami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with DockerRami Sayar - Node microservices with Docker
Rami Sayar - Node microservices with Docker
 
A curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & KubernetesA curtain-raiser to the container world Docker & Kubernetes
A curtain-raiser to the container world Docker & Kubernetes
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Docker for the enterprise
Docker for the enterpriseDocker for the enterprise
Docker for the enterprise
 
ASP.NET vNext
ASP.NET vNextASP.NET vNext
ASP.NET vNext
 
Nordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOpsNordic infrastructure Conference 2017 - SQL Server in DevOps
Nordic infrastructure Conference 2017 - SQL Server in DevOps
 
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC WongDocker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
 
Continuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket PipelinesContinuous Delivery in the Cloud with Bitbucket Pipelines
Continuous Delivery in the Cloud with Bitbucket Pipelines
 

Mais de Laura Frank Tacho

Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For DevelopmentLaura Frank Tacho
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSLaura Frank Tacho
 
Scalable and Available Services with Docker and Kubernetes
Scalable and Available Services with Docker and KubernetesScalable and Available Services with Docker and Kubernetes
Scalable and Available Services with Docker and KubernetesLaura Frank Tacho
 
SwarmKit in Theory and Practice
SwarmKit in Theory and PracticeSwarmKit in Theory and Practice
SwarmKit in Theory and PracticeLaura Frank Tacho
 
Everything You Thought You Already Knew About Orchestration
Everything You Thought You Already Knew About OrchestrationEverything You Thought You Already Knew About Orchestration
Everything You Thought You Already Knew About OrchestrationLaura Frank Tacho
 

Mais de Laura Frank Tacho (7)

The Container Shame Spiral
The Container Shame SpiralThe Container Shame Spiral
The Container Shame Spiral
 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For Development
 
Deploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKSDeploying a Kubernetes App with Amazon EKS
Deploying a Kubernetes App with Amazon EKS
 
Scalable and Available Services with Docker and Kubernetes
Scalable and Available Services with Docker and KubernetesScalable and Available Services with Docker and Kubernetes
Scalable and Available Services with Docker and Kubernetes
 
SwarmKit in Theory and Practice
SwarmKit in Theory and PracticeSwarmKit in Theory and Practice
SwarmKit in Theory and Practice
 
Everything You Thought You Already Knew About Orchestration
Everything You Thought You Already Knew About OrchestrationEverything You Thought You Already Knew About Orchestration
Everything You Thought You Already Knew About Orchestration
 
Happier Teams Through Tools
Happier Teams Through ToolsHappier Teams Through Tools
Happier Teams Through Tools
 

Último

Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptxFIDO Alliance
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxFIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxjbellis
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewDianaGray10
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024Lorenzo Miniero
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Paige Cruz
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Skynet Technologies
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 

Último (20)

Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 
WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024WebRTC and SIP not just audio and video @ OpenSIPS 2024
WebRTC and SIP not just audio and video @ OpenSIPS 2024
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
Human Expert Website Manual WCAG 2.0 2.1 2.2 Audit - Digital Accessibility Au...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 

Building Efficient Parallel Testing Platforms with Docker

  • 1. Building Efficient Parallel Testing Platforms with Docker Laura Frank @rhein_wein Software Engineer @codeship laura@codeship.com
  • 2.
  • 3. Automated builds take too long. PROBLEM
  • 5. Optimize automated tests by running them in parallel. PROPOSED SOLUTION
  • 6. You’ll quickly reach the limit of how much you can optimize a test itself. PROPOSED SOLUTION
  • 7. Instead, let’s build a more performant system. PROPOSED SOLUTION
  • 8. And let’s do it with containers 💃 PROPOSED SOLUTION
  • 9. Create a customizable, flexible test environment that enables us to run tests in parallel. GOAL
  • 10. codeship.com/resources • The why and how of parallel testing • DIY with LXC • Using Docker and the Docker ecosystem Agenda
  • 12. Spend less time waiting around for your automated testing steps and deployments to finish. • Ship newest code to production faster • Be alerted quickly when tests fail Why? If you’re still not sure why testing is important… let’s have a different conversation. 😊
  • 13. Developers should have full autonomy over testing environments, and the way tests are executed. • Move testing commands to separate pipelines • Designate commands to be run serially or in parallel • Declare specific dependencies for each service Why?
  • 14. • For local testing, e.g. unit and integration tests run by a development team • On internal CI/CD systems • As part of a hosted CI/CD solution (like Codeship) Where?
  • 15. • Split up testing tasks • Give developer full control of dependencies per task • Use containers to run multiple tests at once How?
  • 16.
  • 17. Run tasks across multiple processors in parallel computing environments TASK PARALLELISM
  • 18. Distributed Task Parallelism A distributed system of containerized computing environments takes the place of a single multiprocessor machine A container is a process, not a small VM
  • 19. Why not VMs? • Isolation of running builds on infrastructure • Challenges with dependency management • No clean interface for imposing resource limits • Infrastructure is underutilized which makes it expensive • People use containers!
  • 20. Containers, duh! • Impose resource limits and increase virtualization density • Run customer code in isolation • Provide consistent build environment across many build runs • Run testing tasks in parallel 👍
  • 22. Codeship has been powered by containers since the very beginning
  • 24. Architecture • Universal container with provided dependencies • Fixed amount of available containers per VM • Implement parallel testing pattern using pipelines with ParallelCI • Users can have N pipelines running in isolation during a build
  • 25. User Commands Universal Container Pipeline Heroku Deployment Provider Capistrano AppEngine Elastic Beanstalk etc… User Commands Universal Container Pipeline User Commands Universal Container Pipeline High-level Build Workflow test pipelines deploy pipeline
  • 26. commit deploy Not just a test runner, but a complete system
  • 27. build worker build dispatcher account/project service infrastructure service new code!
  • 28. build worker build dispatcher • receives webhooks • transforms payload (keep the good bits) • send payload to account/project service • read config and start workload • sends updates upstream account/project service • receives payload • identifies build configuration • sends config to build machines infrastructure service • keep track of infra utilization • upscale/downscale
  • 29. worker Compute Instance container container container container container container container container container container worker Compute Instance container container container container container container container container container container worker Compute Instance container container container container container container container container container container
  • 30. worker Compute Instance container container container container container container container container container container worker Compute Instance container container container container container container container container container container worker Compute Instance container container container container container container container container container container
  • 31. Good Stuff • Extremely simple implementation (no extra scheduler) • Just Works™ • Pretty okay virtualization density • No allocation time for builds — slots are always open
  • 32. Not So Good Stuff • Parity between dev and test • Can’t really debug locally • No useable interface between user and container • All pipelines run all services and dependencies
  • 33. We weren’t able to provide the best, most efficient product to our customers (or ourselves)
  • 35. Create a customizable, flexible test environment that enables us to run tests in parallel GOAL
  • 36. Big Wins with Docker Even before 1.0, Docker was a clear choice • Support and tooling • Standardization • Community of motivated developers
  • 37. Using Docker allowed us to build a much more flexible testing platform than with LXC alone
  • 38. A Docker-based Testing Platform • Different enough from the LXC-based platform to be a new tool • Development started in 2014, beta in 2015 • Official launch February 2016 • Written in golfing (LXC-based platform is in Ruby)
  • 39.
  • 40. Managing containers with Docker allowed us to improve our parallel testing workflow
  • 41. A New Parallel Workflow • Introducing services adds additional layer of flexibility • Loosen coupling between steps and services — execute N steps against M services • Parallel and serial steps can be grouped and ordered in any way
  • 42. Services • Pull image from any registry or build from Dockerfile • Optimize service for testing tasks • Fully customizable by the user
  • 43. Steps • Each step is executed in an independent environment • Has own set of containers (services) • Can be nested in serial and parallel groups
  • 44. Steps • Two functions • Run: execute a command against a service • Push: push image to registry • Tag matching (simple string or regex) to run steps on certain branches or tagged releases
  • 45. T1 T1 T1 User Commands Universal Container Pipeline User Commands Universal Container Pipeline User Commands Universal Container Pipeline High-Level Build Workflow: The “Old” Way
  • 47. build worker build dispatcher account/project service build orchestrator new code! SQS queue
  • 48. build worker build dispatcher • receives webhooks • transforms payload (keep the good bits) • send payload to central service • run build steps and services via Docker • sends updates upstream account/project service • identifies build configuration build orchestrator • build machine allocation and provisioning • handles logs • starts build and sends config to build machines SQS queue
  • 51. Docker WorkflowTools • Docker Compose: service and step definition syntax • Docker Registry: storage for images; previously used for remote caching • Docker for Mac and Windows: give users ability to reproduce CI environments locally
  • 52. services.yml db: image: postgres:9.5 app: encrypted_dockercfg_path: dockercfg.encrypted build: image: user/some-image dockerfile: Dockerfile.test cached: true links: - db deploy: encrypted_dockercfg_path: dockercfg.encrypted build: dockerfile: Dockerfile.deploy
  • 53. - type: serial steps: - type: parallel steps: - name: rspec service: app command: bin/ci spec - name: rubocop service: app command: rubocop - name: haml-lint service: app command: haml-lint app/views - name: rails_best_practices service: app command: bin/railsbp - service: deploy type: push image_name: rheinwein/notes-app tag: ^master$ registry: https://index.docker.io/v1/ encrypted_dockercfg_path: dockercfg.encrypted 1 2 steps.yml
  • 54. Docker for Mac and Windows • All users can test locally • Jet CLI is available at bit.ly/codeship-jet-tool • Free, and you don’t need a Codeship account • Big advantage over the LXC implementation
  • 55. codeship.com/resources Your push or deploy step should never be part of a parallel step group PRO TIP
  • 57. Infrastructure • Build allocation • Customers can choose specs for their build machines • Machine provisioning used to be part of the build process • Now we pool build machines • Allocation time is ~1 second!
  • 58. Performance • Image Caching • Old way: rely on the registry for caching • A pull gave us access to each parent layer; rebuilding the image used the local cache • 1.10 content addressable breaking change
  • 59. Performance • Image Caching • Great news: 1.11 restored parent/child relationship when you save the images via docker save • 1.13 will include --cache-from flag • Double-edged sword of relying on external tools ¯_( )_/¯
  • 61. libcompose • Currently use APIs directly for container-level operations (Jet was also born before Fig was popular) • Minimal change for our users and builds, but much easier for our engineers • Work is underway 🐳
  • 62. Compose V2 syntax • Will come with libcompose
  • 63. Swarm! • Jet was born pre-Swarm • We manage build machines on AWS via our own service • Previous concerns about security — single tenancy • Swarm (and services like Carina) are promising for the future
  • 64. Swarm! • Instead of using a single machine per build, we should schedule containers across a cluster • Use the best parts of the LXC platform, but with Docker behind it
  • 65. codeship.com/resources You can create a highly efficient parallel testing platform with LXC alone, but using Docker tools makes it more flexible TL;DR
  • 66. Wednesday — October 5th How Secure is your Container? A Docker Engine Security Update - Phil Estes Docker Orchestration: Beyond the Basics - Aaron Lehmann When the Going gets Tough, get TUF Going - Riyaz Faizullabhoy and Lily Guo Thursday — October 6th Orchestrating Linux Containers while Tolerating Failures - Drew Erny Unikernels: When you Should and When you Shouldn’t - Amir Chaudhry Berlin Docker Meetup