I would like to create a Swift Community Hosted Continuous Integration (CI) node for Ubuntu 20.04. You can see other community hosted CI notes at https://ci-external.swift.org/. Swift Community-Hosted CI is an extension of Swift CI that allows the community to add additional platforms. Community members can volunteer to host new platforms and they are responsible for maintaining the host nodes.

To do this I plan to use my home server to host a build (or maybe two). The home machine has 2 Intel Xeon E5-2680 v2 running at 2.80GHz with >64GB of RAM with about 4TB of free disk space. Of course I actually use my home server for a lot of tasks already. I cannot turn over all of those resources to Swift compiling. To meter out the resources I plan to use libvirt and ZFS.

Create Filesystem

The libvirt host is running Fedora and ZFS is used for the filesystem and logical volume manager. As a result creating a dataset and providing a mount point at the default libvirt data directory (e.g., /var/lib/libvirt) will enable libvirt data to be nicely contained and managed. Initially the virtual build machines will only have access to about 500GB of disk space. This can be adjusted later if necessary.

zfs create pond/libvirt
zfs set mountpoint=/var/lib/libvirt pond/libvirt
zfs set quota=500G pond/libvirt

Installing libvirtd

Fedora comes with a “Virtualization Package Group”. This group should provide all of the tools and packages necessary to get virtualization up and running.

$ dnf groupinfo virtualization

Group: Virtualization
 Description: These packages provide a graphical virtualization environment.
 Mandatory Packages:
   virt-install
 Default Packages:
   libvirt-daemon-config-network
   libvirt-daemon-kvm
   qemu-kvm
   virt-manager
   virt-viewer
 Optional Packages:
   guestfs-browser
   libguestfs-tools
   python3-libguestfs
   virt-top
dnf group install --with-optional virtualization

Networking

I want the build machines to be directly connected to my home network so I can use NAT and Port Forwarding on my edge device to route outside traffic into these virtual machines.

TODO: Actually explain how to setup bridge networking on Fedora

Conclusion

In this part the initial setup is complete. The host has been provisioned with an appropriate filesystem and libvirt is setup and configured for hosting virtual machines.

The next part will actually create a guest virtual machine running Ubuntu 20.04.

Backup