core.rb 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 = "generic/ubuntu1604"
  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 "../..", "/home/vagrant/FrameworkBenchmarks", type: "nfs", nfs_udp: false
  20. end
  21. end
  22. def provider_virtualbox(config)
  23. config.vm.provider :virtualbox do |vb, override|
  24. override.vm.hostname = "TFB-all"
  25. override.vm.box = "ubuntu/xenial64"
  26. if ENV.fetch('TFB_SHOW_VM', false)
  27. vb.gui = true
  28. end
  29. # Improve Windows VirtualBox DNS resolution speed
  30. # Addresses mitchellh/vagrant#1807 and TechEmpower/FrameworkBenchmarks#1288
  31. vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  32. vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
  33. vb.memory = ENV.fetch('TFB_VB_MEM', 3022)
  34. vb.cpus = ENV.fetch('TFB_VB_CPU', 2)
  35. # The VirtualBox file system for shared folders (vboxfs)
  36. # does not support posix's chown/chmod - these can only
  37. # be set at mount time, and they are uniform for the entire
  38. # shared directory. To mitigate the effects, we set the
  39. # folders and files to 777 permissions.
  40. # With 777 and owner vagrant *most* of the software works ok.
  41. # Occasional issues are still possible.
  42. #
  43. # See mitchellh/vagrant#4997
  44. # See http://superuser.com/a/640028/136050
  45. override.vm.synced_folder "../..", "/home/vagrant/FrameworkBenchmarks"
  46. end
  47. end