Unikernels have long been hailed as a next generation solution for software infrastructure because of their size, performance and security benefits but they’ve remained in-accessible to large swaths of developers because they have been extremely hard and obtuse to work with.

Not anymore. OPS is a new approach to building and running unikernels. Instead of forcing developers to learn how to work with low level c and compile their own solutions with libraries they don’t understand OPS takes a different approach. It loads raw ELF binaries – the native linux binary format as a unikernel instead. This approach is much closer to what unikernels used to be called – library operating systems.

Before we dive into creating one though what exactly is a unikernel? One way to think about it is that if we took your php application and converted it into it’s own operating system the output would be a unikernel. It is designed to only run one thing – your application and nothing else. This makes it a lot more secure than stock Linux, a lot more faster because it doesn’t have to fight for resource utilization and the size of these things can be incredibly small.

To get started you’ll want to download OPS. You can download the binary via this curl command or if you prefer to build from source it is located at https://github.com/nanovms/ops .

 curl https://ops.city/get.sh -sSfL | sh

This can currently be installed on both linux and mac. From there you can see some of the available packages via the list command:

ops list

We’ll create a hello world php example: (test.php)

<?php
 echo "hello from inside a unikernel!\n";
?>

Now when we ‘load’ a package it will download a php interpreter and everything it actually needs to run. It’s important to note that while this is a linux binary it actually isn’t running linux underneath. We’ll pass it the ‘argument’ flag to specify the file we want to run and it’ll boot up inside of qemu. Qemu allows us to run what are called virtual machines. These are the same types of virtual machines you’ll find on the big public clouds such as AWS and GCE – in fact you can even deploy this as an AMI.

➜  p ops load php_7.2.13 -a test.php

Extracting /Users/eyberg/.packages/php_7.2.13.tar.gz...
[php test.php]
booting image ...
assigned: 10.0.2.15
hello from inside a unikernel!
exit_groupexit status 1

It’s good to get acquainted with unikernel technology now even though it’s early days as it not only makes deploying to the cloud better but it opens up entirely new forms of computing that were not possible with Linux based systems before.

Find out more about OPS at https://ops.city/

LEAVE A REPLY

Please enter your comment!
Please enter your name here