Quick Prototyping+CI with LXC and Puppet

Similar documents
[Docker] Containerization

Who is Docker and how he can help us? Heino Talvik

CONTINUOUS DELIVERY WITH DC/OS AND JENKINS

Docker A FRAMEWORK FOR DATA INTENSIVE COMPUTING

Getting Started With Containers

DEVOPS TRAINING COURSE CONTENT

DevOps Course Content

Travis Cardwell Technical Meeting

INNOV-4: Fun With Virtualization. Or, How I learned to love computers that don t really exist...

DevOps Technologies. for Deployment

Docker at Lyft Speeding up development Matthew #dockercon

Vagrant and Ansible. Two so2ware tools to create and manage your custom VMs

The failure of Operating Systems,

Parallels Virtuozzo Containers

DEVOPS COURSE CONTENT

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

AWS Course Syllabus. Linux Fundamentals. Installation and Initialization:

LINUX Virtualization. Running other code under LINUX

Con$nuous Deployment with Docker Andrew Aslinger. Oct

ISLET: Jon Schipp, AIDE jonschipp.com. An Attempt to Improve Linux-based Software Training

UP! TO DOCKER PAAS. Ming

CONTINUOUS DELIVERY WITH MESOS, DC/OS AND JENKINS

Deployment Patterns using Docker and Chef

Originally prepared by Lehigh graduate Greg Bosch; last modified April 2016 by B. Davison

Continuous Integration using Docker & Jenkins

Logging, Monitoring, and Alerting

Automated system and service monitoring with openqrm and Nagios

EPHEMERAL DEVOPS: ADVENTURES IN MANAGING SHORT-LIVED SYSTEMS

Containerizing GPU Applications with Docker for Scaling to the Cloud

OS Virtualization. Linux Containers (LXC)

Accelerate at DevOps Speed With Openshift v3. Alessandro Vozza & Samuel Terburg Red Hat

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

DevOps Online Training

Lifecycle management with Foreman and Katello Basics and Spacewalk migration

CIS : Computational Reproducibility

Docker for HPC? Yes, Singularity! Josef Hrabal

Using git To Manage Your System's Configuration

Continuous Integration and Delivery with Spinnaker

Container Adoption for NFV Challenges & Opportunities. Sriram Natarajan, T-Labs Silicon Valley Innovation Center

Continuous integration & continuous delivery. COSC345 Software Engineering

Packer. Attribution-ShareAlike CC BY-SA 2015

OPS-9: Fun With Virtualization. John Harlow. John Harlow. About John Harlow

Resiliency Replication Appliance Installation Guide Version 7.2

USING DOCKER FOR MXCUBE DEVELOPMENT AT MAX IV

Docker and Security. September 28, 2017 VASCAN Michael Irwin

Portable, lightweight, & interoperable Docker containers across Red Hat solutions

Infoblox Kubernetes1.0.0 IPAM Plugin

5 Things You Need for a True VMware Private Cloud

Continuous Delivery of Micro Applications with Jenkins, Docker & Kubernetes at Apollo

We are ready to serve Latest Testing Trends, Are you ready to learn?? New Batches Info

Be smart. Think open source.

The Road to Digital Transformation: Increase Agility Building and Managing Cloud Infrastructure. Albert Law Solution Architect Manager

The Post-Cloud. Where Google, DevOps, and Docker Converge

DEPLOYMENT MADE EASY!

Firefox Crash Reporting.

Investigating Containers for Future Services and User Application Support

Microservice Deployment. Software Engineering II Sharif University of Technology MohammadAmin Fazli

Patching and Updating your VM SUSE Manager. Donald Vosburg, Sales Engineer, SUSE

Docker for People. A brief and fairly painless introduction to Docker. Friday, November 17 th 11:00-11:45

INTRODUCING CONTAINER-NATIVE VIRTUALIZATION

Docker All The Things

Multi-Arch Layered Image Build System

InstallAnywhere: Requirements

Cloud Computing the VMware Perspective. Bogomil Balkansky Product Marketing

Installation and setup guide of 1.1 demonstrator

containerization: more than the new virtualization

INDIGO PAAS TUTORIAL. ! Marica Antonacci RIA INFN-Bari

Created by: Nicolas Melillo 4/2/2017 Elastic Beanstalk Free Tier Deployment Instructions 2017

Building A Better Test Platform:

CSC 5930/9010 Cloud S & P: Virtualization

WHITE PAPER. RedHat OpenShift Container Platform. Benefits: Abstract. 1.1 Introduction

