Preparing vagrant Maverick box¶
In this section we download one of existing box, run it, update and install software in it, and then repack it into new box. The later will be used for BornAgain compilation.
- Download mavericks box
Download osx-mavericks-0.1.0.box from https://github.com/AndrewDryga/vagrant-box-osx to ~/scg/deployment/vagrant/orig_boxes
Other boxes can be downloaded from https://atlas.hashicorp.com/boxes/search (search "osx" keyword)
- Software update in the box
vagrant box add mavericks /Users/scg/deployment/vagrant/orig_boxes/osx-mavericks-0.1.0.box
cd ~/scg/development/deployment/vagrant/projects/mavericks
vagrant init; vagrant up; vagrant ssh
softwareupdate --install --all # password vagrant
exit
- Updating the box second time
vagrant reload; vagrant ssh
softwareupdate --install --all # password vagrant
exit
- Updating homebrew, installing third party software for BornAgain
vagrant reload; vagrant ssh
sudo chown root /usr/local/bin/brew # not sure about it, it started to require it at some point
sudo brew update # type 'agree' to accept XCode license agreement
sudo brew install git cmake fftw gsl python homebrew/python/matplotlib numpy boost boost-python qt5 libtiff
Validate with 'brew doctor' that everything was installed correctly
- Modifying authorized_keys in the box with the key from server
copy from <scgmini>/.ssh/id_rsa.pub to <mavericks-dev>/.ssh/authorized_keys
copy from <scgmini>/.ssh/id_rsa to <mavericks-dev>/.ssh/id_rsathis is required because we use ssh to send dmg installer from the box back to the build server
- Remove energy saving
From scgmini monitor, run Virtualbox from Launchpad, then attach to running box
Turning off energy saving (set timeout to "Never") in the system preferences
Probably this can be done from command line too
- Setting up second python installation
It will be used during BornAgain compilation instead of Python from /usr/local
Download Anaconda2-2.4.0-MacOSX-x86_64.sh
Install it by "bash Anaconda2-2.4.0-MacOSX-x86_64.sh"
- Packaging box into new box
exit
vagrant package --output osx-mavericks-dev-1.0.box
vagrant destroy
mv osx-mavericks-dev-1.0.box ~/deployment/vagrant/orig_boxes/.
vagrant remove box mavericks
rm -r -f ~/deployment/vagrant/projects/mavericks
Using BornAgain mavericks box¶
- Preparing new box for the first time
mkdir ~/deployment/vagrant/projects/mavericks-dev; cd ~/deployment/vagrant/projects/mavericks-dev
vagrant box add mavericks-dev /Users/scg/deployment/vagrant/orig_boxes/osx-mavericks-dev-1.0.box
- Linking Vagrant files from BornAgain repository
These files contains virtual machine tunings and build recipy. BornAgain repository is in /Users/scg/development/BornAgain/BornAgain. Create links to the configuration in 'mavericks-dev' directory.
cd ~/deployment/vagrant/projects/mavericks-dev
ln -s ~/development/BornAgain/BornAgain/dev-tools/deployment/mavericks-dev/Vagrantfile .
ln -s ~/development/BornAgain/BornAgain/dev-tools/deployment/mavericks-dev/build_bornagain.sh .
- Running box
cd ~/deployment/vagrant/projects/mavericks-dev
vagrant up
vagrant ssh
Links¶
- Discussion about nfs and Mavericks
https://github.com/mitchellh/vagrant/issues/1744
http://askubuntu.com/questions/412525/vagrant-up-and-annoying-nfs-password-asking/519841
https://github.com/mitchellh/vagrant/issues/2319
- Discussion and ssh configuration
https://www.phase2technology.com/blog/running-an-ssh-agent-with-vagrant/
https://coderwall.com/p/uzkokw/configure-the-vagrant-login-user-during-provisioning-using-the-shell-provider
- Known Issues of OS X on Virtualbox
- Vagrant files of other peoples