core.rb 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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/ubuntu1804"
  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/bionic64"
  26. # Allow increase in size for /dev/sda1
  27. # Would need plugin:
  28. # vagrant plugin install vagrant-disksize
  29. if ENV.fetch('TFB_DISKSIZE', "0") != "0"
  30. override.disksize.size = ENV.fetch('TFB_DISKSIZE')
  31. end
  32. if ENV.fetch('TFB_SHOW_VM', false)
  33. vb.gui = true
  34. end
  35. # Improve Windows VirtualBox DNS resolution speed
  36. # Addresses mitchellh/vagrant#1807 and TechEmpower/FrameworkBenchmarks#1288
  37. vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
  38. vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
  39. vb.memory = ENV.fetch('TFB_VB_MEM', 3022)
  40. vb.cpus = ENV.fetch('TFB_VB_CPU', 2)
  41. # The VirtualBox file system for shared folders (vboxfs)
  42. # does not support posix's chown/chmod - these can only
  43. # be set at mount time, and they are uniform for the entire
  44. # shared directory. To mitigate the effects, we set the
  45. # folders and files to 777 permissions.
  46. # With 777 and owner vagrant *most* of the software works ok.
  47. # Occasional issues are still possible.
  48. #
  49. # See mitchellh/vagrant#4997
  50. # See http://superuser.com/a/640028/136050
  51. override.vm.synced_folder "../..", "/home/vagrant/FrameworkBenchmarks"
  52. end
  53. end