Webinars

Special Interest Groups

RDK-B Working Groups
RDK-V Working Groups
UI-UX Research and Development
DAC

Conferences

[Americas Summit]
[Euro Summit]
[Technology Summit]

Preferred Resources

Skip to end of metadata
Go to start of metadata

The SDK is under active development and is subject to significant changes as development continues.

Key Info

An SDK to allow developers to easily build their applications and package them as OCI images suitable for use with DAC

Overview

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.

The resulting applications can be run on a Yocto 2.2-based STB - it does not require Yocto 3.1 on the STB.

Usage

The following instructions will describe how to use the SDK to create an OCI image for the wayland-egl-test app which is provided with the SDK as an example

1. Set up a suitable build environment for compiling Yocto 3.1 Dunfell (Ubuntu 18.04)

2. Follow the instructions in the README.md file to clone the Pocky distribution and add the appropriate bitbake layers

3. Build the wayland-egl-test image

bitbake dac-image-wayland-egl-test

4. Once complete, the wayland-egl-test application with its dependencies inside will be packaged as an OCI image,  the following OCI image file will be created in the following directory:

build/tmp/deploy/images/raspberrypi3/dac-image-wayland-egl-test.tar

Note that above file is symlink to dac-image-wayland-egl-test-raspberrypi3-20201107165225.rootfs-oci-latest-arm-linux.oci-image.tar in same dir

The wayland-egl-test application has now been packaged as an OCI image. To run this app on a STB/CPE, it must be converted to an OCI bundle using BundleGen (BundleGen).

There are two ways to work with the OCI image in BundleGen:

If using the local directory method, run the following BundleGen command. Note the difference in syntax for the image URL when compared to pulling from the docker hub

# Extract the image
(.venv) ~/BundleGen$ mkdir ./dac-image-wayland-egl-oci
(.venv) ~/BundleGen$ tar -xvf dac-image-wayland-egl-test.tar -C ./dac-image-wayland-egl-oci
./
./oci-layout
./index.json
./blobs/
./blobs/sha256/
./blobs/sha256/fb626bf4276728155707f97656736be12e0691bd3eb70be8b1a0984b5d2f8a5c
./blobs/sha256/6ea057cd8cda9ea7b3ccc577f263bb93a728c38f27157d8c2c48efad601fe99d
./blobs/sha256/c298c5fff4d26cd51f9ec3b9390fba02d754cbaba2384fa65dc7d7511d6bcda4

# Run bundlegen
(.venv) ~/BundleGen$ bundlegen generate --platform rpi3_reference oci:./dac-image-wayland-egl-oci:latest  ./wayland-egl-bundle
2020-11-09 13:19:11.415 | SUCCESS  | bundlegen.core.image_downloader:download_image:122 - Downloaded image from oci:./dac-image-wayland-egl-oci:latest successfully to /tmp/bundlegen/20201109-131911_93db3898ee8245bf907c29a2654a9dc3
2020-11-09 13:19:12.023 | SUCCESS  | bundlegen.cli.main:generate:132 - Successfully generated bundle at /home/user/BundleGen/wayland-egl-bundle.tar.gz

To quickly test the generated bundle there is a useful test script under ./test. The below example shows how to test the bundle on RPI3 running the reference image, "next" version. You can find the build script and a pre-built image for that here: RDK reference image#RPIbuildscript

(.venv) [vagrant@bundlegen BundleGen]$ ./test/testapp.sh 192.168.1.129 wayland-egl-bundle.tar.gz
--> Copying bundle to box on lighttpd server location
Warning: Permanently added '192.168.1.129' (RSA) to the list of known hosts.
wayland-egl-bundle.tar.gz                                                                                                                                             100% 2353KB   3.3MB/s   00:00
--> Killing app
{"jsonrpc":"2.0","id":1,"result":{"message":"failed to kill client","success":false}}
--> Remove app
{"jsonrpc":"2.0","id":1,"result":{"task":123,"success":true}}
--> Waiting until app removed...
--> App is removed!
--> Start (re-)installation of app
{"jsonrpc":"2.0","id":1,"result":{"task":"1","success":true}}
--> Waiting until app installed...
--> App is installed!
--> Starting app!
{"jsonrpc":"2.0","id":1,"result":{"success":true}}
(.venv) [vagrant@bundlegen BundleGen]$

Also, you can combine both above steps with the other test script called "build_and_test_on_rpi.sh". In this case you don't pass the generated bundle as argument but the OCI dac tarball you want to test. The bundle is first generated and then installed to the RPI3. For example:

(.venv) [vagrant@bundlegen BundleGen]$ ./test/build_and_test_on_rpi.sh 192.168.1.129 dac-image-wayland-egl-test.tar
--> Extracting OCI image...
./
./index.json
./oci-layout
./blobs/
./blobs/sha256/
./blobs/sha256/53e4a3facc0fdefda2e34577a51eb69b8cf2009bb84f016bac14f7f671c74370
./blobs/sha256/f0a511fbac9f2e79b9a8e4a939bc21d750eebf6b2362ff516398bfc87f77ef15
./blobs/sha256/6b0f14801d3a1c0b58a79e93ebf789c1d663db5e376b743c9373b1fe191bee91
--> Generating runtime bundle...
2020-11-16 10:59:11.540 | SUCCESS  | bundlegen.core.image_downloader:download_image:122 - Downloaded image from oci:./oci-dac-image-wayland-egl-test:latest successfully to /tmp/bundlegen/20201116-105911_61d973c186904a83b43f7a57d675729c
2020-11-16 10:59:12.260 | SUCCESS  | bundlegen.cli.main:generate:132 - Successfully generated bundle at /home/vagrant/BundleGen/rpi-dac-image-wayland-egl-test.tar.gz
--> Copying bundle to box on lighttpd server location
Warning: Permanently added '192.168.1.129' (RSA) to the list of known hosts.
rpi-dac-image-wayland-egl-test.tar.gz                                                                                                                                   100% 1833KB   2.0MB/s   00:00
--> Killing app
{"jsonrpc":"2.0","id":1,"result":{"message":"failed to kill client","success":false}}
--> Remove app
{"jsonrpc":"2.0","id":1,"result":{"task":123,"success":true}}
--> Waiting until app removed...
--> App is removed!
--> Start (re-)installation of app
{"jsonrpc":"2.0","id":1,"result":{"task":"1","success":true}}
--> Waiting until app installed...
--> App is installed!
--> Starting app!
{"jsonrpc":"2.0","id":1,"result":{"success":true}}
(.venv) [vagrant@bundlegen BundleGen]$

Design

Yocto meta-dac-sdk layer introduce new types of OCI Images:

  • dac-image-base - for DAC application that run as system service without graphics output or user input
  • dac-image-wayland - for DAC application that are using OpenGL ES for 3D graphics and Wayland protocol to communicate with display server
  • dac-image-qt - for DAC application that are using QT5  framework
  • dac-image-essos - for DAC application that are using Firebolt ® Essos framework


Provided OCI Images are used as a base classes for specialized DAC Application OCI Images.

To create new OCI Image with application, developer had to define:

  • Application BitBake recipe. This recipe define:
    • Where the application sources are located
    • What other components and libraries are used during application build process
    • How to build the application
    • How to install the application and its resources
    • What other components and libraries need to be installed together with the application
  • Specialized OCI Image BitBake recipe. This recipe inherit one of pre-defined DAC Image recipes and define:
    • Which application should be installed inside the OCI Image
    • What is an entry point (executable binary) inside Container
    • What additional ENV variables should be set for application




  • No labels