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

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.

Start To use Bundle Generator, start by launching the Fedora-based VM provided in the BundleGen repo here: https://github.com/rdkcentral/BundleGen/blob/master/Vagrantfile. If you are not sure how to work with Vagrant, see below:

Expand
titleVagrant Setup Instructions. Click here to expand...

Start by installing Vagrant on your host machine by downloading the relevant version for your OS here: https://www.vagrantup.com/downloads.

You must also have VirtualBox installed on your system. Vagrant works with all versions of VirtualBox > 4.0. Download and install the relevant VirtualBox binary from here: https://www.virtualbox.org/wiki/Downloads.

To get the virtual machine ready for use, run the following:

  1. Enter the repository directory where Vagrantfile is stored.
  2. Run "vagrant up" command. This will download and run all dependencies. It will take like 20 minutes in first run so be patient. After first run it will take about 30 seconds to run.
  3. After previous command is done run "vagrant ssh" (also from console located where "Vagrantfile" is located in) it will log in into VM.

When VM is running (after "vagrant up") you can use more than one active session of "vagrant ssh" if needed.

In Vagrant there is default mount directory: hosts directory where "Vagrantfile" is stored will be bind-mounted into "/vagrant" inside VM. This can be used to moving files in/out of the VM. So any new file created/moved to Vagrantfile directory should be visible in "/vagrant" and other way around.

The files don't always show up instantly. You may need to use "vagrant halt" and "vagrant up" to restart the VM. The files should then be visible in "/vagrant".

Known bug: For some reason sometimes in Fedora VM this default bind-mount doesn't work as it should. If that happens and you cannot move files in/out of VM you can use vagrant scp (https://github.com/invernizzi/vagrant-scp) instead.

Once the VM is running, perform the following steps

  1. Clone bundle generator repository: git clone https://github.com/rdkcentral/BundleGen.git
  2. Go to bundlegen directory: cd BundleGen
  3. (Optional) Create virtual environment: python3 -m venv .venv
  4. (Optional) Enter virtual environment: source .venv/bin/activate
  5. Install bundlegen requirements: pip install -r requirements.txt
  6. Install bundlegen: pip install --editable .

...