Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Changed page title

Table of Contents
maxLevel3

Introduction

Downloadable Application Containers (DAC) is a pan-RDK initiative to develop a container solution that allows binary applications to be downloaded and run on STBs without modification.

DAC is initially targeting RDK-V set-top boxes but the aim is to extend DAC to suitable RDK-B devices in due course. DAC is a co-operation effort between Comcast, Sky, Liberty Global, Metrological and Consult Red. The work for this is co-ordinated by RDK DAC Special interest Group (RDKDACSIG)

Overview

draw.io Diagram
bordertrue
diagramNameE2EArchitecture
simpleViewerfalse
width600
linksauto
tbstyletop
lboxtrue
diagramWidth994
revision3

...

These are discussed further in the following sections

STB / CPE

DAC provides all the necessary tooling to run containerised applications using OCI containers on an RDK-V STB. The main component of this is Dobby, an embedded-focused OCI container manager. Dobby is used to start, stop and monitor containers running on a STB, using the crun runtime underneath to interface with the kernel and start the containers. Dobby is written in C++ and designed to have minimal footprint and performance impact. The OCIContainer Thunder plugin allows for interfacing with Dobby using a JSON-RPC interface, and Dobby can also be used to run other Thunder plugins in containers using the ProcessContainer backend.

...

As part of DAC, the RDKShell plugin has been extended to allow starting DAC apps using Dobby, creating a display and attaching it to the containerised app as necessary. RDKShell also integrates with the Packager plugin to provide a full-featured solution for downloading, installing and lifecycle management of DAC apps. For more documentation on the RDKShell and Packager integration see RDKShell and Packager - Downloading, Installing and Launching DACs. See the Getting Started section below for an example of using these components together.

Cloud/Backend Infrastructure

To support the STB components, backend/cloud infrastructure has been developed. These components allow operators to create application submission portals where developers can submit their applications and their corresponding metadata. These submitted applications can then be converted from an OCI image to an OCI bundle ready for use on an operator's specific hardware.

...

The BundleGen tool is a command-line tool that runs in the cloud to prepare containers for use on specific platforms. It uses template files created by an operator to ensure that the container is configured appropriately for the specific hardware requirements of an operators STB. This includes but is not limited to graphics libraries, sockets, IPC and network configuration. More detailed documentation for BundleGen can be found here: BundleGen Documentation

SDK

To develop DAC applications, an SDK has been developed that allows developers to write Bitbake recipes that compile their code and produce an OCI image. This OCI image can then be uploaded to an OCI registry where it can be converted and downloaded to a STB ready to be run by Dobby. The SDK is based on Yocto 3.1 Dunfell and does not require any RDK specific layers - instead it uses the standard Poky distribution and can run on a developer's workstation, independent of any other build systems. This decreases the amount of time it takes for a developer to build and test their application, reducing development time.

...

The SDK is currently in Alpha and is subject to change as development continues. See here SDK Documentation for more information


Background and Terminology

What are Containers?

Used heavily in modern cloud software, containers are a standardised way to run the software in a self-contained, isolated and secure environment. Containers contain everything an application needs to run, including code, libraries and other dependencies. This means that there is no need to install specific libraries and dependencies on the host for each application. Unlike more traditional virtual machines, containers are lightweight and fast to create and destroy and don't have the overhead of virtualising an entire operating system. By sharing the OS kernel between containers, running applications inside containers adds very little performance or footprint overhead.

...

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

Why use containers in RDK?

There are a number of advantages of using containers to run applications in RDK deployments, including:

...

As part of the DAC initiative, containers are used to reduce the difficulty of developing native applications that can be run on many different RDK-V devices from different operators by creating an isolated environment for each application. This means the app becomes platform agnostic and can be run on devices the develop may not have physical access to.

Open Container Initiative (OCI)

From the Open Container Initiative (OCI) website (https://opencontainers.org/):

...

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

OCI Runtimes

An OCI runtime is a CLI tool that allows for spawning and running containers according to the OCI specification. There are two main OCI runtimes in production use:

Crun

  • Repo: https://github.com/containers/crun
  • Crun is an alternative implementation of an OCI runtime, this time written in C and optimised for performance and a low memory footprint. It is developed and supported by RedHat and is currently in use by Podman in Fedora, and will be available in RHEL 8.3.
  • This is the runtime supported by Dobby and will be used as the default runtime across RDK.

Runc

  • Repo: https://github.com/opencontainers/runc/
  • Runc is the reference implementation of an OCI runtime and is developed directly by the OCI group. This is the runtime used by Docker, Kubernetes and others. However, being written in Go, it is less suitable for embedded STB environments due to a relatively large footprint.
  • Not officially supported in RDK


Getting Started for App Developers

Reference Image

A reference image for the Raspberry Pi 3B is available for app developers that containers all the tooling necessary to install and run DAC applications. The image contains the Lightning-based RefApp, RDKServices, AAMP as well as the DAC STB components such as RDKShell, Packager, Dobby and crun.

The image uses the meta-cmf-video-reference-next layer (https://code.rdkcentral.com/r/plugins/gitiles/components/generic/rdk-oe/meta-cmf-video-reference-next), which is contains all the necessary recipes for building DAC on the Raspberry Pi.

Download/Build Instructions

Full documentation and instructions to build the reference image yourself can be found here: RDK reference image.

...

  • Download the latest pre-built image from the RDK reference image page
  • Flash this to an SD card with Etcher: https://www.balena.io/etcher/
  • Resize the second partition afterwards to at least 2GB or else there is not enough space to download the DAC apps on the rootfs. This can be done with fdisk or gparted.
  • By default the image will start up with refapp2. You can stop refapp2 by browsing to http://$BOXIP:9998 on your workstation and de-activate the webkitbrowser plugin there

Installing and Running DAC Applications

Once the reference image has been flashed to the Raspberry Pi, follow the below instructions to install and run a sample DAC application onto the RPi.

...

The full list of RDKShell and Packager APIs can be found in the full documentation.

Demo Web App

The reference image also contains a sample web app that performs the above steps. To start the test page, you can run the following command on your development PC

...

Note when a DAC app is started via the test page, the underlying test page will also still receive the keys


App Development and Publishing

The above example used a pre-created OCI bundle. Using the SDK it is possible to build your own applications that can be run in a container. Further documentation will be available once the SDK is more stable. For now, initial documentation for SDK usage can be found here: SDK Documentation

...