Operating Systems

OPS City – Build and Run Nanos Unikernels

Ops is a tool for creating and running a Nanos unikernel. It is used to package, create and run your application as a nanos unikernel instance.

Most Unikernels out there are specialized for a high-level language, but Nanos is capable of executing any valid ELF binary. We provide pre-tested packages for common linux software including support for interpreted languages to provide a similar Linux like experience.

What are Unikernels?

Unikernels are specialised single process operating systems.

Unikernels dramatically shrink the attack surface and resource footprint of cloud services while providing a much better isolation model. They are machine images that can be run on a hypervisor such as Xen or KVM. Since hypervisors power all public cloud computing infrastructure such as Amazon EC2 and Google Cloud, this lets your services run cheaper, more securely and with finer control than with a full general purpose operating system such as Linux.

Improved security

Unikernels reduce the amount of code deployed, which reduces the attack surface, improving security. They also don’t allow you to ssh into them and most importantly they embrace the single process model.

Note: This does have implications for some software. See the FAQ for more details.

Small footprints

Unikernel images are often orders of magnitude smaller than traditional OS deployments. You can create and deploy sub megabyte unikernels depending on what you want/need.

Highly optimised

Unikernels can achieve greater performance from their single process nature and greater pairing with the kernel.

Fast Boot

Unikernels can boot extremely quickly, with boot times measured in milliseconds if you are running on servers you control.

How do I get started?

To get started, go to the getting started section or view below on installation.

Installation

Most users should just download the binary from the website:

Binary install

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

Build and Install from source

Building from source is easy if you have used Go before.

This program requires GO Version 1.10.x or greater.

Installing from source follows these general steps:

Install dependencies:

- `make deps`

Build:

- `make build`

For detailed instructions please consult the documentation.

Basic usage examples

Before learning more about ops it is a good idea to see some basic usage examples. Below are links to simple examples using various programming platforms:

Let’s run your first unikernel right now.

Throw this into hi.js:

var http = require('http');
http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello Worldn');
}).listen(8083, "0.0.0.0");
console.log('Server running at http://127.0.0.1:8083/');

Then you can run it like so:

ops load node_v11.5.0 -p 8083 -f -n -a hi.js

Languages:

Applications:

  • Nginx
  • HAProxy
  • Tarantool
  • Hiawatha
  • Mosquitto
  • Kache
  • Gnatsd
  • Wasmer

You can always find more pre-made packages via:

ops pkg list

Build a bootable image

ops build <app>

Package and run

ops run <app>
OR
ops run -p <port> <app>

Using a config file

ops run -p <port> -c <file> <app>

Example config file

ops config files are plain JSON, below is an example

  {
    "Args":["one","two"],
    "Dirs":["myapp/static"]
  }

Setup networking

New users wishing to play around in a dev environment are encouraged to use the default user-mode networking. Other production users are encouraged to utilize native cloud builds such as Google Cloud which handle networking for you.

Only advanced/power users should use the bridge networking option.

Demo Tutorial

Download OPS and view their documentation here

To Top

Pin It on Pinterest

Share This