SlideShare a Scribd company logo
1 of 62
Download to read offline
Efficient Parallel Testing with Docker
Laura
Frank
Engineer, Codeship
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
• Deploy new code faster
• Find out quickly when automated steps fail
If you’re still not sure why testing is important, please talk to me at
the Codeship booth.
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?
• Performance optimization for serial testing tasks is
limited
• Split up testing tasks
• 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
Spend less time waiting around for your builds to finish.
• Ship newest code to production faster
• Be alerted sooner when tests fail
Goal: Shorter Feedback Cycles
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
Goal: More User Control
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 utilize infrastructure at higher
capacity
• 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
Flowing salty water on Mars
International Year of Forests
Preparations ahead of 12.04 Precise release shipped to support
LXC improvements
Codeship was founded
Green Bay Packers won Super Bowl XLV
2011: A Brief History Lesson
I should use LXC…
Why LXC?
• Impose resource limits and utilize infrastructure at
higher capacity
• Run customer code in isolation
• Provide consistent build environment across many build runs
• Enable parallel testing jobs
• Can programmatically automate creation and deletion
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
• Run builds in isolation from one another
• 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
While using straight-up LXC solved some of
our technical problems, it didn’t solve any of
our workflow problems
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
Why Docker?
• 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!
Docker Compose
• Provides simplicity and a straightforward interface
• Developers can use existing docker-compose.yml files
with Codeship
• Ensure parity in dev, test, and production
• Use similar syntax for testing step definitions to get users up
and running faster
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
Steppostgres
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
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 http://bit.ly/codeship-jet-tool
• Don’t have a Docker for Mac/Windows invitation yet? Totally
cool, Docker Toolbox also rocks
• 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?
Docker 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
(thanks Brendan!)
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

What's hot (20)

[GDSC-ADYPU] APIs 101 with Postman
[GDSC-ADYPU] APIs 101 with Postman[GDSC-ADYPU] APIs 101 with Postman
[GDSC-ADYPU] APIs 101 with Postman
 
API Test Automation
API Test Automation API Test Automation
API Test Automation
 
Postman: An Introduction for Developers
Postman: An Introduction for DevelopersPostman: An Introduction for Developers
Postman: An Introduction for Developers
 
RESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and JenkinsRESTful API Testing using Postman, Newman, and Jenkins
RESTful API Testing using Postman, Newman, and Jenkins
 
API Testing
API TestingAPI Testing
API Testing
 
Test Design and Automation for REST API
Test Design and Automation for REST APITest Design and Automation for REST API
Test Design and Automation for REST API
 
Api testing
Api testingApi testing
Api testing
 
DevCamp - O papel de um testador em uma equipe ágil
DevCamp - O papel de um testador em uma equipe ágilDevCamp - O papel de um testador em uma equipe ágil
DevCamp - O papel de um testador em uma equipe ágil
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Api testing
Api testingApi testing
Api testing
 
Sonarqube
SonarqubeSonarqube
Sonarqube
 
Advanced API Debugging
Advanced API DebuggingAdvanced API Debugging
Advanced API Debugging
 
API
APIAPI
API
 
An Introduction To Automated API Testing
An Introduction To Automated API TestingAn Introduction To Automated API Testing
An Introduction To Automated API Testing
 
API Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNGAPI Testing Using REST Assured with TestNG
API Testing Using REST Assured with TestNG
 
Testing types functional and nonfunctional - Kati Holasz
Testing types   functional and nonfunctional - Kati HolaszTesting types   functional and nonfunctional - Kati Holasz
Testing types functional and nonfunctional - Kati Holasz
 
Postman: An Introduction for Testers
Postman: An Introduction for TestersPostman: An Introduction for Testers
Postman: An Introduction for Testers
 
Manual testing - Introduction to Manual Software testing
Manual testing - Introduction to Manual Software testingManual testing - Introduction to Manual Software testing
Manual testing - Introduction to Manual Software testing
 
API_Testing_with_Postman
API_Testing_with_PostmanAPI_Testing_with_Postman
API_Testing_with_Postman
 
A Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End TestingA Top Down Approach to End-to-End Testing
A Top Down Approach to End-to-End Testing
 

