Application management
The following sections describe usage of ioxclient to manage applications. Below are the application management commands:
Ensure that you have right profile activated.
Packaging an application
ioxclient
provides ability to package an already created application
- Options RSA key and certificate should be used to provide a private key and cert pair to sign the package.
- The provided key and certificate pair will take precedence over the ones specified in the active profile
In the above command "." is supplied - indicating that package the current directory.
ioxclient ensures that the path supplied for package command contains all the required files before packaging.
Refer to IOx package documentation for more details about the structure and layout of the package.
Successful completion of this command creates a "package.tar(.gz)" that can be used for installation on your IOx device.
Installing an application
Installing an application with dependent IOx Services
A user who wants the dependencies of the application to be taken care of, can specify the ioxclient to resolve dependencies in two methods -
There are three flags available to achieve this functionality -
- --resolve-dependencies or --rd : specify this flag to enable automatic dependency resolution
- --service-source or --src : specify a folder containing service bundles to use them for dependency resolution. If no folder is specified, fogportal will be searched for the required packages.
- --service-activation-payload or --p - where the path of the activation payload for services is specified.
Resolve Service Dependencies from the Fog portal -
Here, the installer searches for the required services from the Fog portal, downloads them into a temp folder and installs, activates using the activation payload, and runs them in order to install the required application
Output -
Resolve Service Dependencies from the folder -
In this case, the specified folder is searched for the required dependencies and the ones required are installed, activated and started in order to install the application.
Output -
Installing an application package already available on the device
If the application package is too large to transfer over http, please copy the package to the device by other means and use the below command to install the application
Activating application
An application has to be activated before starting. At the time of activation, the developer/administrator has to supply the right resource mapping based on what the application needs.
Refer IOx application states documentation for more information about application states.
Refer IOx application descriptor documentation for more information about application resource requirements.
For ex, the above installed app asks for network interface. That interface has to be associated with the right logical network available on the device. Similarly, you could assign the right device, map external ports etc.,
Pass a JSON file path to --payload that contains the right activation payload.
For the above app, we will use a "activation.json" that contains the right content.
We are associating "eth0" interface requested by the app to "iox-nat0" network available on the device
We are also setting the resource profile to "c1.small"
A note about "--debug" flag
At the time of activation, you can set the --debug on
. Setting this instructs the IOx platform to activate this app in debug mode. For platforms that use LXC container technology this means that even if the application stops/crashes, the container is still kept running, so that you can connect to the application console for further debugging.
Here is a sample activation command:
Starting the application
Listing all the applications on the system
View application status
Get application bootstrap configuration
Setting application bootstrap configuration
You can set the application bootstrap configuration by passing a new configuration file.
Usage:
If the content is present in a "config.ini" file, you can use the command as below: