core.rb 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. def provision_bootstrap(config)
  2. # TODO this will break if the environment contains the ' delimiter,
  3. # so at some point we need to escape the ' character here and unescape
  4. # it in bootstrap.sh
  5. config.vm.provision "shell" do |sh|
  6. sh.path = "bootstrap.sh"
  7. sh.privileged = false
  8. end
  9. end
  10. def provider_libvirt(config)
  11. config.vm.provider :libvirt do |virt, override|
  12. override.vm.hostname = "TFB-all"
  13. override.vm.box = "RX14/trusty64"
  14. unless ENV.fetch('TFB_SHOW_VM', false)
  15. virt.graphics_type = "none"
  16. end
  17. virt.memory = ENV.fetch('TFB_KVM_MEM', 3022)
  18. virt.cpus = ENV.fetch('TFB_KVM_CPU', 2)
  19. override.vm.synced_folder "../../toolset", "/home/vagrant/FrameworkBenchmarks/toolset", type: "nfs"
  20. override.vm.synced_folder "../../frameworks", "/home/vagrant/FrameworkBenchmarks/frameworks", type: "nfs"
  21. override.vm.synced_folder "../../results", "/home/vagrant/FrameworkBenchmarks/results", type: "nfs", create: true
  22. end
  23. end
  24. def provider_virtualbox(config)
  25. config.vm.provider :virtualbox do |vb, override|
  26. override.vm.hostname = "TFB-all"
  27. override.vm.box = "ubuntu/trusty64"
  28. if ENV.fetch('TFB_SHOW_VM', false)
  29. vb.gui = true
  30. end
  31. # Improve Windows VirtualBox DNS resolution speed
  32. # Addresses mitchellh/vagrant#1807 and TechEmpower/FrameworkBenchmarks#1288
  33. vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  34. vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
  35. vb.memory = ENV.fetch('TFB_VB_MEM', 3022)
  36. vb.cpus = ENV.fetch('TFB_VB_CPU', 2)
  37. # The VirtualBox file system for shared folders (vboxfs)
  38. # does not support posix's chown/chmod - these can only
  39. # be set at mount time, and they are uniform for the entire
  40. # shared directory. To mitigate the effects, we set the
  41. # folders and files to 777 permissions.
  42. # With 777 and owner vagrant *most* of the software works ok.
  43. # Occasional issues are still possible.
  44. #
  45. # See mitchellh/vagrant#4997
  46. # See http://superuser.com/a/640028/136050
  47. override.vm.synced_folder "../../toolset", "/home/vagrant/FrameworkBenchmarks/toolset"
  48. override.vm.synced_folder "../../frameworks", "/home/vagrant/FrameworkBenchmarks/frameworks"
  49. override.vm.synced_folder "../../results", "/home/vagrant/FrameworkBenchmarks/results", create: true
  50. end
  51. end