IncludeOS: Run cloud applications with less

With the new open source OS, developers write a cloud service in C++ that contains only the libraries needed to run that app

Researchers at the Oslo and Akershus University College of Applied Sciences in Norway have created a way to build cloud applications with a newly open-sourced OS that's as slender as can be. 

IncludeOS isn't in the same category as minimal operating systems like CoreOS, RancherOS, or Windows Nano Server. Instead it's one of a breed of systems, called unikernels, where the OS consists of a single application baked into a custom kernel that contains only the libraries needed to run that app.

With IncludeOS, developers write a cloud service in C++ and bring in the IncludeOS libraries. When compiled, the result is a disk image that contains the application and the few OS components needed to run it. The image can then be booted and run on a modern hypervisor; Linux's KVM and VirtualBox are currently supported.

The resulting images are small -- a minimal bootable image weighs in at a mere 693K. But IncludeOS is also highly opinionated about how software is meant to be written. For instance, there's only one process -- the application itself -- and no support for threading. The programming model for IncludeOS applications is inspired by the Node.js model, using a single thread and asynchronous callbacks.

includeos build system overview

IncludeOS applications are written in C++ and built with only the pieces of the OS that are actually needed by the app. The result is compiled into a bootable image that can be run on a Xen-compatible hypervisor.

The creators of IncludeOS claim this design provides several advantages for a Web service, such no thread-based race conditions or I/O blocking. In fact, the road map for the project explicitly describes its future goal as a kind of "Node++" that will enable people to "develop tiny, self-contained, Node.js-style Web services, with RESTful APIs, in highly efficient C++."

Planned additions for IncludeOS include a package management system -- in the same vein as Bower or Npm with Node.js -- integrations with databases, and multicore support.

One factor that might keep IncludeOS from gaining wider adoption within the Web services community -- even its more experimental branch -- is its choice of language. Most Web services are written in higher-level languages like Java or JavaScript, but IncludeOS is trying to make a case for using C++.

"We believe C++ has become much more flexible and easier to get started with since C++11/C++14," IncludeOS developers write in the project's FAQ. "So for now we want to focus on making good tools for new and experienced C++ developers. Also, we really like good performance."

The Xen Project, creators of the Xen hypervisor, have their own unikernel concept, called Mirage. Applications written with Mirage talk directly to the Xen hypervisor and use very little memory compared to a full-blown OS image. But Xen chose OCaml as its language for Mirage applications, and its uptake has been limited by definition to developers willing to use that language.

Copyright © 2015 IDG Communications, Inc.