SlideShare a Scribd company logo
Efficient Parallel Testing with Docker
Laura
Frank
Senior Engineer, Codeship
Efficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
1. Parallel Testing: Goals and Benefits
2. DIY with LXC
3. Using Docker and the Docker Ecosystem
Agenda
Parallel Testing
Create a customizable, flexible
test environment that enables us
to run tests in parallel
GOAL
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, please talk to me at
the Codeship booth.
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?
Let’s eliminate friction in the development cycle
• 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?
Efficient Parallel Testing with Docker
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
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 👍
DIY with LXC
Codeship has been powered by
containers since the very beginning
Codeship was founded
Flowing salty water on Mars
International Year of Forests
Preparations ahead of 12.04 Precise release shipped to
support LXC improvements
Green Bay Packers won Super Bowl XLV
2011: A Brief History Lesson
I should use LXC…
Checkbot (Codeship Classic)
• Still running in production as our classic infrastructure
• Well-suited for users who want 1-click test environments
without much customization
• Compromise flexibility for ease of use
Checkbot
39K builds per day
7.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
User Commands
Universal Container
Pipeline
Heroku
Deployment Provider
Capistrano
AppEngine
Elastic Beanstalk
etc…
Limitations
• Parity between dev and test
• Can’t really debug locally
• No useable interface between user and container
• Resource consumption is too high
We weren’t able to provide the
best, most efficient product to
our customers (or ourselves)
Using Docker and the
Docker Ecosystem
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 better testing
platform than with LXC alone
Codeship Jet
A Docker-based Testing Platform
• Development started in 2014
• First beta in 2015
• Official launch February 2016
A Docker-based Testing Platform
Built with Docker
in order to support Docker workflows
Codeship Jet
2.3K builds per day
~250K total builds
Docker Workflow Tools
• Docker Compose: service and step definition syntax
• Docker Registry: storage for images; remote caching*
• Docker for Mac and Windows: give users ability to
reproduce CI environments locally
*not for long!
Efficient Parallel Testing with Docker
The workflow tools provided by
Docker are indispensable
Parallel Testing
with Docker
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
• Can be nested in serial and parallel groups
• Two functions
• Run: execute a command against a service
• Push: push image to registry
• Tag regex matching to run steps on certain branches
or tagged releases
User Commands
Universal Container
Pipeline
User Commands
Universal Container
Pipeline
User Commands
Universal Container
Pipeline
T1 T1 T1
Step
postgres
redis
command
web
Step
postgres
redis
command
web
Step
command
ruby
Step
postgres
redis
command
web
T1 T2 T3
codeship-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
codeship-steps.yml
- 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
ProTip: Your push or deploy step should
never be part of a parallel step group
Demo!
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
• HUGE advantage over our previous LXC implementation
Engineering
Challenges
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 restores parent/child relationship
when you save the images via docker save
• ETA: 1 month
• Double-edged sword of relying on external tools
¯_( )_/¯
What’s Next?
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
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
• Preliminary work has been completed 🐳
You can create a highly efficient
parallel testing platform with LXC
alone, but using Docker tools
makes it better
TL;DR
Thank you!

More Related Content

What's hot (20)

PPTX
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
Docker, Inc.
 
PPTX
Docker and stuff
Varun Sharma
 
PDF
Docker Registry V2
Docker, Inc.
 
PPTX
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
PDF
Containers in depth – Understanding how containers work to better work with c...
All Things Open
 
PPTX
Intro to Docker at the 2016 Evans Developer relations conference
Mano Marks
 
PPTX
Introduction to docker
Frederik Mogensen
 
PDF
Your Auto-Scaling Bot - Volkan Tufecki
Docker, Inc.
 
PDF
In-Cluster Continuous Testing Framework for Docker Containers
Neil Gehani
 
PDF
Docker Multi-arch All The Things
Docker, Inc.
 
PDF
Container Runtimes: Comparing and Contrasting Today's Engines
Phil Estes
 
PDF
Container orchestration from theory to practice
Docker, Inc.
 
PPTX
Docker introduction
Gourav Varma
 
PPTX
Your journey into the serverless world
Red Hat Developers
 
PPTX
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker, Inc.
 
PDF
Troubleshooting tips from docker support engineers
Docker, Inc.
 
PDF
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker, Inc.
 
PDF
Dockers and kubernetes
Dr Ganesh Iyer
 
PPTX
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Patrick Chanezon
 
PDF
Containerizing Hardware Accelerated Applications
Docker, Inc.
 
DockerCon EU 2015: Stop Being Lazy and Test Your Software!
Docker, Inc.
 
Docker and stuff
Varun Sharma
 
Docker Registry V2
Docker, Inc.
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
Simplilearn
 
Containers in depth – Understanding how containers work to better work with c...
All Things Open
 
Intro to Docker at the 2016 Evans Developer relations conference
Mano Marks
 