Using Network Virtualization in DevOps environments Yves Fauser, 22. March 2016 (Technical Product Manager VMware NSBU)

Simple custom Linux distributions with LinuxKit. Justin Cormack

DevOps Course Content

Think Small to Scale Big

Linux Containers Roadmap Red Hat Enterprise Linux 7 RC. Bhavna Sarathy Senior Technology Product Manager, Red Hat

docker & HEP: containerization of applications for development, distribution and preservation

FreeBSD Jails vs. Solaris Zones

VMware vcloud Air User's Guide

Harbor Registry. VMware VMware Inc. All rights reserved.

Docker & Chef. Containers. Containers and Docker 8/4/14. Linux containers (LXC) Single operating system Multiple isolated, working configurations

StorageGRID Webscale 11.1 Expansion Guide

openqrm Enterprise Administrator Guide Enterprise System Adminstration and IaaS Datacenter Automation with openqrm 5.2

SAINT LOUIS JAVA USER GROUP MAY 2014

AALOK INSTITUTE. DevOps Training

IBM Cloud for VMware Solutions vrealize Automation 7.2 Chef Integration

Midterm Presentation Schedule

Infrastructure-as-Code and CI Infrastructure at Open Stack A look at one of the largest CI systems and system administration

ElasterStack 3.2 User Administration Guide - Advanced Zone

Amir Zipory Senior Solutions Architect, Redhat Israel, Greece & Cyprus

Splunk N Box. Splunk Multi-Site Clusters In 20 Minutes or Less! Mohamad Hassan Sales Engineer. 9/25/2017 Washington, DC

Zero to Microservices in 5 minutes using Docker Containers. Mathew Lodge Weaveworks

Introduction to containers

Bacula Systems Virtual Machine Performance Backup Suite

How we added software updates to AGL

White Paper BC/DR in the Cloud Era

Hystax Acura. Cloud Migration and Disaster Recovery Solution. Hystax. All rights reserved. 1

Introduction to cloud computing

Overhauling Dev Arch with Ansible Tower and Docker

Secure Kubernetes Container Workloads

Transcription:

Quick Prototyping+CI with LXC and Puppet Ben Kero 2014-05-04

Introduction Ben Kero Release Engineer Responsible for version control systems: CVS, SVN, BZR, Darcs, RCS, Git, Mercurial

Before at Mozilla Dawn of time (2001) to early 2014 All infrastructure deployed with Puppet No documented environment or target for setup Wild-wild west. Write the code. Does it work? Ship it!

Framing the problem Problem: Developers and upstreams need a way to replicate our production environment Problem: Needed a way to make development environment closer to production Requirement: Quick to bring up Requirement: Public, shareable, infinitely reproducible Requirement: Dev environment should be as close as possible to production

Ideas (1/3) Virtual machines (on workstation) KVM/VMWare Workstation Could be closest match to production Expensive to generate up-to-date images Slow, can only run a few at a time Virtual machines (in cloud) Requires internet connection for development/testing Requires IT to manage/audit accounts No/separate public availability

Ideas (2/3) Raw cgroups + CoW (Copy-on-Write) images CoW mechanisms require out-of-tree modules or filesystem of dubious stability Raw cgroups are difficult to use. Bring-up time for devs would be catastrophic Linux-only (Win/Mac devs need to virtualize) Docker Doesn t clean images up after itself Dockerfiles vs Puppet code Fast moving target Linux-only (Win/Mac devs need to virtualize) VMWare Vsphere (Vcloud) Expensive Requires specialized hardware Not free software No offline development Beta status Limited dev access

Ideas (3/3) Amazon Web Services EC2 Can be expensive (or slow) Still a viable alternative for devs No offline development Volunteers can t have access (but could provide AMIs) LXC + Puppet Devs will need access to a Linux host Closely matches our production environment Linux-only (Win/Mac devs need to virtualize)

What are containers? Operating system level hypervisor One kernel, many userlands In Linux these are: CGroups OpenVZ

CGroups (Explained) C(ontrol) groups Feature of the Linux kernel since 2.6.24 Allows resource isolation (CPU, memory, network, devices) Can run a single process or entire system in isolation Similar to chroot, but has other advantages Virtual network interfaces Resource constraints (memory, CPU, more) Separate process table Separate user/group tables

LXC (Explained) Set of convenience commands to facilitate use of CGroups Basic operations: Create Destroy Start Stop Others: Clone, console, (un)freeze, execute Creation: Uses template scripts for creating containers Can handle complex resource setups

