Versions Compared

Key

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

...

  1. Obtain the OCI Image using Skopeo (open-source tool by RedHat)

  2. Unpack the OCI image with Umoci (open-source tool by OCI)

  3. Validate App is compatible

  4. Modify the OCI config based on the platform template. This includes but is not limited to:

    1. Environment Variables

    2. Mounts for sockets, libraries

    3. Device whitelisting

    4. User and groups

    5. RDK plugins (networking, loopback mounts, logging)

  5. Create .tar.gz from bundle with modified config

App Metadata

To create a bundle that is compatible for an application, BundleGen requires a small amount of metadata about the application. This can be thought of as similar to a manifest in Android apps. The app metadata can include information about storage and memory requirements, whether the app needs graphics support and network access such as port forwarding.

The app metadata is a JSON file, an example of which is below:

Code Block
languagejs
{
    "id": "com.rdk.wayland-egl-test",
    "type": "application/vnd.rdk-app.dac.native",
    "version": "1.0.0",
    "description": "Simple wayland egl demo, showing green rectangle",
    "priority": "optional",
    "graphics": true,
    "network": {
        "type": "open"
    },
    "storage": {},
    "resources": {
        "ram": "128M"
    },
    "features": [],
    "mounts": []
}

The full syntax can be found here: https://github.com/rdkcentral/BundleGen/blob/master/docs/AppMetadata.md

The example images built by the SDK contain metadata files which are the embedded inside the OCI image for BundleGen to use: https://github.com/stagingrdkm/meta-dac-sdk/tree/master/recipes-example/images/metadatas

Non SDK Generated Images

If using images from the Docker hub or other OCI registry that were not generated by the DAC SDK, then you will need to manually write a metadata file for the app and provide the file to BundleGen in the generate command via the optional --appmetadata argument.

Usage

Before you can use BundleGen, you must create an OCI image containing your application using the SDK and upload it to an OCI registry such as the Docker Hub. Once that is complete, follow the below instructions to use BundleGen.

...

Now you can create bundle from images by doinggenerated by the SDK by running the generate commad: bundlegen generate --platform <platform-name> --appmetadata <path-to-app-metadata> <img-url> <output-dir>. Example:

Code Block
$ bundlegen generate --platform rpi3 --appmetadata my-app.json docker://my-app ~/outputdirectory

...