vagrant at la ruby
TRANSCRIPT
![Page 1: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/1.jpg)
VagrantVirtualize your development environment.
Thursday, September 9, 2010
![Page 2: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/2.jpg)
Mitchell Hashimotogithub.com/mitchellhtwitter.com/mitchellh
Thursday, September 9, 2010
![Page 3: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/3.jpg)
$ git clone git://.../website.git...$ ???WTF!#A@#)!???...$ script/server...
Thursday, September 9, 2010
![Page 4: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/4.jpg)
$ git clone git://.../website.git...$ ???WTF!#A@#)!???...$ script/server...
Thursday, September 9, 2010
![Page 5: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/5.jpg)
Operating System
User space
WebServer
DBServer
AppServer
QueueServer
Other Server
Browser
IRC IM
EditorMusic
Thursday, September 9, 2010
![Page 6: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/6.jpg)
BIG PROBLEMS
Thursday, September 9, 2010
![Page 7: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/7.jpg)
BIG PROBLEMS1. No isolation (Oh sorry, is that Tweetie Server Edition™?)
Thursday, September 9, 2010
![Page 8: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/8.jpg)
BIG PROBLEMS1. No isolation (Oh sorry, is that Tweetie Server Edition™?)
2. Not repeatable (That README ain’t gonna run itself)
Thursday, September 9, 2010
![Page 9: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/9.jpg)
BIG PROBLEMS1. No isolation (Oh sorry, is that Tweetie Server Edition™?)
2. Not repeatable (That README ain’t gonna run itself)
3. No guarantees (But it works on my computer!!)
Thursday, September 9, 2010
![Page 10: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/10.jpg)
EC2, Slicehost, Linode, Xen, KVM, ...
VIRTUALIZATION!
Thursday, September 9, 2010
![Page 11: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/11.jpg)
EC2, Slicehost, Linode, Xen, KVM, ...
VIRTUALIZATION!
Thursday, September 9, 2010
![Page 12: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/12.jpg)
Operating System
User space
WebServer
DBServer
AppServer
QueueServer
Other Server
Browser
IRC IM
EditorMusic
Thursday, September 9, 2010
![Page 13: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/13.jpg)
Operating System
User space
Browser
IRC IM
Editor
Virtualized OS
Web Server
DB Server
App Server
Thursday, September 9, 2010
![Page 14: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/14.jpg)
PROBLEMS SOLVED
Thursday, September 9, 2010
![Page 15: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/15.jpg)
PROBLEMS SOLVED1. Isolation
Thursday, September 9, 2010
![Page 16: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/16.jpg)
PROBLEMS SOLVED1. Isolation
2. Repeatable
Thursday, September 9, 2010
![Page 17: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/17.jpg)
PROBLEMS SOLVED1. Isolation
2. Repeatable
3. Guarantees
Thursday, September 9, 2010
![Page 18: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/18.jpg)
BUSINESS BENEFITS
Thursday, September 9, 2010
![Page 19: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/19.jpg)
BUSINESS BENEFITS• Lower resource on-boarding time
Thursday, September 9, 2010
![Page 20: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/20.jpg)
BUSINESS BENEFITS• Lower resource on-boarding time
• Version controlled server infrastructure
Thursday, September 9, 2010
![Page 21: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/21.jpg)
BUSINESS BENEFITS• Lower resource on-boarding time
• Version controlled server infrastructure
• Designers get up and running in minutes
Thursday, September 9, 2010
![Page 22: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/22.jpg)
WHY NOW?(Why haven’t we been doing this all along?)
Thursday, September 9, 2010
![Page 23: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/23.jpg)
WHY NOW?
• Big companies have been!
(Why haven’t we been doing this all along?)
Thursday, September 9, 2010
![Page 24: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/24.jpg)
WHY NOW?
• Big companies have been!
• Only recently possible on local machines
(Why haven’t we been doing this all along?)
Thursday, September 9, 2010
![Page 25: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/25.jpg)
WHY NOW?
• Big companies have been!
• Only recently possible on local machines
๏ Low RAM cost (4 GB standard, 8 GB quickly coming)
(Why haven’t we been doing this all along?)
Thursday, September 9, 2010
![Page 26: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/26.jpg)
WHY NOW?
• Big companies have been!
• Only recently possible on local machines
๏ Low RAM cost (4 GB standard, 8 GB quickly coming)
๏ Desktop virtualization API
(Why haven’t we been doing this all along?)
Thursday, September 9, 2010
![Page 27: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/27.jpg)
VagrantVirtualize your development environment.
Thursday, September 9, 2010
![Page 28: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/28.jpg)
HIGH LEVEL OVERVIEW‣ Describe environment via versionable Vagrantfile
‣ Manage virtual machine lifecycle
‣ Share folder from host to guest via NFS
‣ Provide SSH access to instance
‣ Provision instance using Chef, Puppet, etc.
‣ Manage host/guest networking
Thursday, September 9, 2010
![Page 29: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/29.jpg)
Vagrantfile
• Describes the virtual machine environment in code
๏ One per project
๏ Commit to version control
๏ Pure Ruby - Limitless configuration.
Thursday, September 9, 2010
![Page 30: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/30.jpg)
Vagrant::Config.run do |config| config.vm.box = "lucid32"end
Vagrantfile
Thursday, September 9, 2010
![Page 31: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/31.jpg)
Virtual Machine Lifecycle
$ vagrant up$ vagrant halt$ vagrant suspend$ vagrant destroy$ vagrant reload$ vagrant ssh$ vagrant --help
‣ vagrant binary
‣ Completely managed from creation to destruction
๏ (and creation... and destruction... and creation... and so on!)
Thursday, September 9, 2010
![Page 32: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/32.jpg)
Shared Folders via NFS
‣ File changes on host are immediately mirrored in the VM
‣ Continue using your favorite editor on your machine!
‣ By default mounted to /vagrant in VM
Thursday, September 9, 2010
![Page 33: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/33.jpg)
DEMO
Thursday, September 9, 2010
![Page 34: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/34.jpg)
Onto the good stuff...(let’s make it useful)
Thursday, September 9, 2010
![Page 35: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/35.jpg)
Provisioning
• Use Chef, Puppet, Bash, etc. to provision your VM
๏ Repeatable! (BIG Problem #2, remember?)
๏ Use the same tools as production
Thursday, September 9, 2010
![Page 36: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/36.jpg)
Vagrant::Config.run do |config| config.vm.box = "lucid32" config.vm.provisioner = :chef_soloend
Provisioning
Thursday, September 9, 2010
![Page 37: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/37.jpg)
Networking
• Assign an IP to your VM
๏ Access VM using your own browser
Thursday, September 9, 2010
![Page 38: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/38.jpg)
Vagrant::Config.run do |config| config.vm.box = "lucid32" config.vm.provisioner = :chef_solo config.vm.network("33.33.33.10")end
Networking
Thursday, September 9, 2010
![Page 39: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/39.jpg)
DEMO
Thursday, September 9, 2010
![Page 40: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/40.jpg)
Other stuff...(no demos here, you can experiment)
Thursday, September 9, 2010
![Page 41: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/41.jpg)
Packaging
• Package built development environments
๏ vagrant package
๏ Distributable
๏ Minimize setup time
Thursday, September 9, 2010
![Page 42: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/42.jpg)
Multi-VM• Represent multi-server environments
๏ e.g. web + db + utility
Thursday, September 9, 2010
![Page 43: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/43.jpg)
Vagrant::Config.run do |config| config.vm.define :web do |web| # ... end
config.vm.define :db do |db| # ... endend
Multi-VM
Thursday, September 9, 2010
![Page 44: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/44.jpg)
Rake Integration
• Use vagrant as a library
๏ Invoke command line actions
๏ Custom SSH commands
Thursday, September 9, 2010
![Page 45: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/45.jpg)
require 'vagrant'
desc "Restart the web application"task :restart do env = Vagrant::Environment.load! env.ssh.execute do |ssh| ssh.exec!("touch /vagrant/tmp/restart.txt") endend
Rake Integration
Thursday, September 9, 2010
![Page 46: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/46.jpg)
Plugins (0.6)
• Extend Vagrant using a supported API
• Add new commands to vagrant binary
• Add new configuration options
• Modify existing commands
• e.g. vagrant rake - Just pass through arguments to rake on the VM.
Thursday, September 9, 2010
![Page 47: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/47.jpg)
Review
• Continue using your existing development tools
• Run your web app in a VM
• VM setup file (Vagrantfile) in version control
Thursday, September 9, 2010
![Page 48: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/48.jpg)
LOSE NOTHING. GAIN EVERYTHING.
Thursday, September 9, 2010
![Page 49: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/49.jpg)
VagrantVirtualize your development environment.
IN ACTION
Thursday, September 9, 2010
![Page 50: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/50.jpg)
• Vagrant for all projects since March
• Around 15 to 20 developers using it all day every day
• Unexpected: Unique testing not possible before
Thursday, September 9, 2010
![Page 51: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/51.jpg)
• All Rails projects since July on Vagrant
• Massive reduction in on-boarding difficulty for new hires
• Looking into using it for Java-based projects in the near future
Thursday, September 9, 2010
![Page 52: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/52.jpg)
• Multi-VM setup (web + db + flash media server)
• Solved: No easy way to emulate FMS on Mac.
• Forced devops good practices
• Example of successful distribution of boxes
Thursday, September 9, 2010
![Page 53: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/53.jpg)
About the Project• Current release: 0.5.4
• Started development in January. First release in March.
• 0.6 development well under way:
๏ 179 commits, 226 files changed, 4081 lines added, 5730 lines deleted.
๏ Aiming for release in about 4 weeks.
๏ Biggest release yet
Thursday, September 9, 2010
![Page 54: Vagrant at LA Ruby](https://reader031.vdocument.in/reader031/viewer/2022020314/58a422211a28abec1a8b6189/html5/thumbnails/54.jpg)
Getting Started + More Info
• Website: vagrantup.com
• IRC: #vagrant on Freenode
• Github: http://github.com/mitchellh/vagrant
Thursday, September 9, 2010