Introduction to docker
Frederik Mogensen
 
Your Auto-Scaling Bot - Volkan Tufecki
Docker, Inc.
 
In-Cluster Continuous Testing Framework for Docker Containers
Neil Gehani
 
Docker Multi-arch All The Things
Docker, Inc.
 
Container Runtimes: Comparing and Contrasting Today's Engines
Phil Estes
 
Container orchestration from theory to practice
Docker, Inc.
 
Docker introduction
Gourav Varma
 
Your journey into the serverless world
Red Hat Developers
 
Docker Hub: Past, Present and Future by Ken Cochrane & BC Wong
Docker, Inc.
 
Troubleshooting tips from docker support engineers
Docker, Inc.
 
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker, Inc.
 
Dockers and kubernetes
Dr Ganesh Iyer
 
Develop and deploy Kubernetes applications with Docker - IBM Index 2018
Patrick Chanezon
 
Containerizing Hardware Accelerated Applications
Docker, Inc.
 

Similar to Efficient Parallel Testing with Docker (20)

PPTX
UNITde II - Docker-Containerization.pptx,
aman0710p
 
PDF
Containers and Microservices for Realists
Oracle Developers
 
PDF
Containers and microservices for realists
Karthik Gaekwad
 
PDF
A curtain-raiser to the container world Docker & Kubernetes
zekeLabs Technologies
 
PDF
A Tail of Two Containers: How docker made ci great again
Kyle Rames
 
PPTX
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
PDF
Containers, microservices and serverless for realists
Karthik Gaekwad
 
PPTX
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
PPTX
ma-formation-en-Docker-jlklk,nknkjn.pptx
imenhamada17
 
PDF
Docker for dev
Erik Talboom
 
PDF
Docker in Production: How RightScale Delivers Cloud Applications
RightScale
 
PPTX
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PPTX
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
PDF
Docker Birthday #3 Slides - Overview
Chris Ciborowski
 
PDF
Docker Birthday #3 - Intro to Docker Slides
Docker, Inc.
 
PDF
Docker dev ops for cd meetup 12-14
Simon Storm
 
PPTX
Structured Container Delivery by Oscar Renalias, Accenture
Docker, Inc.
 
PDF
Dockerizing OpenStack for High Availability
Daniel Krook
 
PDF
Introduction to Docker
Aditya Konarde
 
PPTX
Lean & mean applications using Docker EE and golang
Anoop Kumar
 
UNITde II - Docker-Containerization.pptx,
aman0710p
 
Containers and Microservices for Realists
Oracle Developers
 
Containers and microservices for realists
Karthik Gaekwad
 
A curtain-raiser to the container world Docker & Kubernetes
zekeLabs Technologies
 
A Tail of Two Containers: How docker made ci great again
Kyle Rames
 
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
Containers, microservices and serverless for realists
Karthik Gaekwad
 
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
ma-formation-en-Docker-jlklk,nknkjn.pptx
imenhamada17
 
Docker for dev
Erik Talboom
 
Docker in Production: How RightScale Delivers Cloud Applications
RightScale
 
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Containerization using docker and its applications
Puneet Kumar Bhatia (MBA, ITIL V3 Certified)
 
Docker Birthday #3 Slides - Overview
Chris Ciborowski
 
Docker Birthday #3 - Intro to Docker Slides
Docker, Inc.
 
Docker dev ops for cd meetup 12-14
Simon Storm
 
Structured Container Delivery by Oscar Renalias, Accenture
Docker, Inc.
 
Dockerizing OpenStack for High Availability
Daniel Krook
 
Introduction to Docker
Aditya Konarde
 
Lean & mean applications using Docker EE and golang
Anoop Kumar
 
Ad

More from Laura Frank Tacho (8)

PDF
The Container Shame Spiral
Laura Frank Tacho
 
PDF
Using Docker For Development
Laura Frank Tacho
 
PDF
Deploying a Kubernetes App with Amazon EKS
Laura Frank Tacho
 
PDF
Scalable and Available Services with Docker and Kubernetes
Laura Frank Tacho
 
PDF
SwarmKit in Theory and Practice
Laura Frank Tacho
 
PDF
Everything You Thought You Already Knew About Orchestration
Laura Frank Tacho
 
PDF
Stop Being Lazy and Test Your Software
Laura Frank Tacho
 
PDF
Happier Teams Through Tools
Laura Frank Tacho
 
The Container Shame Spiral
Laura Frank Tacho
 
Using Docker For Development
Laura Frank Tacho
 
Deploying a Kubernetes App with Amazon EKS
Laura Frank Tacho
 
Scalable and Available Services with Docker and Kubernetes
Laura Frank Tacho
 
SwarmKit in Theory and Practice
Laura Frank Tacho
 
Everything You Thought You Already Knew About Orchestration
Laura Frank Tacho
 
