Your SlideShare is downloading. ×
0
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Vagrant-Binding JUG Dortmund
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Vagrant-Binding JUG Dortmund

1,170

Published on

2 Comments
0 Likes
Statistics
Notes
  • Be the first to like this

No Downloads
Views
Total Views
1,170
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
19
Comments
2
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Lightweight and reproducible environments withVagrant & Puppet & Java
  • 2. About me•Hendrik Ebbers•Lead of development at SIC GmbH in Dortmund, Germany•Lead of JUG Dortmund•DataFX, JFXtras Contributor @hendrikEbbers www.guigarage.com hendrik.ebbers@web.de
  • 3. Content•Virtualization•Vagrant•Puppet•Java Vagrant-Binding API
  • 4. Virtualization
  • 5. Evolution of VMs achines Vir tual M VM tempMachines lates automated VM creation
  • 6. Antipattern by example
  • 7. By only u sing VMs we canrebuild any customersystem
  • 8. For ea ch new customerthe b est matching VM iscopied. S o no initial setupis needed!
  • 9. Why not deploy all linux64bit customerinstallat ions on one serverVM?
  • 10. Because we copy the VMs onour Laptop s when we travelto the Custo mer. And we onlyneed the system for oneCustomer then.
  • 11. So you have a virtualized rServe r for every Custome rkwhe re all developers woon?
  • 12. No only one de veloper works on sone VM. If a developer start eworkin g for a customer hsimp ly copies the VM ofanother developer.
  • 13. e rs l op e veD A B C D E Custom ers 1 2 3 4 5 6
  • 14. One month later...
  • 15. Some one u Eclips pdated e can our S t use VN.anymo it re
  • 16. Oh, it took m e 15 minutesto update Ec lipse and theSVN plugin
  • 17. And this was only the first of 50 VMs!!!
  • 18. Automated VM creation Vagrant Java Virtu alBox Puppet Chef
  • 19. Vagrant
  • 20. Vagrant Vagrant•configure virtual machines by script manage create•create new instances on the fly•manage the VM lifecycle VM
  • 21. Vagrant add template VM to Vagrant $ vagrant box add lucid32 http:// files.vagrantup.com/lucid32.box $ vagrant init lucid32 creates VM configuration-script $ vagrant up start the virtual machine
  • 22. Vagrant•build on top of VirtualBox•written in Ruby access by shell & Ruby
  • 23. Vagrant Ubuntu Lucid 32- & 64 -bit•provides 2 template boxes by default•simple config-files it´s just Ruby Vagrant::Config.run do |config| config.vm.box = "lucid32" end see great Vagrant documentation•easy ssh connection, shared folder, etc.
  • 24. Demo
  • 25. Puppet
  • 26. Puppet•configure your machines (nodes) by script•install and configure software & services
  • 27. Puppet class apache { exec { apt-get update: command => /usr/bin/apt-get update } package { "apache2": ensure => present, Ap ache2 is installed } & started on node service { "apache2": ensure => running, require => Package["apache2"], } } include apache
  • 28. Puppet•package individual components in modules•many online documentations & books out there
  • 29. Vagrant &Puppet
  • 30. Vagrant & Puppet•define your VM with Vagrant & configure it with Puppet•Puppet is pre-installed on Vagrant boxes
  • 31. Vagrant & Puppet VagrantfileVagrant::Config.run do |config| config.vm.box = "lucid32" config.vm.provision :puppet do |puppet| puppet.manifests_path = "manifests" puppet.manifest_file = "my_manifest.pp" endend ppet script path to Pu
  • 32. Demo
  • 33. Vagrant-Binding manage co nfigure & VMs in Java
  • 34. Vagrant-Binding•Java Wrapper around Vagrant•create & start VMs at runtime•only VirtualBox is required
  • 35. Vagrant-Binding•Builder APIs•JUnit support•Puppet support
  • 36. Builder APIVagrantVmConfig vmConfig = new VagrantVmConfigBuilder()! ! ! ! .withLucid32Box()! ! ! ! .withName("myLittleVm") builder API for VM! ! ! ! .withHostOnlyIp("192.168.50.4")! ! ! ! .build(); also builder APIVagrantEnvironment environment = ...; availableenvironment.up(); manage VM lifecycle! ! !environment.getVm(0).createConnection().execute("touch /tmp1");environment.destroy(); ssh connection
  • 37. Demo
  • 38. JUnit support st not reachable?@Testpublic void testJdbc() { what if ho dbHandler = new MySql(ip, db, user, pwd); dbHandler.createMyTable(); what if table already dbHandler.insertRow(); exists? assertEquals(1, dbHandler.getRowCount()); dbHandler.close(); parallel proces ses?}
  • 39. JUnit support@Rule JUnit annotation manage VM lifecyclepublic VagrantTestRule testRule = new VagrantTestRule(createConfig());public static VagrantConfiguration createConfig() { //Configure VM with MySQL-Server & static ip} use builder API for VM spec ification create VM start VM run UnitTest destroy VM
  • 40. Demo
  • 41. Puppet Forge accessFile moduleFolder = new File("...");PuppetForgeClient client = new PuppetForgeClient();! !! !List<PuppetForgeModuleDescription> allDescriptions =! client.findModules("mongodb"); search! !for(PuppetForgeModuleDescription desc : allDescriptions) {! System.out.println("Installing " + desc.getFullName());! PuppetForgeModule module = client.findModule(desc);! client.installToModulesDir(moduleFolder, module);} module at install as runtime
  • 42. Demo
  • 43. Vagrant-Binding fork me on github https://github.com/guigarage/vagrant-binding
  • 44. Roadmap • Remove VirtualBox as dependency (VMWare & AWS support) • Chef support • Simpler management of Environments • Better Builder APIs • Create Vagrant boxes at runtime
  • 45. Thanks forwatching @hendrikEbbers www.guigarage.com hendrik.ebbers@web.de

×