Unikernels have long been considered the future of software infrastructure, however, their low level nature have kept back many developers from using them. OPS is a new open source tool that allows anyone including non-developers to build and run unikernels with ease.
But first - what is a unikernel? Even if you have heard of the term, you might not quite understand what it is. A unikernel is first and foremost a single process system. Another way to think about that is an operating system that is specifically built to run one application - yours. You see the server side operating system that we all know and love, Linux came out in 1991 and even back then, noted computer science professor Andrew Tanenbaum considered it obsolete the day it came out. That's 28 years ago. UNIX which it was modeled after, was released in 1969. What's particularly interesting here is that both of these heavily predate VMWare which brought virtualization to the masses and Amazon Web Services which is the "cloud". They also predate the first internet boom.
Today, if you are an engineer at Uber or Twitter or really any large software company, you don't have a single database named Mars anymore. You have thousands of databases - there's just too much software. Devops practitioners started isolating specific applications to specific VMs a long time simply because it was easier to manage. A pool of web servers here, a collection of sharded/replicated database servers there, etc. That is - they already started treating their deploys like unikernels. The rise of containerization really made this practice go faster and further and here, we are at some of the early production unikernel deployments.
Unikernels have many benefits noted by many large companies. NEC has papers showing them boot unikernels in 5ms. To paint the picture, a single call to fork costs roughly 3ms. Booting a docker container is north of 100ms. Other papers coming from academia detail booting a unikernel in response to an incoming dns request, then shutting down again. Some unikernels can clock in the kilobyte range. We typically tell people using OPS that the vms that are produced are roughly the size of your application - so if you have a 10mb go binary, that's going to be basically the size of the vm. To be clear, most of the unikernel implementations out there do not run Linux.
Big Problems in Little VM Land
However, unikernels have not been without their problems. While some problems are fake like the lack of debuggers which is crazy cause most unikernelists out there I know heavily utilize gdb and strace and such other problems are real. Compiling unikernels has been a real pain for most developers. It usually requires patching codebases like mysql or tweaking linker flags or Makefiles and most of the time, involves the end user changing things that they might not understand the full ramifications of.
OPS is fixing that.
Build and Run Your First Unikernel
To get started using unikernels, download OPS. You can either use the quick installer via curl or you can build from the source.
$ curl https://ops.city/get.sh -sSfL | sh
First off, let's try a quick node.js
hello world - put this into a hi.js:
console.log("Hello from inside a unikernel!");
Now let's run that:
$ ops load node_v11.15.0 -a hi.js
What happens here is that we download a node package that has everything in it that is needed to run a node application. You can think of these packages like debian packages.
Next, it spins up a small wrapper around qemu that removes some of the rough edges and runs the program. OPS has been designed to run on both linux and mac, but it can also deploy to the cloud providers. If you are on linux, you can enable KVM and it'll run much faster.
If you run...
$ ops list
...you'll see that there are other pre-built packages ready to go and we are adding more all the time. What's even cooler is that you don't necessarily need a package. We've made it to where you can turn arbitrary ELF binaries into unikernels and run them.
What Will You Build?
Unikernels have the capacity of unlocking newer forms of compute that were simply not achievable with existing Linux based virtual machines. Their size, speed and security will enable all sorts of new interesting ways of running software in the cloud and at the edge.
Check out https://github.com/nanovms/ops - fork it, star it and let me know what you build!