Vagrantfile 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626
  1. # -*- mode: ruby -*-
  2. # vi: set ft=ruby :
  3. # Automated creation of testing environments / binaries on misc. platforms
  4. $cpus = Integer(ENV.fetch('VMCPUS', '4')) # create VMs with that many cpus
  5. $xdistn = Integer(ENV.fetch('XDISTN', '4')) # dispatch tests to that many pytest workers
  6. $wmem = $xdistn * 256 # give the VM additional memory for workers [MB]
  7. def packages_prepare_wheezy
  8. return <<-EOF
  9. # debian 7 wheezy does not have lz4, but it is available from wheezy-backports:
  10. echo "deb http://http.debian.net/debian wheezy-backports main" > /etc/apt/sources.list.d/wheezy-backports.list
  11. EOF
  12. end
  13. def packages_debianoid(user)
  14. return <<-EOF
  15. export DEBIAN_FRONTEND=noninteractive
  16. apt-get update
  17. # install all the (security and other) updates
  18. apt-get dist-upgrade -y
  19. # for building borgbackup and dependencies:
  20. apt-get install -y libssl-dev libacl1-dev liblz4-dev libfuse-dev fuse pkg-config
  21. usermod -a -G fuse #{user}
  22. chgrp fuse /dev/fuse
  23. chmod 666 /dev/fuse
  24. apt-get install -y fakeroot build-essential git
  25. apt-get install -y python3-dev python3-setuptools
  26. # for building python:
  27. apt-get install -y zlib1g-dev libbz2-dev libncurses5-dev libreadline-dev liblzma-dev libsqlite3-dev
  28. # this way it works on older dists (like ubuntu 12.04) also:
  29. # for python 3.2 on ubuntu 12.04 we need pip<8 and virtualenv<14 as
  30. # newer versions are not compatible with py 3.2 any more.
  31. if which easy_install3 2> /dev/null; then
  32. # works up to xenial / stretch
  33. easy_install3 -i https://pypi.python.org/simple/ 'pip<8.0'
  34. pip3 install 'virtualenv<14.0'
  35. else
  36. # works on recent debian / ubuntu
  37. apt-get install -y python3-pip virtualenv python3-virtualenv
  38. fi
  39. EOF
  40. end
  41. def packages_redhatted
  42. return <<-EOF
  43. yum install -y epel-release
  44. yum update -y
  45. # for building borgbackup and dependencies:
  46. yum install -y openssl-devel openssl libacl-devel libacl lz4-devel fuse-devel fuse pkgconfig
  47. usermod -a -G fuse vagrant
  48. chgrp fuse /dev/fuse
  49. chmod 666 /dev/fuse
  50. yum install -y fakeroot gcc git patch
  51. # needed to compile msgpack-python (otherwise it will use slow fallback code):
  52. yum install -y gcc-c++
  53. # for building python:
  54. yum install -y zlib-devel bzip2-devel ncurses-devel readline-devel xz xz-devel sqlite-devel
  55. #yum install -y python-pip
  56. #pip install virtualenv
  57. EOF
  58. end
  59. def packages_darwin
  60. return <<-EOF
  61. # install all the (security and other) updates
  62. # note: the base machine is old and as uptodate as it gets,
  63. # thus we do not need to install updates for the OS.
  64. #sudo softwareupdate --ignore iTunesX
  65. #sudo softwareupdate --ignore iTunes
  66. #sudo softwareupdate --ignore "Install macOS High Sierra"
  67. #sudo softwareupdate --install --all
  68. # get osxfuse 3.x release code from github:
  69. curl -s -L https://github.com/osxfuse/osxfuse/releases/download/osxfuse-3.10.4/osxfuse-3.10.4.dmg >osxfuse.dmg
  70. MOUNTDIR=$(echo `hdiutil mount osxfuse.dmg | tail -1 | awk '{$1="" ; print $0}'` | xargs -0 echo) \
  71. && sudo installer -pkg "${MOUNTDIR}/Extras/FUSE for macOS 3.10.4.pkg" -target /
  72. sudo chown -R vagrant /usr/local # brew must be able to create stuff here
  73. # brew is already installed in the base box
  74. #ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  75. brew update
  76. brew install openssl || brew upgrade openssl
  77. brew install lz4 || brew upgrade lz4
  78. brew install xz || brew upgrade xz # required for python lzma module
  79. brew install fakeroot || brew upgrade fakeroot
  80. brew install git || brew upgrade git
  81. brew install pkg-config || brew upgrade pkg-config
  82. EOF
  83. end
  84. def packages_freebsd
  85. return <<-EOF
  86. # VM has no hostname set
  87. hostname freebsd
  88. # install all the (security and other) updates, base system
  89. freebsd-update --not-running-from-cron fetch install
  90. # for building borgbackup and dependencies:
  91. pkg install -y openssl liblz4 fusefs-libs pkgconf
  92. pkg install -y git bash
  93. # for building python:
  94. pkg install -y sqlite3
  95. # make bash default / work:
  96. chsh -s bash vagrant
  97. mount -t fdescfs fdesc /dev/fd
  98. echo 'fdesc /dev/fd fdescfs rw 0 0' >> /etc/fstab
  99. # make FUSE work
  100. echo 'fuse_load="YES"' >> /boot/loader.conf
  101. echo 'vfs.usermount=1' >> /etc/sysctl.conf
  102. kldload fuse
  103. sysctl vfs.usermount=1
  104. pw groupmod operator -M vagrant
  105. # /dev/fuse has group operator
  106. chmod 666 /dev/fuse
  107. # install all the (security and other) updates, packages
  108. pkg update
  109. yes | pkg upgrade
  110. EOF
  111. end
  112. def packages_openbsd
  113. return <<-EOF
  114. pkg_add bash
  115. chsh -s /usr/local/bin/bash vagrant
  116. pkg_add lz4
  117. pkg_add zstd
  118. pkg_add git # no fakeroot
  119. pkg_add py3-pip
  120. pkg_add py3-virtualenv
  121. ln -sf /usr/local/bin/virtualenv-3 /usr/local/bin/virtualenv
  122. EOF
  123. end
  124. def packages_netbsd
  125. return <<-EOF
  126. hostname netbsd # the box we use has an invalid hostname
  127. PKG_PATH="ftp://ftp.NetBSD.org/pub/pkgsrc/packages/NetBSD/amd64/7.0.1/All"
  128. export PKG_PATH
  129. pkg_add mozilla-rootcerts lz4 git
  130. chsh -s bash vagrant
  131. mkdir -p /usr/local/opt/lz4/include
  132. mkdir -p /usr/local/opt/lz4/lib
  133. ln -s /usr/pkg/include/lz4*.h /usr/local/opt/lz4/include/
  134. ln -s /usr/pkg/lib/liblz4* /usr/local/opt/lz4/lib/
  135. touch /etc/openssl/openssl.cnf # avoids a flood of "can't open ..."
  136. mozilla-rootcerts install
  137. pkg_add pkg-config # avoids some "pkg-config missing" error msg, even without fuse pkg
  138. # pkg_add fuse # llfuse supports netbsd, but is still buggy.
  139. # https://bitbucket.org/nikratio/python-llfuse/issues/70/perfuse_open-setsockopt-no-buffer-space
  140. pkg_add python37 py37-sqlite3 py37-pip py37-virtualenv
  141. ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python
  142. ln -s /usr/pkg/bin/python3.7 /usr/pkg/bin/python3
  143. ln -s /usr/pkg/bin/pip3.7 /usr/pkg/bin/pip
  144. ln -s /usr/pkg/bin/pip3.7 /usr/pkg/bin/pip3
  145. ln -s /usr/pkg/bin/virtualenv-3.7 /usr/pkg/bin/virtualenv
  146. ln -s /usr/pkg/bin/virtualenv-3.7 /usr/pkg/bin/virtualenv3
  147. EOF
  148. end
  149. def packages_openindiana
  150. return <<-EOF
  151. # needs separate provisioning step + reboot:
  152. #pkg update
  153. # already installed:
  154. #pkg install python-35 virtualenv-35 pip-35 clang-40 lz4 zstd git
  155. ln -sf /usr/bin/python3.5 /usr/bin/pyton3
  156. ln -sf /usr/bin/virtualenv-3.5 /usr/bin/virtualenv
  157. ln -sf /usr/bin/pip-3.5 /usr/bin/pip
  158. EOF
  159. end
  160. # Install required cygwin packages and configure environment
  161. #
  162. # Microsoft/EdgeOnWindows10 image has MLS-OpenSSH installed by default,
  163. # which is based on cygwin x86_64 but should not be used together with cygwin.
  164. # In order to have have cygwin compatible bash 'ImagePath' is replaced with
  165. # cygrunsrv of newly installed cygwin
  166. #
  167. # supported cygwin versions:
  168. # x86_64
  169. # x86
  170. def packages_cygwin(version)
  171. setup_exe = "setup-#{version}.exe"
  172. return <<-EOF
  173. mkdir -p /cygdrive/c/cygwin
  174. powershell -Command '$client = new-object System.Net.WebClient; $client.DownloadFile("https://www.cygwin.com/#{setup_exe}","C:\\cygwin\\#{setup_exe}")'
  175. echo '
  176. REM --- Change to use different CygWin platform and final install path
  177. set CYGSETUP=#{setup_exe}
  178. REM --- Install build version of CygWin in a subfolder
  179. set OURPATH=%cd%
  180. set CYGBUILD="C:\\cygwin\\CygWin"
  181. set CYGMIRROR=http://mirrors.kernel.org/sourceware/cygwin/
  182. set BASEPKGS=openssh,rsync
  183. set BUILDPKGS=python3,python3-setuptools,python-devel,binutils,gcc-g++,libopenssl,openssl-devel,git,make,liblz4-devel,liblz4_1,curl
  184. %CYGSETUP% -q -B -o -n -R %CYGBUILD% -L -D -s %CYGMIRROR% -P %BASEPKGS%,%BUILDPKGS%
  185. cd /d C:\\cygwin\\CygWin\\bin
  186. regtool set /HKLM/SYSTEM/CurrentControlSet/Services/OpenSSHd/ImagePath "C:\\cygwin\\CygWin\\bin\\cygrunsrv.exe"
  187. bash -c "ssh-host-config --no"
  188. bash -c "chown sshd_server /cygdrive/c/cygwin/CygWin/var/empty"
  189. ' > /cygdrive/c/cygwin/install.bat
  190. echo "alias mkdir='mkdir -p'" > ~/.profile
  191. echo "export CYGWIN_ROOT=/cygdrive/c/cygwin/CygWin" >> ~/.profile
  192. echo 'export PATH=$CYGWIN_ROOT/bin:$PATH' >> ~/.profile
  193. echo '' > ~/.bash_profile
  194. cmd.exe /c 'setx /m PATH "C:\\cygwin\\CygWin\\bin;%PATH%"'
  195. source ~/.profile
  196. cd /cygdrive/c/cygwin && cmd.exe /c install.bat
  197. echo 'db_home: windows' > $CYGWIN_ROOT/etc/nsswitch.conf
  198. EOF
  199. end
  200. def install_cygwin_venv
  201. return <<-EOF
  202. python3 -m ensurepip -U --default-pip
  203. pip install virtualenv
  204. EOF
  205. end
  206. def install_pyenv(boxname)
  207. script = <<-EOF
  208. curl -s -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash
  209. echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
  210. echo 'eval "$(pyenv init -)"' >> ~/.bash_profile
  211. echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.bash_profile
  212. echo 'export PYTHON_CONFIGURE_OPTS="--enable-shared"' >> ~/.bash_profile
  213. EOF
  214. return script
  215. end
  216. def fix_pyenv_darwin(boxname)
  217. return <<-EOF
  218. echo 'export PYTHON_CONFIGURE_OPTS="--enable-framework"' >> ~/.bash_profile
  219. EOF
  220. end
  221. def install_pythons(boxname)
  222. return <<-EOF
  223. . ~/.bash_profile
  224. pyenv install 3.5.3 # tests, 3.5.3 is first to support openssl 1.1
  225. pyenv install 3.6.2 # tests
  226. pyenv install 3.7.0 # tests
  227. pyenv install 3.8.0 # tests
  228. pyenv install 3.5.9 # binary build, use latest 3.5.x release
  229. pyenv rehash
  230. EOF
  231. end
  232. def build_sys_venv(boxname)
  233. return <<-EOF
  234. . ~/.bash_profile
  235. cd /vagrant/borg
  236. virtualenv --python=python3 borg-env
  237. EOF
  238. end
  239. def build_pyenv_venv(boxname)
  240. return <<-EOF
  241. . ~/.bash_profile
  242. cd /vagrant/borg
  243. # use the latest 3.5 release
  244. pyenv global 3.5.9
  245. pyenv virtualenv 3.5.9 borg-env
  246. ln -s ~/.pyenv/versions/borg-env .
  247. EOF
  248. end
  249. def install_borg(fuse)
  250. script = <<-EOF
  251. . ~/.bash_profile
  252. cd /vagrant/borg
  253. . borg-env/bin/activate
  254. pip install -U wheel # upgrade wheel, too old for 3.5
  255. cd borg
  256. pip install -r requirements.d/development.lock.txt
  257. python setup.py clean
  258. EOF
  259. if fuse
  260. script += <<-EOF
  261. # by using [fuse], setup.py can handle different FUSE requirements:
  262. pip install -e .[fuse]
  263. EOF
  264. else
  265. script += <<-EOF
  266. pip install -e .
  267. # do not install llfuse into the virtualenvs built by tox:
  268. sed -i.bak '/fuse.txt/d' tox.ini
  269. EOF
  270. end
  271. return script
  272. end
  273. def install_pyinstaller()
  274. return <<-EOF
  275. . ~/.bash_profile
  276. cd /vagrant/borg
  277. . borg-env/bin/activate
  278. git clone https://github.com/thomaswaldmann/pyinstaller.git
  279. cd pyinstaller
  280. git checkout v3.2.1
  281. python setup.py install
  282. EOF
  283. end
  284. def build_binary_with_pyinstaller(boxname)
  285. return <<-EOF
  286. . ~/.bash_profile
  287. cd /vagrant/borg
  288. . borg-env/bin/activate
  289. cd borg
  290. pyinstaller --clean --distpath=/vagrant/borg scripts/borg.exe.spec
  291. echo 'export PATH="/vagrant/borg:$PATH"' >> ~/.bash_profile
  292. EOF
  293. end
  294. def run_tests(boxname)
  295. return <<-EOF
  296. . ~/.bash_profile
  297. cd /vagrant/borg/borg
  298. . ../borg-env/bin/activate
  299. if which pyenv 2> /dev/null; then
  300. # for testing, use the earliest point releases of the supported python versions:
  301. pyenv global 3.5.3 3.6.2 3.7.0 3.8.0
  302. pyenv local 3.5.3 3.6.2 3.7.0 3.8.0
  303. fi
  304. # otherwise: just use the system python
  305. if which fakeroot 2> /dev/null; then
  306. echo "Running tox WITH fakeroot -u"
  307. fakeroot -u tox --skip-missing-interpreters
  308. else
  309. echo "Running tox WITHOUT fakeroot -u"
  310. tox --skip-missing-interpreters
  311. fi
  312. EOF
  313. end
  314. def fs_init(user)
  315. return <<-EOF
  316. # clean up (wrong/outdated) stuff we likely got via rsync:
  317. rm -rf /vagrant/borg/borg/.tox 2> /dev/null
  318. rm -rf /vagrant/borg/borg/borgbackup.egg-info 2> /dev/null
  319. rm -rf /vagrant/borg/borg/__pycache__ 2> /dev/null
  320. find /vagrant/borg/borg/src -name '__pycache__' -exec rm -rf {} \\; 2> /dev/null
  321. chown -R #{user} /vagrant/borg
  322. touch ~#{user}/.bash_profile ; chown #{user} ~#{user}/.bash_profile
  323. echo 'export LANG=en_US.UTF-8' >> ~#{user}/.bash_profile
  324. echo 'export LC_CTYPE=en_US.UTF-8' >> ~#{user}/.bash_profile
  325. echo 'export XDISTN=#{$xdistn}' >> ~#{user}/.bash_profile
  326. EOF
  327. end
  328. Vagrant.configure(2) do |config|
  329. # use rsync to copy content to the folder
  330. config.vm.synced_folder ".", "/vagrant/borg/borg", :type => "rsync", :rsync__args => ["--verbose", "--archive", "--delete", "-z"], :rsync__chown => false
  331. # do not let the VM access . on the host machine via the default shared folder!
  332. config.vm.synced_folder ".", "/vagrant", disabled: true
  333. config.vm.provider :virtualbox do |v|
  334. #v.gui = true
  335. v.cpus = $cpus
  336. end
  337. # Linux
  338. config.vm.define "centos7_64" do |b|
  339. b.vm.box = "centos/7"
  340. b.vm.provider :virtualbox do |v|
  341. v.memory = 1024 + $wmem
  342. end
  343. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  344. b.vm.provision "install system packages", :type => :shell, :inline => packages_redhatted
  345. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("centos7_64")
  346. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("centos7_64")
  347. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("centos7_64")
  348. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  349. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("centos7_64")
  350. end
  351. config.vm.define "focal64" do |b|
  352. b.vm.box = "ubuntu/focal64"
  353. b.vm.provider :virtualbox do |v|
  354. v.memory = 1024 + $wmem
  355. end
  356. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  357. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  358. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("focal64")
  359. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  360. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("focal64")
  361. end
  362. config.vm.define "bionic64" do |b|
  363. b.vm.box = "ubuntu/bionic64"
  364. b.vm.provider :virtualbox do |v|
  365. v.memory = 1024 + $wmem
  366. end
  367. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  368. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  369. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("bionic64")
  370. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  371. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("bionic64")
  372. end
  373. config.vm.define "xenial64" do |b|
  374. b.vm.box = "ubuntu/xenial64"
  375. b.vm.provider :virtualbox do |v|
  376. v.memory = 1024 + $wmem
  377. end
  378. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  379. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  380. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("xenial64")
  381. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  382. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("xenial64")
  383. end
  384. config.vm.define "trusty64" do |b|
  385. b.vm.box = "ubuntu/trusty64"
  386. b.vm.provider :virtualbox do |v|
  387. v.memory = 1024 + $wmem
  388. end
  389. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  390. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  391. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("trusty64")
  392. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  393. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("trusty64")
  394. end
  395. config.vm.define "buster64" do |b|
  396. b.vm.box = "debian/buster64"
  397. b.vm.provider :virtualbox do |v|
  398. v.memory = 1024 + $wmem
  399. end
  400. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  401. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  402. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("buster64")
  403. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  404. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("buster64")
  405. end
  406. config.vm.define "stretch64" do |b|
  407. b.vm.box = "debian/stretch64"
  408. b.vm.provider :virtualbox do |v|
  409. v.memory = 1024 + $wmem
  410. end
  411. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  412. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  413. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("stretch64")
  414. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  415. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("stretch64")
  416. end
  417. config.vm.define "jessie32" do |b|
  418. b.vm.box = "debian8-i386"
  419. b.vm.provider :virtualbox do |v|
  420. v.memory = 768 + $wmem
  421. end
  422. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  423. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  424. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("jessie32")
  425. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("jessie32")
  426. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("jessie32")
  427. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  428. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  429. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("jessie32")
  430. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie32")
  431. end
  432. config.vm.define "jessie64" do |b|
  433. b.vm.box = "debian8-amd64"
  434. b.vm.provider :virtualbox do |v|
  435. v.memory = 1024 + $wmem
  436. end
  437. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  438. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  439. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("jessie64")
  440. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("jessie64")
  441. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("jessie64")
  442. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  443. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  444. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("jessie64")
  445. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("jessie64")
  446. end
  447. config.vm.define "wheezy32" do |b|
  448. b.vm.box = "debian7-i386"
  449. b.vm.provider :virtualbox do |v|
  450. v.memory = 768 + $wmem
  451. end
  452. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  453. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  454. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  455. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy32")
  456. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy32")
  457. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy32")
  458. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  459. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  460. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy32")
  461. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy32")
  462. end
  463. config.vm.define "wheezy64" do |b|
  464. b.vm.box = "debian7-amd64"
  465. b.vm.provider :virtualbox do |v|
  466. v.memory = 1024 + $wmem
  467. end
  468. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  469. b.vm.provision "packages prepare wheezy", :type => :shell, :inline => packages_prepare_wheezy
  470. b.vm.provision "packages debianoid", :type => :shell, :inline => packages_debianoid("vagrant")
  471. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("wheezy64")
  472. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("wheezy64")
  473. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("wheezy64")
  474. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  475. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  476. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("wheezy64")
  477. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("wheezy64")
  478. end
  479. # OS X
  480. config.vm.define "darwin64" do |b|
  481. b.vm.box = "macos1010"
  482. b.vm.provider :virtualbox do |v|
  483. v.memory = 1536 + $wmem
  484. v.customize ['modifyvm', :id, '--ostype', 'MacOS1010_64']
  485. v.customize ['modifyvm', :id, '--paravirtprovider', 'default']
  486. # Adjust CPU settings according to
  487. # https://github.com/geerlingguy/macos-virtualbox-vm
  488. v.customize ['modifyvm', :id, '--cpuidset',
  489. '00000001', '000306a9', '00020800', '80000201', '178bfbff']
  490. # Disable USB variant requiring Virtualbox proprietary extension pack
  491. v.customize ["modifyvm", :id, '--usbehci', 'off', '--usbxhci', 'off']
  492. end
  493. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  494. b.vm.provision "packages darwin", :type => :shell, :privileged => false, :inline => packages_darwin
  495. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("darwin64")
  496. b.vm.provision "fix pyenv", :type => :shell, :privileged => false, :inline => fix_pyenv_darwin("darwin64")
  497. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("darwin64")
  498. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("darwin64")
  499. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  500. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  501. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("darwin64")
  502. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("darwin64")
  503. end
  504. # BSD
  505. config.vm.define "freebsd64" do |b|
  506. b.vm.box = "freebsd64" # custom FreeBSD 10.3 box. official ones are broken, #3022.
  507. b.vm.provider :virtualbox do |v|
  508. v.memory = 1024 + $wmem
  509. end
  510. b.ssh.shell = "sh"
  511. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  512. b.vm.provision "install system packages", :type => :shell, :inline => packages_freebsd
  513. b.vm.provision "install pyenv", :type => :shell, :privileged => false, :inline => install_pyenv("freebsd")
  514. b.vm.provision "install pythons", :type => :shell, :privileged => false, :inline => install_pythons("freebsd")
  515. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_pyenv_venv("freebsd")
  516. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(true)
  517. b.vm.provision "install pyinstaller", :type => :shell, :privileged => false, :inline => install_pyinstaller()
  518. b.vm.provision "build binary with pyinstaller", :type => :shell, :privileged => false, :inline => build_binary_with_pyinstaller("freebsd")
  519. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("freebsd")
  520. end
  521. config.vm.define "openbsd64" do |b|
  522. b.vm.box = "openbsd64-64" # note: basic openbsd install for vagrant WITH sudo and rsync pre-installed
  523. b.vm.provider :virtualbox do |v|
  524. v.memory = 1024 + $wmem
  525. end
  526. b.ssh.shell = "sh"
  527. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  528. b.vm.provision "packages openbsd", :type => :shell, :inline => packages_openbsd
  529. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openbsd64")
  530. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  531. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openbsd64")
  532. end
  533. config.vm.define "netbsd64" do |b|
  534. b.vm.box = "netbsd70-64"
  535. b.vm.provider :virtualbox do |v|
  536. v.memory = 1024 + $wmem
  537. end
  538. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  539. b.vm.provision "packages netbsd", :type => :shell, :inline => packages_netbsd
  540. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("netbsd64")
  541. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  542. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("netbsd64")
  543. end
  544. # rsync on openindiana has troubles, does not set correct owner for /vagrant/borg and thus gives lots of
  545. # permission errors. can be manually fixed in the VM by: sudo chown -R vagrant /vagrant/borg ; then rsync again.
  546. config.vm.define "openindiana64" do |b|
  547. b.vm.box = "openindiana"
  548. b.vm.provider :virtualbox do |v|
  549. v.memory = 1536 + $wmem
  550. end
  551. b.vm.provision "fs init", :type => :shell, :inline => fs_init("vagrant")
  552. b.vm.provision "packages openindiana", :type => :shell, :inline => packages_openindiana
  553. b.vm.provision "build env", :type => :shell, :privileged => false, :inline => build_sys_venv("openindiana64")
  554. b.vm.provision "install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  555. b.vm.provision "run tests", :type => :shell, :privileged => false, :inline => run_tests("openindiana64")
  556. end
  557. config.vm.define "windows10" do |b|
  558. b.vm.box = "Microsoft/EdgeOnWindows10"
  559. b.vm.guest = :windows
  560. b.vm.boot_timeout = 180
  561. b.vm.graceful_halt_timeout = 120
  562. b.ssh.shell = "sh -l"
  563. b.ssh.username = "IEUser"
  564. b.ssh.password = "Passw0rd!"
  565. b.ssh.insert_key = false
  566. b.vm.provider :virtualbox do |v|
  567. v.memory = 1536 + $wmem
  568. #v.gui = true
  569. end
  570. b.vm.provision "packages cygwin", :type => :shell, :privileged => false, :inline => packages_cygwin("x86_64")
  571. b.vm.provision :reload
  572. b.vm.provision "cygwin install pip", :type => :shell, :privileged => false, :inline => install_cygwin_venv
  573. b.vm.provision "cygwin build env", :type => :shell, :privileged => false, :inline => build_sys_venv("windows10")
  574. b.vm.provision "cygwin install borg", :type => :shell, :privileged => false, :inline => install_borg(false)
  575. b.vm.provision "cygwin run tests", :type => :shell, :privileged => false, :inline => run_tests("windows10")
  576. end
  577. end