Stop Being Lazy and Test Your Software
Laura Frank Tacho
 
Happier Teams Through Tools
Laura Frank Tacho
 
Ad

Recently uploaded (20)

PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PPTX
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
PPTX
The Future of AI & Machine Learning.pptx
pritsen4700
 
PPTX
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
PDF
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
PDF
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Agentic AI in Healthcare Driving the Next Wave of Digital Transformation
danielle hunter
 
The Future of AI & Machine Learning.pptx
pritsen4700
 
Agile Chennai 18-19 July 2025 | Workshop - Enhancing Agile Collaboration with...
AgileNetwork
 
The Past, Present & Future of Kenya's Digital Transformation
Moses Kemibaro
 
RAT Builders - How to Catch Them All [DeepSec 2024]
malmoeb
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Researching The Best Chat SDK Providers in 2025
Ray Fields
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Lecture A - AI Workflows for Banking.pdf
Dr. LAM Yat-fai (林日辉)
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 

Efficient Parallel Testing with Docker

  • 1. Efficient Parallel Testing with Docker Laura Frank Senior Engineer, Codeship
  • 4. 1. Parallel Testing: Goals and Benefits 2. DIY with LXC 3. Using Docker and the Docker Ecosystem Agenda
  • 6. Create a customizable, flexible test environment that enables us to run tests in parallel GOAL
  • 7. 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, please talk to me at the Codeship booth.
  • 8. 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?
  • 9. Let’s eliminate friction in the development cycle
  • 10. • 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?
  • 11. • Split up testing tasks • Give developer full control of dependencies per task • Use containers to run multiple tests at once How?
  • 13. Run tasks across multiple processors in parallel computing environments TASK PARALLELISM
  • 14. 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
  • 15. 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
  • 16. 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 👍
  • 18. Codeship has been powered by containers since the very beginning
  • 19. Codeship was founded Flowing salty water on Mars International Year of Forests Preparations ahead of 12.04 Precise release shipped to support LXC improvements Green Bay Packers won Super Bowl XLV 2011: A Brief History Lesson
  • 20. I should use LXC…
  • 21. Checkbot (Codeship Classic) • Still running in production as our classic infrastructure • Well-suited for users who want 1-click test environments without much customization • Compromise flexibility for ease of use
  • 22. Checkbot 39K builds per day 7.8M builds per year
  • 23. 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
  • 24. User Commands Universal Container Pipeline User Commands Universal Container Pipeline Heroku Deployment Provider Capistrano AppEngine Elastic Beanstalk etc…
  • 25. Limitations • Parity between dev and test • Can’t really debug locally • No useable interface between user and container • Resource consumption is too high
  • 26. We weren’t able to provide the best, most efficient product to our customers (or ourselves)
  • 27. Using Docker and the Docker Ecosystem
  • 28. Create a customizable, flexible test environment that enables us to run tests in parallel GOAL
  • 29. Big Wins with Docker Even before 1.0, Docker was a clear choice • Support and tooling • Standardization • Community of motivated developers
  • 30. Using Docker allowed us to build a much better testing platform than with LXC alone
  • 32. A Docker-based Testing Platform • Development started in 2014 • First beta in 2015 • Official launch February 2016
  • 33. A Docker-based Testing Platform Built with Docker in order to support Docker workflows
  • 34. Codeship Jet 2.3K builds per day ~250K total builds
  • 35. Docker Workflow Tools • Docker Compose: service and step definition syntax • Docker Registry: storage for images; remote caching* • Docker for Mac and Windows: give users ability to reproduce CI environments locally *not for long!
  • 37. The workflow tools provided by Docker are indispensable
  • 39. Managing containers with Docker allowed us to improve our parallel testing workflow
  • 40. 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
  • 41. Services • Pull image from any registry or build from Dockerfile • Optimize service for testing tasks • Fully customizable by the user
  • 42. Steps • Each step is executed in an independent environment • Can be nested in serial and parallel groups • Two functions • Run: execute a command against a service • Push: push image to registry • Tag regex matching to run steps on certain branches or tagged releases
  • 43. User Commands Universal Container Pipeline User Commands Universal Container Pipeline User Commands Universal Container Pipeline T1 T1 T1
  • 45. codeship-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
  • 46. codeship-steps.yml - 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
  • 47. ProTip: Your push or deploy step should never be part of a parallel step group
  • 48. Demo!
  • 49. 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 • HUGE advantage over our previous LXC implementation
  • 51. 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!
  • 52. 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
  • 53. Performance Image Caching • Great news: 1.11 restores parent/child relationship when you save the images via docker save • ETA: 1 month • Double-edged sword of relying on external tools ¯_( )_/¯
  • 55. 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
  • 56. 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 • Preliminary work has been completed 🐳
  • 57. You can create a highly efficient parallel testing platform with LXC alone, but using Docker tools makes it better TL;DR