Blame contrib/vms/README.md

Packit Service 21b5d1
# Vagrant development boxes
Packit Service 21b5d1
Packit Service 21b5d1
This directory contains a `Vagrantfile` which can be used to automatically
Packit Service 21b5d1
create virtual machines for testing purposes. The virtual machines are
Packit Service 21b5d1
automatically provisioned with all required dependencies for building & testing
Packit Service 21b5d1
of exiv2 (the provisioning is shared with the GitLab CI).
Packit Service 21b5d1
Packit Service 21b5d1
The following Linux distributions are provided (the name in the brackets is the
Packit Service 21b5d1
name of the Vagrant VM):
Packit Service 21b5d1
- Fedora 28 ("Fedora")
Packit Service 21b5d1
- Debian 9 aka Stretch ("Debian")
Packit Service 21b5d1
- Archlinux ("Archlinux")
Packit Service 21b5d1
- Ubuntu 16.04 aka Bionic Beaver ("Ubuntu")
Packit Service 21b5d1
- CentOS 7 ("CentOS")
Packit Service 21b5d1
- OpenSUSE Tumbleweed ("OpenSUSE")
Packit Service 21b5d1
Packit Service 21b5d1
The Fedora, Archlinux and OpenSUSE boxes are the 'vanilla' distribution with
Packit Service 21b5d1
some additional packages installed.
Packit Service 21b5d1
Packit Service 21b5d1
For Debian and Ubuntu, we build gtest manually from source and install the
Packit Service 21b5d1
resulting library to /usr/lib/.
Packit Service 21b5d1
Packit Service 21b5d1
On CentOS, we have to install a `cmake3` and `python36` (the default cmake is
Packit Service 21b5d1
too old and a default python3 does not exist) which we symlink to
Packit Service 21b5d1
`/usr/bin/cmake` & `/usr/bin/python3` to retain a similar workflow to the other
Packit Service 21b5d1
distributions.
Packit Service 21b5d1
Packit Service 21b5d1
For further details, consult the shell scripts `setup.sh` and
Packit Service 21b5d1
`ci/install_dependencies.sh`.
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
All boxes come with `conan` installed via pip in the `vagrant` user's home
Packit Service 21b5d1
directory and the `exiv2` git repository cloned.
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
Please note that these VMs are not continuously tested and the provisioning can
Packit Service 21b5d1
break. Please open an issue on GitHub if you happen to encounter a problem.
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
## Usage
Packit Service 21b5d1
Packit Service 21b5d1
Please install [Vagrant](https://www.vagrantup.com/) and a supported provider
Packit Service 21b5d1
(e.g. libvirt, VirtualBox).
Packit Service 21b5d1
Packit Service 21b5d1
Choose a box from the above list and run in the directory where the
Packit Service 21b5d1
`Vagrantfile` resides:
Packit Service 21b5d1
``` shell
Packit Service 21b5d1
vagrant up $name
Packit Service 21b5d1
```
Packit Service 21b5d1
where `$name` is the name in the brackets in the above list, e.g. `OpenSUSE` or
Packit Service 21b5d1
`Archlinux`. Depending on your default provider you may have to set the provider
Packit Service 21b5d1
manually via `vagrant up $name --provider $provider_name` (the Ubuntu image does
Packit Service 21b5d1
only support VirtualBox, which is not the default on Linux and will result in an
Packit Service 21b5d1
error unless you explicitly set the provider to `virtualbox`).
Packit Service 21b5d1
Packit Service 21b5d1
This will download a box from the vagrantcloud and set it up. Once the whole
Packit Service 21b5d1
process is finished, you can ssh into the machine via:
Packit Service 21b5d1
Packit Service 21b5d1
``` shell
Packit Service 21b5d1
vagrant ssh $name
Packit Service 21b5d1
```
Packit Service 21b5d1
Packit Service 21b5d1
Don't forget to turn it off via `vagrant halt $name` or the VM will keep
Packit Service 21b5d1
running! A VM can be discarded when it is no longer required via `vagrant
Packit Service 21b5d1
destroy $name` (Vagrant will keep the base box around in `~/.vagrant.d/boxes`
Packit Service 21b5d1
and libvirt sometimes leaves images around in `/var/lib/libvirt/` or
Packit Service 21b5d1
`/var/libvirt`, so check these folders too).
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
You can also setup & start all VMs at once via `vagrant up`, but keep in mind
Packit Service 21b5d1
that it will start 6 VMs and occupy between 10 and 20 GB of disk space.
Packit Service 21b5d1
Packit Service 21b5d1
Packit Service 21b5d1
# Notes for OpenSUSE Tumbleweed
Packit Service 21b5d1
Packit Service 21b5d1
Unfortunately the OpenSUSE Tumbleweed box cannot be provisioned easily with
Packit Service 21b5d1
Vagrant as it must perform a system upgrade first, which cannot be done
Packit Service 21b5d1
non-interactively. To get the OpenSUSE box up and running, follow these steps:
Packit Service 21b5d1
Packit Service 21b5d1
``` shell
Packit Service 21b5d1
$ vagrant up OpenSUSE
Packit Service 21b5d1
# you'll get a failure in the first provisioning script
Packit Service 21b5d1
$ vagrant ssh OpenSUSE
Packit Service 21b5d1
vagrant@opensuse-exiv2:~> su - # the root password is vagrant
Packit Service 21b5d1
Password:
Packit Service 21b5d1
opensuse-exiv2:~ # zypper refresh
Packit Service 21b5d1
opensuse-exiv2:~ # zypper dup
Packit Service 21b5d1
# zypper will now perform a system upgrade
Packit Service 21b5d1
# you'll probably get a few file conflicts, confirm the overwrite with 'yes'
Packit Service 21b5d1
# once the upgrade is done, exit the ssh session
Packit Service 21b5d1
$ vagrant halt OpenSUSE
Packit Service 21b5d1
$ vagrant up OpenSUSE
Packit Service 21b5d1
$ vagrant provision OpenSUSE
Packit Service 21b5d1
```
Packit Service 21b5d1
Packit Service 21b5d1
Provided the system upgrade went fine, you should now have an OpenSUSE
Packit Service 21b5d1
Tumbleweed virtual machine ready to go.