Hi folks,
I've been generalizing platform support in the rumprun launch tool that
Martin Lucina pioneered for launching POSIX application unikernels on
top of Xen. After small adjustments we support a rumprun nginx
unikernel on KVM, Xen, and also my old laptop. (Why test/demo with
nginx instead of some other application? It's a real-world, well-known
and most importantly, simple-to-verify-working piece of software).
Assuming you have built nginx, the same rumprun syntax works for all
platforms:
KVM:
rumprun kvm -b nginxdata.iso,/etc -I iftag,vioif,'-net tap,ifname=tap0'\
-W iftag,inet,dhcp bin/nginx -c /etc/nginx/conf/nginx.conf
Xen:
rumprun xen -b nginxdata.iso,/etc -I iftag,xenif \
-W iftag,inet,dhcp bin/nginx -c /etc/nginx/conf/nginx.conf
ISO bootable directly on hardware:
rumprun iso -b nginxdata.iso,/etc -I iftag,wm \
-W iftag,inet,dhcp bin/nginx -c /etc/nginx/conf/nginx.conf
spot 3 differences ;)
That said, the bin/nginx unikernel binaries are of course different,
e.g. the Xen one contains Xen PV drivers/bootstrap and the raw hardware
one contains a USB driver stack so that we can access the data files on
the "guest".
The demand for the KVM and Xen versions is I daresay rather obvious.
But why do the bare metal one? First, as we've already seen very
recently on this list, baking things into self-contained images may be
desirable for deployment in some cases. Second, because running
directly on hardware demonstrates the advantage of the rump kernel
approach of separating drivers from the OS: we can. Supporting a piece
of hardware as a platform just requires selecting which hardware drivers
to link into the unikernel image. We probably still need to figure out
some usability kinks there, as the selection of drivers is currently
done by editing a Makefile (*), but, by large, things just work.
*) you need to add the following components: rumpdev_pci_usbhc,
rumpdev_usb, rumpdev_umass and rumpdev_scsipi
Granted, the usage on hardware is still a bit different from the cloud
platforms: you have to dd the image to a USB stick, move it to another
computer and press the power button. One needs physical exercise ...
In case someone likes reading dmesgs, here's the rumprun dmesg for the
laptop (and also the spoiler on how I obtained the dmesg without typing
it down manually ;)
https://gist.github.com/anttikantee/15259b8796eb724722e3
- antti