SlideShare a Scribd company logo
1 of 33
Download to read offline
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
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 introductiondotCloud
 
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 NetflixDocker, Inc.
 
Intro Docker october 2013
Intro Docker october 2013Intro Docker october 2013
Intro Docker october 2013dotCloud
 
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSAutomated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWS
Automated Deployment Pipeline using Jenkins, Puppet, Mcollective and AWSBamdad Dashtban
 
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 aciRajesh Kolla
 
Testing with Docker
Testing with DockerTesting with Docker
Testing with Dockertoffermann
 
Docker With Asp.net Core
Docker With Asp.net CoreDocker With Asp.net Core
Docker With Asp.net CoreFatih Ş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 PipelinesSteffen Gebert
 
Repository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryRepository Management with JFrog Artifactory
Repository Management with JFrog ArtifactoryStephen Chin
 
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 EnvironmentDocker, 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 ToolkitDocker, 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 NewsroomDocker, Inc.
 
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationJenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems IntegrationOleg Nenashev
 
Your Auto-Scaling Bot - Volkan Tufecki
Your Auto-Scaling Bot - Volkan TufeckiYour Auto-Scaling Bot - Volkan Tufecki
Your Auto-Scaling Bot - Volkan TufeckiDocker, 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, AccentureDocker, 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 ContainersYajushi Srivastava
 

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 DockerOpen 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 EcosistemaGermán Moltó
 

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 ServiceJosh Padnick
 
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 2013dotCloud
 
Efficient Parallel Testing with Docker
Efficient Parallel Testing with DockerEfficient Parallel Testing with Docker
Efficient Parallel Testing with DockerLaura Frank Tacho
 
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 FrankDocker, Inc.
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
Apex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXApex world 2018 continuously delivering APEX
Apex world 2018 continuously delivering APEXSergei Martens
 
Introduction to jenkins
Introduction to jenkinsIntroduction to jenkins
Introduction to jenkinsAbe Diaz
 
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 nutshellEugene Fedorenko
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the Worlddamovsky
 
Exploring Docker in CI/CD
Exploring Docker in CI/CDExploring Docker in CI/CD
Exploring Docker in CI/CDHenry Huang
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo 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

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityIES VE
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsYoss Cohen
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 

Recently uploaded (20)

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Decarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a realityDecarbonising Buildings: Making a net-zero built environment a reality
Decarbonising Buildings: Making a net-zero built environment a reality
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Infrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platformsInfrared simulation and processing on Nvidia platforms
Infrared simulation and processing on Nvidia platforms
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 

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
  • 32.