Viewers also liked

Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Docker, Inc.
 
Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...
Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...
Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...
Docker, Inc.
 

Viewers also liked (20)

Making Friendly Microservices by Michele Titlol
Making Friendly Microservices by Michele TitlolMaking Friendly Microservices by Michele Titlol
Making Friendly Microservices by Michele Titlol
 
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth RushgroveThe Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
 
Deploying Personalized Learning Labs using Docker Swarm by Nate Aune and Bria...
Deploying Personalized Learning Labs using Docker Swarm by Nate Aune and Bria...Deploying Personalized Learning Labs using Docker Swarm by Nate Aune and Bria...
Deploying Personalized Learning Labs using Docker Swarm by Nate Aune and Bria...
 
containerd and CRI
containerd and CRIcontainerd and CRI
containerd and CRI
 
Driving containerd operations with gRPC
Driving containerd operations with gRPCDriving containerd operations with gRPC
Driving containerd operations with gRPC
 
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
 
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
Overseeing Ship's Surveys and Surveyors Globally Using IoT and Docker by Jay ...
 
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
Learning the Alphabet: A/B, CD and [E-Z] in the Docker Datacenter by Brett Ti...
 
Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok   Securing the Container Pipeline at Salesforce by Cem Gurkok
Securing the Container Pipeline at Salesforce by Cem Gurkok
 
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker for Mac and Windows: The Insider's Guide by Justin CormackDocker for Mac and Windows: The Insider's Guide by Justin Cormack
Docker for Mac and Windows: The Insider's Guide by Justin Cormack
 
Docker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott CoultonDocker in Production, Look No Hands! by Scott Coulton
Docker in Production, Look No Hands! by Scott Coulton
 
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy LimBuild Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
Build Fast, Deploy Fast: Innovating in the Enterprise by Imran Raja and Andy Lim
 
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
Using the SDACK Architecture on Security Event Inspection by Yu-Lun Chen and ...
 
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
 
DockerCon 16 General Session Day 2
DockerCon 16 General Session Day 2 DockerCon 16 General Session Day 2
DockerCon 16 General Session Day 2
 
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
 
Fully Orchestrating Applications, Microservices and Enterprise Services with ...
Fully Orchestrating Applications, Microservices and Enterprise Services with ...Fully Orchestrating Applications, Microservices and Enterprise Services with ...
Fully Orchestrating Applications, Microservices and Enterprise Services with ...
 
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
Use Docker to Deliver Cognitive Services Running Cross Platform and Multi Clo...
 
Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...
Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...
Dockerizing CS50: From Cluster to Cloud to Appliance to Container by David Ma...
 

Similar to Efficient Parallel Testing with Docker by Laura Frank

Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
javaonfly
 
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
 
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
Amazon Web Services Korea
 

Similar to Efficient Parallel Testing with Docker by Laura Frank (20)

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
 
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
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
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
 
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)
 
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
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
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 ...
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Dockerizing OpenStack for High Availability
Dockerizing OpenStack for High AvailabilityDockerizing OpenStack for High Availability
Dockerizing OpenStack for High Availability
 
Adf with docker
Adf with dockerAdf with docker
Adf with docker
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Detailed Introduction To Docker
Detailed Introduction To DockerDetailed Introduction To Docker
Detailed Introduction To Docker
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
 
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
 
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
AWS Innovate: Moving Microsoft .Net applications one container at a time - Da...
 
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
Building Distributed Systems without Docker, Using Docker Plumbing Projects -...
 
Docker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud ApplicationsDocker in Production: How RightScale Delivers Cloud Applications
Docker in Production: How RightScale Delivers Cloud Applications
 

More from Docker, Inc.

Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
Docker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
Docker, Inc.
 

