Versions Compared

Key

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


Warning

Work in progress

Table of Contents


Expand
titleInitial Bundle Gen slide. (click to expand)

Markdown Notes

WIP Notes:

View file
nameOCI Bundle Generator Requirements.md
height250


OCI Bundle Gen Use Cases (1)

Rewrite these as User Stories

  1. As an Operator I want to be able 

used in STB

expected to be on Cloud

Extendable architecture

Requirements (2)

  • Read in OCI_Image
  • Read in template for a target STB (format TBC)
  • Output a minimal OCI bundle* suitable for execution on target STB
    • FS system
    • runtime Config.json
  • Apply operator restrictions based 




Summary

An overview of Bundle gen in context

draw.io Diagram
bordertrue
diagramNameOCI Bundle Gen
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth691
revision1


STB Specific Template (3)

  • Where does this come from?
    • today its : /sys, /proc, /tmp, /lib, /bin, /sbin, /usr, /dev
    • PLUS an manually generated optional file list - a list of additional files/devices/groups... i.e. psudeo FS nodes that are available
    • PLUS an manually generated optional MAPPING file that maps any actual node from any of the above lists into the RDK-M namespace. i.e tells you what non standard nodes name are in RDK-M std terms. (e.g. XXx)
  • What format is it in?
    • tar of above directories
    • the lists is JSON list
    • the MAPPING is JSON tuple { expected path, actual path}
  • Define REference ones for :
    • RasbPi 
    • PC dev

Operator Rules (3)

  • What does it have:
    • Meory, cpu, networking, resolutions, RDK services upported, ....
  • What format:
    • JSON
  • Where:
    • ?
  • Who :
    • Operator

OCI Image Spec (3)

Standard OCI image 

plus RDK  extensions to define application requirements 

Overview processing steps  (4)

draw.io Diagram
bordertrue
diagramNameOCI Bundle Gen Processing
simpleViewerfalse
width
linksauto
tbstyletop
lboxtrue
diagramWidth911
revision1

A summary of the processing steps (re-order if it helps)

  1. Get OCI_Image
  2. Parse the subset of OCI_Image_config to get the DAC subsection
  3. Filter by architecture (remove all libs and bins that aren't for our arch.
  4. Lib matching: lib is in template then remove lib and put in bind mount
  5. Config App storage. Write the plugin for storage to oci_bundle_config. (AppID is unique across RDK-M.)
  6. Write the plugin ram FS to bundle config if needed
  7. Add the devices and bindmount to that required to output config (inc. networking)
  8. Copy across the layer for architecture independent assets (images, configs, certificates)
  9. Copy across the executable compiles to the correct architecture
  10. Translate the the remaining parts of OCI_Image_Config to OCI_Bundle_Config
PlantUML Render Macro

@startuml
start
:Parse STB config file and operator config for syntax errors;
:Determine arch of selected device;
if (Image contains suitable manifest for platform arch?) then (Yes)
:Determine image type
(""imageLayout"" / ""image"" / ""imageZip"");
:Unpack OCI image based on manifest for required platform/arch;
:Read application requirements and STB platform config;
if (Target STB can support app?) then (Yes)
:Begin lib matching algorithm;
:Run ""ldd"" on application to find dependencies;
note left
How would we manually loaded libs
with ""dlopen"" - ldd won't show these?
end note
repeat
if (Platform already contains same (major) version of library?) then (Yes)
:Add bind mount for library to ""config.json"";
:Delete library from ""rootfs"" directory in bundle;
else (No)
:Do nothing - use version in rootfs;
endif
repeat while (More dependencies?) is (Yes)
:Add bind mounts for platform specific GPU libraries;
:Add additional bind mounts specified in platform config;
:Add bind mounts for any devices in platform config;
:Add devices to ""devices"" array in config;
:Add environment variables specified in platform/operator config;
:Process application capabilites;
:Add ""rdkPlugins"" section to the config accordingly;
:Write any remaining config sections;
:Create tarball of ""rootfs"" directory and ""config.json"" file;
stop
else (No)
#PaleVioletRed:ReturnError
====
Platformcannotsupportapplication
Apprequiressomethingplatformcannotprovide;
stop
endif
else (No)
#PaleVioletRed:ReturnError
====
Appdoesnotsupporttargetarchitecture;
stop
endif
@enduml


Library matching

Options:

  • https://en.wikipedia.org/wiki/Soname
  • Full Name matching
  • Base name matching, exclude version numbering
  • Hash of the lib
    • how to handle to handle compiler option diffs e.g. strip?
  • Are LD commands to get version number?

/Dev Matching