Comparison to other dev environment strategies Keeps cost down due to lower resource requirements vs VMs Supported upstream by our vendor and good community support (ML + IRC) Less flexibility (Linux-only, single-kernel, less security) Entirely in vanilla Linux kernel, no out-of-tree patches

Reasons you might choose another container-based solution (Docker) Desire the portability of Dockerfiles Can accept the maintenance of cleaning old instances Developers aren t using Linux as their primary OS

Other container hypervisors OpenVZ Not many active contributors Has better isolation Out-of-kernel patches required to use Some large-scale VPS hosting companies use this

Configuration Management explanation (1/2) Many flavors including Puppet, Chef, Ansible, Salt, etc Approach used in this talk is agnostic For example: Basic puppet pattern 1 class apache { 2 package { httpd : 3 ensure => installed } 4 file { / etc / httpd / httpd. conf : 5 source => " puppet :/// modules / httpd / service " } 6 service { httpd : 7 ensure => running, 8 enable => true } 9 Package [ httpd ] -> File [ httpd ] -> Service [ httpd ] 10 }

= Configuration Management explanation (2/2) Higher-level classes (bricks, metaclasses, etc) Used to set up machine types (such as a web server) Machine types 1 class webserver { 2 include apache 3 include nagios :: nrpe :: webserver 4 include logstash :: webserver } 5 6 node /^ web.*\. dc1 \. example \. com$ / { 7 include webserver 8 }

Initial impressions and roadbumps LXC CentOS template only added very recently Still no template for RHEL6 Kernel audit grumbles Things are fast

Our dev environment offering Custom LXC templates Vagrant scripts to give to devs who would like to replicate Masterless puppet Templates on our public wiki

Custom LXC Templates (1/3) Regular templates create a golden image copy that lives in /var/cache/lxc/ Written in shell, executed on lxc-create Wrote custom LXC templates http://github.com/bkero/lxc-templates

Custom LXC Templates (2/3) Try: Adding extra packages Apply a puppet base class (sometimes bad idea) Pre-install puppet certs Creating multiple containers (!)

Custom LXC Templates (3/3) lxc-centos-hgweb 1 #!/ bin / bash 2 download_ centos () { 3 CACHE_DIR =/ var / cache / lxc /lxc - centos - hgweb 4 INSTALL_ ROOT = $1 5 PKG_ LIST =" yum initscripts rootfiles \ 6 puppet librarian - puppet " 7 8 mkdir $INSTALL_ ROOT 9 if [ -d $CACHE_ DIR ]; then 10 cp - rv $CACHE_ DIR $INSTALL_ ROOT / rootfs ; exit 0; fi 11 add_ yum_ repos 12 yum -- installroot $INSTALL_ ROOT -y \ 13 -- nogpgcheck $PKG_ LIST 14 } 15 apply_ puppet () { 16 cp -rv / data / incoming / hgweb / etc / puppet / modules / 17 librarian - puppet init 18 puppet apply -e include hgweb 19 }

How LXC improves CI Clean vanilla systems every time Allows multiple isolated systems to interact per CI-run Much faster turn-around time Allows devs to easily reproduce CI environment

How LXC improves prototyping Allows testing new code in production OS natively Eases testing of new code in multiple environments More than one or two won t overload the host Programmatic creation of faux-production environment is difficult in VMs, much easier with LXC

Productivity enhancements Things are fast We can write tooling to let developers have (almost) exact replicas of entire production environments* * (Footnote: It s RHEL, so we can t without scary licensing problems) Faster turnaround time Can attract more (external) contributors due to the ease of constructing a dev environment

Holistic Testing Able to spin up multiple containers at once Each container can run a single infrastructure component Containers can interact on a virtual network (Linux Bridge) Can be used to test the end result of a system

Holistic Testing (Example) loadbalancer1.test tcp/80 to webserver1.test webserver1.test tcp/3306 to mysql1.test webserver1.test tcp/6379 to redis1.test webserver1.test tcp/11211 to memcache1.test

Case Study: Socorro Firefox Crash Reporter Infrastructure Processors Collectors Admin hosts Deployment is handled through subclasses of a single puppet module Continuous integration working on codebase Failed CI runs can be replicated by devs

Adoption inside Mozilla

In Review Before: Little to no testing Before: Getting devs a production-esque environment was a lot of manual work and cost Now: Some teams are rolling it out (master documentation on wiki, invitation to copy wiki template) Now: Deployed alongside devs using personal EC2 instances (personal preference)

Demo time!