Vagrant Boxes

Our use of Vagrant boxes to perform builds has a happy side-effect: you can easily reproduce platform-specific build errors on your local system by running the exact same Vagrant box that CI runs.

The README in the devboxes repo has detailed instructions.

In particular, you must be in a Linux environment, and KVM must be installed and compatible with your hardware. Note that KVM will not work in WSL2 because WSL 2 is already a VM and you can't run KVM inside another hypervisor. For the same reason this won't work on EC2 instances.

A summary:

In the elastio/elastio repo, in the cli/vagrantboxes/ directory, run vagrant up BOXNAME to start a Vagrant box called BOXNAME. To see all the possible box names, run vagrant status. As of this writing the output is:

Current machine states:

amazon2-amd64-build             shutoff (libvirt)
amazon2-amd64-test              not created (libvirt)
debian8-amd64-build             not created (libvirt)
debian8-amd64-test              not created (libvirt)
debian9-amd64-build             not created (libvirt)
debian9-amd64-test              not created (libvirt)
debian10-amd64-build            running (libvirt)
debian10-amd64-test             not created (libvirt)
debian11-amd64-build            not created (libvirt)
debian11-amd64-test             not created (libvirt)
centos7-amd64-build             not created (libvirt)
centos7-amd64-test              not created (libvirt)
centos8-amd64-build             not created (libvirt)
centos8-amd64-test              not created (libvirt)
fedora31-amd64-build            not created (libvirt)
fedora31-amd64-test             not created (libvirt)
fedora34-amd64-build            not created (libvirt)
fedora34-amd64-test             not created (libvirt)
fedora35-amd64-build            not created (libvirt)
fedora35-amd64-test             not created (libvirt)
ubuntu2004-amd64-build          not created (libvirt)
ubuntu2004-amd64-test           not created (libvirt)
windows2019-amd64-build         not created (libvirt)
windows2019-amd64-test          not created (libvirt)
windows2019-amd64-build-desktop not created (libvirt)
windows2019-amd64-test-desktop  not created (libvirt)

This environment represents multiple VMs. The VMs are all listed
above with their current state. For more information about a specific
VM, run `vagrant status NAME`.

The -build boxes are used for building and have all of our development tools and dependencies installed. The -test boxes are more or less clean, and are intended for testing release installation.

Running vagrant up will download the box from object storage to your local system. This normally doesn't take very long, but the Windows boxes are very heavy and might take hours.

Once vagrant up has completed, you have the VM running locally. You can use vargrant ssh to open a shell in a given box, or vagrant rsync to sync your local source tree into the box. Sadly there's a very nasty Windows bug that Hashicorp are ignoring, where rsync won't work after the first sync.