cd <vespa-source>/vagrant
export VESPA_VAGRANT_VM_BOX=centos/7
export VESPA_VAGRANT_DISABLE_GUI=true
Create centos7-desktop box:
-
Install packer by following guide at packer.io
-
Clone boxcutter centos repo and build the box:
git clone https://github.com/boxcutter/centos.git
./bin/box build centos7-desktop.json virtualbox
Example exports:
export VESPA_VAGRANT_VM_BOX="centos7-desktop"
export VESPA_VAGRANT_VM_BOX_URL="$HOME/git/boxcutter/centos/box/virtualbox/centos7-desktop-xx.yyyy.z.box"
This is required for mounting shared folders and get mouse pointer integration and seamless windows in the virtual CentOS desktop.
vagrant plugin install vagrant-vbguest
vagrant up
SSH agent forwarding is enabled to ensure easy interaction with GitHub inside the machine.
vagrant ssh
This is needed in order to compile and run tests fast on the local file system inside the virtual machine.
git clone [email protected]:vespa-engine/vespa.git
Please follow the build instructions described here.
Please follow the build instructions described here. Skip these steps if doing development with CLion.
CLion is installed as part of the environment and is recommended for C++ development.
cd to the vespa/ directory created by git clone and execute:
./bootstrap.sh java
./bootstrap-cpp.sh . .
Open a terminal inside the virtual CentOS desktop (password is "vagrant") and run:
clion
When prompted, configure toolchains as follows:
CMake: /usr/bin/cmake3
Make: /usr/bin/make
C Compiler: /opt/rh/devtoolset-8/root/usr/bin/cc
C++ Compiler: /opt/rh/devtoolset-8/root/usr/bin/c++
Go to File -> Open and choose <vespa-source>>/CMakeLists.txt.
Go to File -> Settings -> Build, Execution, Deployment -> CMake. Under Build Options specify "-j 4" and click Apply.
./bootstrap-cpp.sh . .
(Some of the changes made by it are undone by clion on the first startup.)
Choose target all_modules from the set of build targets at the top right and click build.
Use vagrant suspend
to suspend the machine and then vagrant resume
to resume it later on.
Alternatively use vagrant halt
+ vagrant up
to shutdown and reboot. Latter approach is slower but requires less disk space since RAM content is not persisted to host.