Development – Environments – Overview



Development – Environments – Overview

0 0


vagrant_slides

Slide set, written using reveal.js, for my Vagrant talk, June 2013.

On Github LeeXGreen / vagrant_slides

Development

Environments

Lee GreenJune 2013

Overview

  • Problems

  • Partial Solutions

  • Vagrant

Problems

  • Dev machine
  • Dependencies
  • Spin up time / effort
  • Reproducibility
  • Dev / Prod Parity

Dev Machine

Different projects:

  • Nginx + Redis + Ruby + Rails
  • Apache + MySQL + PHP + Zend
  • Tomcat + PostgreSQL + Java + Spring

SIGH

Do I really have to install all this crap on my laptop?

Dependencies

One project - different releases:

  • PHP 5.1 + Apache 2.0
  • PHP 5.3 + Apache 2.2

How to specify and isolate?

Spin Up

  • New developers
  • Developers new to a project
  • Developers who switch between projects

Reproducibility

  • How to share the finished result?
  • How to consistently apply changes?

Dev / Prod Parity

a.k.a.

"it works on my machine!"

Partial Solutions

Presented in decreasing order of FAIL

Work on servers only

  • Requires constant connection
  • Adds latency / network restrictions
  • Heavy

Virtual Machines

Flavors:

  • VM on USB stick
  • Shell script to customize VM from base OS
  • Provision VM with Puppet, etc.

Vagrant

What is it?

“Vagrant provides easy to configure, reproducible, and portable work environments built on top of industry-standard technology and controlled by a single consistent workflow to help maximize the productivity and flexibility of you and your team.”

Seriously

Vagrant makes all these easy:

  • creation
  • provisioning
  • configuration
  • sharing

Base box

$ vagrant init precise32 http://files.vagrantup.com/precise32.box
$ vagrant up
                        

Git repo

$ git clone git://server/my_vagrant_repo
$ cd my_vagrant_repo
$ vagrant up
                        

VM Servers

  • VirtualBox (default)
  • VMWare ($$)
  • Amazon
  • Rackspace

Provisioning

  • Shell script
  • Ansible
  • Puppet
  • Puppet Server
  • Chef Solo
  • Chef Server

Other Awesome Stuff

  • Networking config
  • Synced folders
  • Multi-VM environments

Vagrant machines are:

  • Portable
  • Self-contained
  • Lightweight
  • Reproducible

Portable

  • Runs on Windows / OS X / Linux
  • Defaults to free VirtualBox software
  • Self-contained installer

Self-contained

  • Only contains what you want it to contain
  • Does not require developer tools on host
  • Does not install any libraries / servers on host

Lightweight

  • Reduces virtual machine state to code
  • Maps a complex domain into one we have tools for
  • Machines can be packaged into shareable binaries

Reproducible

  • Starts with known (shareable) base image
  • Applies specified configuration and customization
  • Eliminates "works on my machine" problems
  • New employees / new projects spin up quickly

How can we use it?

DEV

  • Daily development:
    • construct "sandbox" environment
    • independent of servers
    • run code directly from your dev tree
  • Pre-release:
    • switch to production-like environment
    • still running in a VM
    • Run code from packaged releases
  • In either case:
    • Destroy environment and rebuild at any time

OPS

  • Develop and test provisioning scripts
  • Test installations / release notes on disposable servers

THE END

Presented using reveal.js.

Isn't it freaking awesome?