Creating a Distribution iControl LX/iApps LX RPM Package

Once you have written your iControl LX/iApps LX extension, you need to create an RPM package to be uploaded onto a system. The supported way to do so is to copy and install the source files to a target directory. The directory is added to the list of directories known to restnoded.

Prerequisites:

  • You are a developer responsible for creating an iControl LX/iApps LX RPM Package

What’s in an iApps LX Package?

The iApps LX RPM package contains the data block template, the JavaScript code of the processors and the custom GUI configuration. The RPM is installed and saved to /var/config/rest/iapps/<appName>. The three different parts of the package (block template, the JavaScript code for the processors, and the custom GUI configuration) are then saved to different accessible folder locations. The JSON template in /mgmt/shared/iapp/blocks, the processor code in a nodejs directory under F5-iAppsLX-<appName> within the /var/config/rest/iapps directory, and the custom GUI configuration in /mgmt/shared/iapp/blocks/presentation.

Note

Saving an iApps LX RPM to a different location is not supported and content may be lost during upgrades or during a restore activity.

What’s in an iControl LX Package?

An iControl LX extension package includes the JavaScript workers and any optional custom UI configuration for the relevant workers. In addition, the iControl LX package needs to include a manifest.json file and a PLUGIN tag to define it as an iControl LX and to indicate that there is no template block as included in an iApps LX package The directory structure of an iControl LX RPM package is similar to an iApps LX RPM package (/var/config/rest/iapps).

Creating the Distribution RPM Package

  1. Copy the source files to a /tmp directory on the target BIG-IP system.

For example:

$ scp MemoryWorker.js target_bigip_system_address:/tmp
  1. Create the RPM target directory.

RPM’s are created on the host system from JavaScript files located in the following location: /var/config/rest/iapps/<worker_name>/nodejs.

When logged into the host system, use the mkdir command to create the following directories:

mkdir /var/config/rest/iapps/MemoryWorker
mkdir /var/config/rest/iapps/MemoryWorker/nodejs
  1. Copy source files.

Copy the source MemoryWorker.js file from /tmp folder to the location on the host system:

cp /tmp/MemoryWorker.js  /var/config/rest/iapps/MemoryWorker/nodejs
  1. Create a manifest.json file and then copy it to the location on the host system:
/var/config/rest/iapps/MemoryWorker

The manifest.json file for iControl LX extension packages, is ({"tags":["PLUGIN"]}) and for iApps LX packages, is ({"tags":["IAPP"]}).

  1. Generate the RPM.

A built-in extension in the F5 REST Framework generates the RPMs. Issue an HTTP POST to the /mgmt/shared/iapp/build-package resource, this triggers an asynchronous execution of the RPM creation.

curl -u user:password -X POST http://<BIG-IP address>/mgmt/shared/iapp/build-package -d '{"appName": "MemoryWorker", "packageVersion": "0.1.0", "packageRelease": "0001"}'

The response includes:

{
  "step": "COMPLETE_TASK",
  "packageDirectory": "/var/config/rest/iapps/MemoryWorker",
  "appName": "MemoryWorker",
  "builtRpmPackageFilePath": "/var/config/rest/iapps/RPMS/MemoryWorker-0.1.0-0001.noarch.rpm",
  .....
  "selfLink": "https://localhost/mgmt/shared/iapp/build-package/9190e6fb-e729-480d-bc31-172c7c5940ca"
}

Note

Generating the RPM takes a few minutes, as the POST request creates a task task to provide a url in the ‘self-link’, which can be polled via GET to see if the task is completed. This pattern (Async task creation/task status polling) is used by many REST frameworks extensions.

  1. Verify that the RPM package was created.

You can verify the RPM was created by issuing a list command to the builtRpmPackageFilePath status response attribute.

ls /var/config/rest/iapps/RPMS/MemoryWorker-0.1.0-0001.noarch.rpm