This presentation is a basic introduction to using Vagrant for virtualized Rails development. It covers the basics of Vagrant, provisioning using puppet, and more advanced usage such as multi-vm configurations.
What Are The Drone Anti-jamming Systems Technology?
Using Vagrant for Rails development
1. Using Vagrant for Rails
Development
Dan Pilone
www.element84.com
Copyright 2012 Element 84, LLC
1
2. About Us
Element 84, LLC
Customer focused agile development and training
End to end Web and Mobile development
Customers include NASA, Raytheon, Fidelity
Investments, Yacht.com, Spacefindr.com
Copyright 2012 Element 84, LLC
2
3. About Us
Element 84, LLC
Customer focused agile development and training
End to end Web and Mobile development
Customers include NASA, Raytheon, Fidelity
Investments, Yacht.com, Spacefindr.com
Copyright 2012 Element 84, LLC
2
4. Client A
★Ruby 1.8.7
★Rails 2.3
★MySQL
★Redis
★ImageMagick
★EngineYard
Copyright 2012 Element 84, LLC
5. Client B
★Ruby 1.9.3
★Rails 3.0
★MySQL 5.1
★Passenger
★WebKit + Qt
Copyright 2012 Element 84, LLC
6. Client C
★JRuby 1.6
★Rails 3.0-3.2
★Oracle RAC
★ElasticSearch
★9 node HA+LB
Copyright 2012 Element 84, LLC
7. Client C
★JRuby 1.6
★Rails 3.0-3.2
★Oracle RAC
★ElasticSearch
★9 node HA+LB
Copyright 2012 Element 84, LLC
13. Vagrant!
Uses VirtualBox to provide development VM
environments
Lets you CM your development environment with your
code
Provides transparent access from your dev box
Copyright 2012 Element 84, LLC
18. vagrant box add mybox http://mybox
vagrant init*
Copyright 2012 Element 84, LLC * technically the VirtualBox VM
isn’t created until the first “up”
19. vagrant box add mybox http://mybox
vagrant init*
vagrant up
Copyright 2012 Element 84, LLC * technically the VirtualBox VM
isn’t created until the first “up”
28. vagrant box add mybox http://mybox
vagrant init*
Copyright 2012 Element 84, LLC * technically the VirtualBox VM
isn’t created until the first “up”
29. vagrant box add mybox http://mybox
vagrant init*
vagrant up
Copyright 2012 Element 84, LLC * technically the VirtualBox VM
isn’t created until the first “up”
30. vagrant box add mybox http://mybox
vagrant init*
vagrant up
vagrant provision
Copyright 2012 Element 84, LLC * technically the VirtualBox VM
isn’t created until the first “up”
35. Making your own boxes
Create a basic Vagrant setup
Provision and configure as desired
Create a package specific Vagrantfile
Run vagrant package
Profit Distribute to teammates
Copyright 2012 Element 84, LLC
36. Multi-VM Configuration
Used to simulate multi-
tier systems
Can simulate node
failure, load balancing,
cluster connectivity,
etc.
Uses host-only
networking
iPhone Overview - Copyright 2010 Element 84, LLC
39. Possible issues
Disk IO can be slow as the number of files grow due to
VirtualBox issues.
Use NFS in these situations.
Memory usage can get tight as number and size of
VMs grow.
Buy more memory...
Not really designed for performance testing
Copyright 2012 Element 84, LLC
40. Tips
Don’t forget to exclude .vagrant directory from CM
Use real provisioning (e.g. Puppet, Chef, etc.) Seriously.
Spend the time. Don’t cheat.
Consider building a set of project specific boxes and
using those instead of having everyone reprovision from
base box.
Vagrant has great Rake integration - consider using this
for any repetitive tasks that have to be done inside the
VM.
Copyright 2012 Element 84, LLC
41. More information
Me: Dan Pilone (dan@element84.com, @danpilone)
Vagrant: http://vagrantup.com
Puppet: http://puppetlabs.com/
Copyright 2012 Element 84, LLC
Editor's Notes
\n
\n
\n
\n
\n
\n
\n
\n
This is no fun. We don’t want to develop in a VM using vim....\n
We want access to our native environment\n
\n
Vagrant is technically a gem but as of v1.0 (March 2012) there are packages for OSX, Windows, Ubuntu, Debian, Redhat, etc.\n
\n
\n
* technically the VirtualBox VM isn’t created until the first “up”\n
* technically the VirtualBox VM isn’t created until the first “up”\n
* technically the VirtualBox VM isn’t created until the first “up”\n
* technically the VirtualBox VM isn’t created until the first “up”\n
* technically the VirtualBox VM isn’t created until the first “up”\n
* technically the VirtualBox VM isn’t created until the first “up”\n
* technically the VirtualBox VM isn’t created until the first “up”\n
Demo1 showing a box added to vagrant\nvagrant init lucid64\nvagrant up\nvagrant ssh\nvagrant status\n\n