Skip to content

MAYHEM-Lab/ambience

Repository files navigation

Ambience

Ambience is an operating system for the Internet of Things.

It shares characteristics with systems such as Singularity and the unikernel in that it relies on the programming language compilation and runtime system (currently C++) to implement some forms of memory safety and optimized interprocess communication. Moreover, Ambience is designed specifically to host communicating microservices that, together, form a service mesh to be deployed in an Internet of Things setting.

The Ambience deployment model requires that the Ambience kernel and the microservices it hosts be compiled into an image for the node where they will ultimately be deployed. A full deployment consists of one such image for each node and the fully deployed service mesh must be described by a global deployment manifest. To compile Ambience, a deployment manifest must be provided which describes where each application (i.e. service) will run, and the networks that interconnect these execution sites. When a deployment is compiled, one image for each node (consisting of an Ambience kernel and the microservices to be hosted on the node) is generated along with a service-level network overlay to allow for transparent network forwarding.

The key abstraction in Ambience is the service. A service comprises an interface and implementation. The programmer writes the interface in a custom IDL: lidl, and usually writes the implementation in C++ . He/she can move a service across machines or address spaces (i.e. isolation groups) with a simple change to the deployment. This is a facility not provided by other operating systems.

Services often issue requests to dependent services, which Ambience optimizes novelly. For example, consider a data publishing service that depends on a data cleaning service. Ambience will compile the data publishing service so that it uses the best transport mechanism depending on the deployment. It will use one of three different mechanisms:

  • If the services are on different machines, the request is sent over the network.

  • If the services are on the same machine and in different address spaces, the request is sent via IPC (a protected memcpy)

  • If the services are on the same machine and in the same address space, service requests compile to function calls.

Such optimizations allow Ambience to run even on very small microcontrollers.

Getting Started

There is a helper script to document and ease setting up an Ambience build environment.

The only dependencies of the script are GNU coreutils, bash, sed, and dnf, the Fedora package manager. The only tested dnf version is 4.5.2.

To build, run, and test the calc_test_deployment, run these commands as root:

wget https://raw.githubusercontent.com/MAYHEM-Lab/ambience/master/scripts/ambience-helpers.sh
chmod +x ambience-helpers.sh
mkdir build-env-directory
./ambience-helpers.sh bootstrap build-env-directory
./ambience-helpers.sh setup build-env-directory
./ambience-helpers.sh run-and-query-basic-calc build-env-directory

The final line should print SUCCESS.

You may use / for build-env-directory on a Fedora 36 machine to set up the machine for development. Otherwise, you must chrooted into build-env-directory to do anything.

Other Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published