Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

DAC builds upon open-source specifications, components and tools from the Open Container Initiative (OCI). In particular, it uses crun, a fast, small, OCI-runtime compliant engine that can configure and launch applications containers. The first RDK contributions to be released are Dobby  and OCIContainers. These are the first two components of an end-to-end system that operators can use to adapt, manage and control containers to be suitable for their platform.

Other components within the end-to-end system that are currently in development include RDK-V SDK extensions that allow DAC Apps to be: built, published, and then adapted before loading and running on RDK-V STBs. The work for this is co-ordinated by RDK DAC Special interest Group (RDKDACSIG)

Background

What are Containers?

...

The most popular containerisation solution currently in use is Docker, although there are a number of other solutions such as LXC, Singularity and Podman. LXC containers have been available within RDK for a number of years, using a container generation tool at build time to define and create the container configurations.

Image RemovedDeployment evolutionImage Added

Image source: https://kubernetes.io/docs/concepts/overview/what-is-kubernetes/

...

draw.io Diagram
bordertrue
diagramNameOCI
simpleViewerfalse
width600
linksauto
tbstyletop
lboxtrue
diagramWidth951
revision1

...

Dobby is a container management tool, originally developed by Sky and open-sourced to the RDK community. Dobby is a daemon-based program that sits above makes use of the crun runtime , providing and provides a more user-friendly experience for starting/stopping containers, handles container lifecycle management and enhancing the base functionality provided by crun.

Dobby is designed to be used for starting, stopping and monitoring all containerised applications on the STBan RDK-V device. To start a container with Dobby, simply provide Dobby with a path to an OCI bundle and a container ID, and Dobby will handle the rest.

Written in C++ and with a plugin-based architecture, Dobby is lightweight, highly expandable and customisable, offering the ability to run custom code at various stages in the container lifecycle to add additional functionality. Out of the box, Dobby provides a number of plugins ready for use to provide commonly needed functionality including:

  • Advanced container networking support with NAT and both IPv4 and IPv6 support. Allows for easily adding iptables rules to allow/prevent traffic flow in and out of container
  • Container log management to either files or directly to journald
  • Loopback storage mounts to add persistent, isolated storage to containers
  • Allowing access to the host dbus inside containers

Plugins are simply C++ code written against the plugin interface, allowing for operators to easily add additional functionality, or modify existing functionality easily.

draw.io Diagram
bordertrue
diagramNameDobby
simpleViewerfalse
width600
linksauto
tbstyletop
lboxtrue
diagramWidth1491
revision1

Usage

The core component of Dobby is the DobbyDaemon. This should be started at STB boot and then listens over dbus for commands. Dobby ships with a systemd unit file called sky-dobby.service, which allows Dobby to be started/stopped by systemd. DobbyDaemon logs are sent to journald.

...

To control Dobby using a JSON-RPC API, then use the OCIContainer Thunder NanoService. The source code for OCIContainer can be found here TODO:: UPDATE THIS ONCE OCICONTAINER IS MERGED: https://github.com/rdkcentral/rdkservices/tree/pullmaster/116.OCIContainer

OCIContainer code contains a README.md file with detailed documentation on its usage, and includes a test script (test/ociContainerTest.sh) that can be used to ensure Dobby/OCIContainer is working as expected.

...

To run an application as a Dobby container, the application must be packed as an OCI bundle. This bundle can come from many different sources - it could be manually created or generated from an OCI image.

For demonstration purposes, a sample bundle is attached to this page that creates a simple container. This container runs the sleep command to sleep for 30 seconds. It also configured Dobby's logging to log the container stdout/err to a file in /tmp/container.log

TODO:: Attach sleepy container bundle

The Dobby source code contains a few example OCI bundles in the tests directory, although more tooling to allow easier generation of OCI bundles is under development.

For more information on how to create OCI bundles from scratch, see the following pages:

...

To develop Dobby, it is recommended to use Ubuntu 16.04. You cannot develop/test Dobby inside a Docker container as you cannot run Dobby containers inside a Docker container. TODO:: ADD LINK TO VAGRANT VM IF/WHEN WE MAKE IT PUBLICDobby ships with a Vagrant file to create a development environment. More information is available here: https://github.com/rdkcentral/Dobby/tree/master/develop

If you would like to contribute code to this project you can do so through GitHub by forking the repository and sending a pull request. Before RDK accepts your code into the project you must sign the RDK Contributor License Agreement (CLA).

...