More from Docker, Inc. (20)

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at Salesforce
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices World
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with Docker
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio Code
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container Registry
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm Architecture
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
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...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
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?
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Efficient Parallel Testing with Docker by Laura Frank

  • 1. Efficient Parallel Testing with Docker Laura Frank Engineer, Codeship
  • 2.
  • 3.
  • 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. • Deploy new code faster • Find out quickly when automated steps fail If you’re still not sure why testing is important, please talk to me at the Codeship booth. Why?
  • 8. • 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?
  • 9. • Performance optimization for serial testing tasks is limited • Split up testing tasks • Use containers to run multiple tests at once How?
  • 10. Run tasks across multiple processors in parallel computing environments TASK PARALLELISM
  • 11. 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
  • 12.
  • 13.
  • 14. Spend less time waiting around for your builds to finish. • Ship newest code to production faster • Be alerted sooner when tests fail Goal: Shorter Feedback Cycles
  • 15. 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 Goal: More User Control
  • 16. 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
  • 17. Containers, duh! • Impose resource limits and utilize infrastructure at higher capacity • Run customer code in isolation • Provide consistent build environment across many build runs • Run testing tasks in parallel 👍
  • 19. Codeship has been powered by containers since the very beginning
  • 20. Flowing salty water on Mars International Year of Forests Preparations ahead of 12.04 Precise release shipped to support LXC improvements Codeship was founded Green Bay Packers won Super Bowl XLV 2011: A Brief History Lesson
  • 21. I should use LXC…
  • 22. Why LXC? • Impose resource limits and utilize infrastructure at higher capacity • Run customer code in isolation • Provide consistent build environment across many build runs • Enable parallel testing jobs • Can programmatically automate creation and deletion
  • 23. 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
  • 24. Checkbot 39K builds per day 7.8M builds per year
  • 25. Architecture • Universal Container with provided dependencies • Run builds in isolation from one another • Implement parallel testing pattern using pipelines with ParallelCI • Users can have N pipelines running in isolation during a build
  • 26. User Commands Universal Container Pipeline User Commands Universal Container Pipeline Heroku Deployment Provider Capistrano AppEngine Elastic Beanstalk etc…
  • 27. Limitations • Parity between dev and test • Can’t really debug locally • No useable interface between user and container • Resource consumption is too high
  • 28. While using straight-up LXC solved some of our technical problems, it didn’t solve any of our workflow problems
  • 29. We weren’t able to provide the best, most efficient product to our customers (or ourselves)
  • 30. Using Docker and the Docker Ecosystem
  • 31. Create a customizable, flexible test environment that enables us to run tests in parallel GOAL
  • 32. Big Wins with Docker Even before 1.0, Docker was a clear choice • Support and tooling • Standardization • Community of motivated developers
  • 33. Using Docker allowed us to build a much better testing platform than with LXC alone
  • 35. A Docker-based Testing Platform • Development started in 2014 • First beta in 2015 • Official launch February 2016
  • 36. A Docker-based Testing Platform Built with Docker in order to support Docker workflows
  • 37. Codeship Jet 2.3K builds per day ~250K total builds
  • 38. Why Docker? • 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!
  • 39.
  • 40. Docker Compose • Provides simplicity and a straightforward interface • Developers can use existing docker-compose.yml files with Codeship • Ensure parity in dev, test, and production • Use similar syntax for testing step definitions to get users up and running faster
  • 41. The workflow tools provided by Docker are indispensable
  • 43. Managing containers with Docker allowed us to improve our parallel testing workflow
  • 44. 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
  • 45. Services • Pull image from any registry or build from Dockerfile • Optimize service for testing tasks • Fully customizable by the user
  • 46. 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
  • 47. User Commands Universal Container Pipeline User Commands Universal Container Pipeline User Commands Universal Container Pipeline T1 T1 T1
  • 49. 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
  • 50. 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
  • 51. ProTip: Your push or deploy step should never be part of a parallel step group
  • 52. Demo!
  • 53. Docker for Mac and Windows • All users can test locally • Jet CLI is available at http://bit.ly/codeship-jet-tool • Don’t have a Docker for Mac/Windows invitation yet? Totally cool, Docker Toolbox also rocks • HUGE advantage over our previous LXC implementation
  • 55. 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!
  • 56. 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
  • 57. 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 ¯_( )_/¯
  • 59. Docker 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
  • 60. 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 (thanks Brendan!)
  • 61. You can create a highly efficient parallel testing platform with LXC alone, but using Docker tools makes it better TL;DR