SlideShare a Scribd company logo
Using Docker andVagrant
Within a GitHub Pull RequestWorkflow
Who Am I?
E. Camden Fisher
Sr. DevOps Engineer, NorthPage
https://github.com/fishnix
https://twitter.com/fishnix
https://www.linkedin.com/in/fishnix
The GitHub Pull RequestWorkflow
An Overview
NorthPage GitHub Workflow
• Always deployable master branch (master)
• Long running development branch (dev)
• Feature/bugfix branches from dev (cf-np-1234)
• Work is done on a feature/bugfix branch
• Pull Request is opened, Code review
• Squash, Merge/Close PR, deploy to staging
• Release from dev to master, deploy to prod
Benefits of GitHub Workflow
• Everyone gets eyes on code being added to the product
• Web based process – review anywhere/anytime
• Bugs are caught before things get deployed
• Latest development version is always in our Staging environment
• It’s a learning opportunity
Challenges with GitHub Workflow
• Work in progress on your own feature branch means you must:
• Stop working, commit or stash, checkout, build, reset database, etc., or
• Maintain a separate repository used for PR review including a special assembly profile to
avoid port collisions, set different database, etc.
• Barrier causes less review to happen, less testing to happen, fewer bugs caught
• Delays merging features/bugfixes
• Environment looks a lot like local development, but not much like production
Vagrant
An Overview
What isVagrant? Why is it awesome?
• A high level wrapper around virtualization
• Define aVM (or several) in aVagrantfile and
simply run `vagrant up`
• Isolated environments
• Provisioned from the same code as production
(Chef, Puppet,Ansible, etc)
• Support for multiple providers (Virtualbox,VMware,
Docker, EC2, etc)
Vagrant Challenges
• Takes a long time to succeed or fail for complex environments
• Not really ‘like’ production
• Often single node
• You don’t `vagrant up` production
• Requires custom provisioning code or special properties, attributes, etc
• Ops spend a lot of time pre/rebuildingVagrant base boxes
An Overview
What is Docker? (tl;dr)
A collection of tools to package, deliver and manage the lifecycle of (LXC*)
containers.
Uh… cool, what’s a container?
• OS level virtualization
• LXC, Jails, Zones, etc
• Containers can only be run on hosts with the same kernel
How is that different from aVM?
Virtual Machines package an entire OS, while containers share the host
operating system’s kernel and run as isolated processes in user space.
What’s Inside Docker?
• Images
• Containers
What’s Inside Docker: Images
• Read-only template used to create containers
• Created from a Dockerfile with `docker build`
• Composed of metadata + filesystem layers
• Analogous toVMwareTemplate, AmazonAMI, etc
Dockerfile
• Set of instructions for building a Docker image
• The first instruction must be FROM
• Each instruction creates a new layer
• Other available instructions:
MAINTAINER, RUN, CMD, LABEL, EXPOSE,
ENV, ADD, COPY, ENTRYPOINT,VOLUME,
USER,WORKLOAD,ONBUILD
What’s Inside Docker: Containers
• The run component of Docker
• Can be started, stopped, moved, deleted
• Can be linked together
• Can share volumes with each other or the Docker host
• Can expose ports to each other or the Docker host
• One process per container
• `docker run`, docker start`, `docker stop`, `docker rm`, etc
Docker Service
• Docker Hub/Registry (distribution)
• Docker Host
• Runs the Docker daemon which does all of the
heavy lifting
• Docker Client
• Communicates with the daemon over a socket
or RESTful interface
Docker Registry
• Repositories of Docker images
• ie. fishnix/preview:TAG
hub.northpage.com/preview:TAG
• Public or Private
• Provides an HTTP API
• Images are pushed with `docker push`
NorthPage PreviewTool
Adding more awesome to our GitHub Pull Request Workflow
Preview:What we wanted.
• A way to review pull requests without interrupting work in progress
• An environment that looks more like production
• Ability to do end-to-end testing, not just green/red code diffs
• A simple web interface
• To share it if possible
Preview version 1.0
• Ruby/SinatraWeb Application with AngularJS
• git clone; vagrant up
• CentOS 6 insideVagrant/Virtualbox with
Preview (or PRView!)
• Business logic of standing up environment
baked into app
• Worked well, but slow! Unmanaged
Thread.new was unstable
• Not shareable
Preview version 1.5
• Converted from Sinatra to Angelo Framework
• Native websocket support
• Based on Reel, based on Celluloid::IO
• Better management of build threads/actors
• Slightly faster, More stable, UI Improvements
• Management Cli
• Faster but still slow
• Still not shareable
Preview version 2.0
• Significant rewrite of the backend
• CentOS 7
• Created a flexible DSL for writing workflows and
pluggable provider model
• Wrote providers for Docker and Git (our use case)
• Removed NorthPage specific business logic
• Much more shareable!
• Delivered as a Docker container running in
Vagrant
Preview version 2.0Workflow DSL
• Workflow resources are written as:
<provider module>_<class>_<method>
• Block is passed as a parameter and evaluated
within the scope of the provider instance
• Workflow is parsed with ERB template
language to allow for variable substitution
• only_if/not_if blocks are supported
Our Preview Workflow
• Individual files for related
components or steps
• Docker containers are deployed for
each platform component (1 process
per container)
How do we build our Docker images
• On every commit to GitHub:
• Jenkins builds the platform components and assembles them
• Jenkins builds docker images containing:
• trimmed, sanitized and patched version of our production database
• non-indexed instance of solr
• indexed instance of solr
• each of the platform components (portal, realtime, search-indexer, *automation agent)
• Jenkins tags the built images with the SHA of the git commit
• Jenkins pushes those images into our private docker registry
Docker Build Pipeline
Our Docker Registry
• CentOS7 on a t2.small in AWS EC2
• Docker container deployed by Chef
• Backing store is on S3
Challenges with Preview v2.0
• A lot of moving parts in Jenkins workflow. Helped by:
• Naginator Plugin: reschedules failed jobs
• Parameterized Trigger plugin
• BuildTimeout plugin
• Build Pipeline plugin
• ChatOps HipChat room notifies on build failures
• Docker is moving fast
• Internets are more critical
• Naming is hard: prview, np-prview, PRView, PReView, np-preview, Preview
Payback
• Tremendous efficiency gains
• Increased code quality
• Rapid onboarding, platform familiarity
• Ability to demo new features, reproduce bugs
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull Request Workflow
Questions?
camden@northpage.com
https://twitter.com/fishnix
https://www.linkedin.com/in/fishnix

More Related Content

What's hot

Docker introduction
Docker introductionDocker introduction
Docker introduction
dotCloud
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at Netflix
Docker, Inc.
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
dotCloud
 
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
Bamdad Dashtban
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aci
Rajesh Kolla
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
toffermann
 
Docker With Asp.net Core
Docker With Asp.net CoreDocker With Asp.net Core
Docker With Asp.net Core
Fatih Şimşek
 
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
Steffen Gebert
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog Artifactory
Stephen Chin
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Jirayut Nimsaeng
 
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing EnvironmentDCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
Docker, Inc.
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
Gourav Varma
 
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
Docker, Inc.
 
DockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System ToolkitDockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System Toolkit
Docker, Inc.
 
DockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times Newsroom
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 Integration
Oleg Nenashev
 
Your Auto-Scaling Bot - Volkan Tufecki
Your Auto-Scaling Bot - Volkan TufeckiYour Auto-Scaling Bot - Volkan Tufecki
Your Auto-Scaling Bot - Volkan Tufecki
Docker, Inc.
 
Structured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, AccentureStructured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, Accenture
Docker, Inc.
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
Yajushi Srivastava
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
Sujai Sivasamy
 

What's hot (20)

Docker introduction
Docker introductionDocker introduction
Docker introduction
 
DCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at NetflixDCSF19 Container Security: Theory & Practice at Netflix
DCSF19 Container Security: Theory & Practice at Netflix
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013
 
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
 
Containers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aciContainers docker-docker hub-azureacr-azure aci
Containers docker-docker hub-azureacr-azure aci
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Docker
 
Docker With Asp.net Core
Docker With Asp.net CoreDocker With Asp.net Core
Docker With Asp.net Core
 
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
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog Artifactory
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing EnvironmentDCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
DCSF19 Transforming a 15+ Year Old Semiconductor Manufacturing Environment
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...DCSF 19 Modernizing Insurance with Docker Enterprise:  The Physicians Mutual ...
DCSF 19 Modernizing Insurance with Docker Enterprise: The Physicians Mutual ...
 
DockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System ToolkitDockerCon SF 2015: The Distributed System Toolkit
DockerCon SF 2015: The Distributed System Toolkit
 
DockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times NewsroomDockerCon SF 2015: Docker in the New York Times Newsroom
DockerCon SF 2015: Docker in the New York Times Newsroom
 
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
 
Your Auto-Scaling Bot - Volkan Tufecki
Your Auto-Scaling Bot - Volkan TufeckiYour Auto-Scaling Bot - Volkan Tufecki
Your Auto-Scaling Bot - Volkan Tufecki
 
Structured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, AccentureStructured Container Delivery by Oscar Renalias, Accenture
Structured Container Delivery by Oscar Renalias, Accenture
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
 

Viewers also liked

Introducción a Docker
Introducción a DockerIntroducción a Docker
Introducción a Docker
Open Canarias
 
Introduccion a SQL Server 2017 en Docker
Introduccion a SQL Server 2017 en Docker Introduccion a SQL Server 2017 en Docker
Introduccion a SQL Server 2017 en Docker
Eduardo Castro
 
Seminario: Docker y su Ecosistema
Seminario: Docker y su EcosistemaSeminario: Docker y su Ecosistema
Seminario: Docker y su Ecosistema
Germán Moltó
 
Comenzando con Docker en AWS
Comenzando con Docker en AWSComenzando con Docker en AWS
Comenzando con Docker en AWS
Amazon Web Services LATAM
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
Jeffrey Ellin
 
Contenedores como Servicio con Docker
Contenedores como Servicio con DockerContenedores como Servicio con Docker
Contenedores como Servicio con Docker
Fernando Mayo Fernández
 

Viewers also liked (6)

Introducción a Docker
Introducción a DockerIntroducción a Docker
Introducción a Docker
 
Introduccion a SQL Server 2017 en Docker
Introduccion a SQL Server 2017 en Docker Introduccion a SQL Server 2017 en Docker
Introduccion a SQL Server 2017 en Docker
 
Seminario: Docker y su Ecosistema
Seminario: Docker y su EcosistemaSeminario: Docker y su Ecosistema
Seminario: Docker y su Ecosistema
 
Comenzando con Docker en AWS
Comenzando con Docker en AWSComenzando con Docker en AWS
Comenzando con Docker en AWS
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
Contenedores como Servicio con Docker
Contenedores como Servicio con DockerContenedores como Servicio con Docker
Contenedores como Servicio con Docker
 

Similar to CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull Request Workflow

Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Josh Padnick
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
Docker, Inc.
 
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
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
Laura Frank Tacho
 
Docker
DockerDocker
Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura Frank
Docker, Inc.
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
Apex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXApex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEX
Sergei Martens
 
Adf with docker
Adf with dockerAdf with docker
Adf with docker
Eugene Fedorenko
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
Abe Diaz
 
Why to docker
Why to dockerWhy to docker
Why to docker
Karthik Gaekwad
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
Eugene Fedorenko
 
ExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CIExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CI
ElasTest Project
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
Patxi Gortázar
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
Docker, Inc.
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
damovsky
 
Docker presentation for sharing
Docker presentation   for sharingDocker presentation   for sharing
Docker presentation for sharing
Waruna Viraj Perera
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
Henry Huang
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
Giacomo Vacca
 

Similar to CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull Request Workflow (20)

Play Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container ServicePlay Framework + Docker + CircleCI + AWS + EC2 Container Service
Play Framework + Docker + CircleCI + AWS + EC2 Container Service
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
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
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with Docker
 
Docker
DockerDocker
Docker
 
Efficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura FrankEfficient Parallel Testing with Docker by Laura Frank
Efficient Parallel Testing with Docker by Laura Frank
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Apex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXApex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEX
 
Adf with docker
Adf with dockerAdf with docker
Adf with docker
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkins
 
Why to docker
Why to dockerWhy to docker
Why to docker
 
Containers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshellContainers, Serverless and Functions in a nutshell
Containers, Serverless and Functions in a nutshell
 
ExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CIExpoQA 2017 Docker and CI
ExpoQA 2017 Docker and CI
 
Docker & ci
Docker & ciDocker & ci
Docker & ci
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
 
Docker presentation for sharing
Docker presentation   for sharingDocker presentation   for sharing
Docker presentation for sharing
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CD
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 

Recently uploaded

Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
welrejdoall
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
RaminGhanbari2
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Bert Blevins
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
Lidia A.
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
Matthew Sinclair
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
Yevgen Sysoyev
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
ScyllaDB
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 

Recently uploaded (20)

Manual | Product | Research Presentation
Manual | Product | Research PresentationManual | Product | Research Presentation
Manual | Product | Research Presentation
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyyActive Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
Active Inference is a veryyyyyyyyyyyyyyyyyyyyyyyy
 
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
Understanding Insider Security Threats: Types, Examples, Effects, and Mitigat...
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
WPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide DeckWPRiders Company Presentation Slide Deck
WPRiders Company Presentation Slide Deck
 
20240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 202420240705 QFM024 Irresponsible AI Reading List June 2024
20240705 QFM024 Irresponsible AI Reading List June 2024
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
DealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 editionDealBook of Ukraine: 2024 edition
DealBook of Ukraine: 2024 edition
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
Measuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at TwitterMeasuring the Impact of Network Latency at Twitter
Measuring the Impact of Network Latency at Twitter
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 

CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull Request Workflow

  • 1. Using Docker andVagrant Within a GitHub Pull RequestWorkflow
  • 2. Who Am I? E. Camden Fisher Sr. DevOps Engineer, NorthPage https://github.com/fishnix https://twitter.com/fishnix https://www.linkedin.com/in/fishnix
  • 3. The GitHub Pull RequestWorkflow An Overview
  • 4. NorthPage GitHub Workflow • Always deployable master branch (master) • Long running development branch (dev) • Feature/bugfix branches from dev (cf-np-1234) • Work is done on a feature/bugfix branch • Pull Request is opened, Code review • Squash, Merge/Close PR, deploy to staging • Release from dev to master, deploy to prod
  • 5. Benefits of GitHub Workflow • Everyone gets eyes on code being added to the product • Web based process – review anywhere/anytime • Bugs are caught before things get deployed • Latest development version is always in our Staging environment • It’s a learning opportunity
  • 6. Challenges with GitHub Workflow • Work in progress on your own feature branch means you must: • Stop working, commit or stash, checkout, build, reset database, etc., or • Maintain a separate repository used for PR review including a special assembly profile to avoid port collisions, set different database, etc. • Barrier causes less review to happen, less testing to happen, fewer bugs caught • Delays merging features/bugfixes • Environment looks a lot like local development, but not much like production
  • 8. What isVagrant? Why is it awesome? • A high level wrapper around virtualization • Define aVM (or several) in aVagrantfile and simply run `vagrant up` • Isolated environments • Provisioned from the same code as production (Chef, Puppet,Ansible, etc) • Support for multiple providers (Virtualbox,VMware, Docker, EC2, etc)
  • 9. Vagrant Challenges • Takes a long time to succeed or fail for complex environments • Not really ‘like’ production • Often single node • You don’t `vagrant up` production • Requires custom provisioning code or special properties, attributes, etc • Ops spend a lot of time pre/rebuildingVagrant base boxes
  • 11. What is Docker? (tl;dr) A collection of tools to package, deliver and manage the lifecycle of (LXC*) containers.
  • 12. Uh… cool, what’s a container? • OS level virtualization • LXC, Jails, Zones, etc • Containers can only be run on hosts with the same kernel
  • 13. How is that different from aVM? Virtual Machines package an entire OS, while containers share the host operating system’s kernel and run as isolated processes in user space.
  • 14. What’s Inside Docker? • Images • Containers
  • 15. What’s Inside Docker: Images • Read-only template used to create containers • Created from a Dockerfile with `docker build` • Composed of metadata + filesystem layers • Analogous toVMwareTemplate, AmazonAMI, etc
  • 16. Dockerfile • Set of instructions for building a Docker image • The first instruction must be FROM • Each instruction creates a new layer • Other available instructions: MAINTAINER, RUN, CMD, LABEL, EXPOSE, ENV, ADD, COPY, ENTRYPOINT,VOLUME, USER,WORKLOAD,ONBUILD
  • 17. What’s Inside Docker: Containers • The run component of Docker • Can be started, stopped, moved, deleted • Can be linked together • Can share volumes with each other or the Docker host • Can expose ports to each other or the Docker host • One process per container • `docker run`, docker start`, `docker stop`, `docker rm`, etc
  • 18. Docker Service • Docker Hub/Registry (distribution) • Docker Host • Runs the Docker daemon which does all of the heavy lifting • Docker Client • Communicates with the daemon over a socket or RESTful interface
  • 19. Docker Registry • Repositories of Docker images • ie. fishnix/preview:TAG hub.northpage.com/preview:TAG • Public or Private • Provides an HTTP API • Images are pushed with `docker push`
  • 20. NorthPage PreviewTool Adding more awesome to our GitHub Pull Request Workflow
  • 21. Preview:What we wanted. • A way to review pull requests without interrupting work in progress • An environment that looks more like production • Ability to do end-to-end testing, not just green/red code diffs • A simple web interface • To share it if possible
  • 22. Preview version 1.0 • Ruby/SinatraWeb Application with AngularJS • git clone; vagrant up • CentOS 6 insideVagrant/Virtualbox with Preview (or PRView!) • Business logic of standing up environment baked into app • Worked well, but slow! Unmanaged Thread.new was unstable • Not shareable
  • 23. Preview version 1.5 • Converted from Sinatra to Angelo Framework • Native websocket support • Based on Reel, based on Celluloid::IO • Better management of build threads/actors • Slightly faster, More stable, UI Improvements • Management Cli • Faster but still slow • Still not shareable
  • 24. Preview version 2.0 • Significant rewrite of the backend • CentOS 7 • Created a flexible DSL for writing workflows and pluggable provider model • Wrote providers for Docker and Git (our use case) • Removed NorthPage specific business logic • Much more shareable! • Delivered as a Docker container running in Vagrant
  • 25. Preview version 2.0Workflow DSL • Workflow resources are written as: <provider module>_<class>_<method> • Block is passed as a parameter and evaluated within the scope of the provider instance • Workflow is parsed with ERB template language to allow for variable substitution • only_if/not_if blocks are supported
  • 26. Our Preview Workflow • Individual files for related components or steps • Docker containers are deployed for each platform component (1 process per container)
  • 27. How do we build our Docker images • On every commit to GitHub: • Jenkins builds the platform components and assembles them • Jenkins builds docker images containing: • trimmed, sanitized and patched version of our production database • non-indexed instance of solr • indexed instance of solr • each of the platform components (portal, realtime, search-indexer, *automation agent) • Jenkins tags the built images with the SHA of the git commit • Jenkins pushes those images into our private docker registry
  • 29. Our Docker Registry • CentOS7 on a t2.small in AWS EC2 • Docker container deployed by Chef • Backing store is on S3
  • 30. Challenges with Preview v2.0 • A lot of moving parts in Jenkins workflow. Helped by: • Naginator Plugin: reschedules failed jobs • Parameterized Trigger plugin • BuildTimeout plugin • Build Pipeline plugin • ChatOps HipChat room notifies on build failures • Docker is moving fast • Internets are more critical • Naming is hard: prview, np-prview, PRView, PReView, np-preview, Preview
  • 31. Payback • Tremendous efficiency gains • Increased code quality • Rapid onboarding, platform familiarity • Ability to demo new features, reproduce bugs