Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Vagrant Users Boston - Meetup - 2014-04-30

Vagrant Users Boston - Meetup - 2014-04-30

This presentation offered a high level introduction to utilizing Packer to build base boxes for Vagrant. Also included in the talk was Racker, a Ruby DSL wrapper for Packer, as well as how Yieldbot wraps its use of Packer/Racker into an internal project called Planet Express.

Anthony Spring

April 30, 2014
Tweet

More Decks by Anthony Spring

Other Decks in Technology

Transcript

  1. Vagrant Boxes: Packer Style Anthony Spring Minister of DevOps Culture

    - Yieldbot @devopsanthony The opinions expressed here represent my own and not those of my employer. April 30th, 2014 Vagrant Users Boston - Meetup
  2. What is Packer? “Packer is a tool for creating identical

    machine images for multiple platforms from a single source configuration.”
  3. Builders Define the high level configuration settings for the box

    that is getting built. DigitalOcean, Docker, EC2, GCE, OpenStack, QEMU, VirtualBox, VMWare
  4. Provisioners A set of ‘scripts’ that get applied to each

    an image. Ansible, Chef Solo, File Uploads, Salt, Shell Scripts
  5. Post Processors Determines the type of output artifact generated and

    where that artifact is placed. Docker Import, Docker Push, Vagrant, vSphere
  6. Putting it all together • Build several images in parallel.

    • Target specific builders (inclusive/exclusive). • Everything used to build the box is in source control. • Its really freaking sweet!
  7. Packer 201 • Feedback loop — headless vs non-headless •

    Image Layering — building off of existing images • Image Management — how to manage what went into the box • Bake vs Fry — division of labor between Packer and Vagrant • Testing — get your ServerSpec on!
  8. Packer @ Yieldbot • Primarily CentOS/RHEL • Build universal images

    for VirtualBox, VMware Fusion, VMware ESXI and EC2 AMI. • Ability to provision with Chef • Ability to test images before shipping
  9. Evolution • Created a single primary Packer template • Change

    to the base template — required changes to all of its derivatives. • Variables could only take us so far. • Not very easy to merge the Packer JSON template format.
  10. Racker • Determinant merging of templates • DRY templates •

    Provide a method of knocking out hash values • Ability to add comments • Its just ruby!
  11. Box Build Pipeline • Create the candidate box with Packer

    • Push box to image store • Smoke test base role provision with integration tests • Every role provision with integration tests • Promote box
  12. Pipeline Tools • Jenkins • Packer • Racker • Planet

    Express • Vagrant • Chef • ServerSpec • KitchenCI