Overview
The purpose of the application subsystem is to facilitate easy software delivery and management across all ONOS instances in a cluster. The subsystem uses ONOS eventually consistent map and the inter-node communication mechanism to fully replicate the inventory of applications across the entire ONOS cluster. To install and ignite software as sets of OSGi bundles, the subsystem relies on the underlying Apache Karaf feature mechanism.
All builtin sample and test applications provided by ONOS are now delivered using this mechanism and come pre-installed - although not activated - as part of the standard ONOS distribution. This includes any providers, such as OpenFlow providers. In this way, all optional software components can be installed into and withdrawn from ONOS without the need to rebuild, or even to reconfigure ONOS itself.
Application Definition
Applications can be uploaded or defined in ONOS using either a plain app.xml file or a package file (ZIP) containing an app.xml file, any OSGi bundles, or feature definition file. The app.xml file specifies the following attributes:
- name - application name, specified in reverse DNS notation
- version - application version
- origin - company or organization where application originated
- description - short description of the application
- features - list of Apache Karaf features that comprise the application
- featuresRepo - optional URL of application feature definition artifact
The following is an example of of the ONOS OnePing sample application app.xml file:
<?xml version="1.0" encoding="UTF-8"?> <app name="org.onosproject.oneping" origin="ON.Lab" version="1.2.0" featuresRepo="mvn:org.onosproject/oneping-app-features/1.2.0-SNAPSHOT/xml/features" features="oneping-app,onos-app-tvue"> <description>One-Ping-Only sample application!</description> </app>
Application Package
If an application needs to deliver artifacts, such as feature definitions or OSGi bundles which are not available in a public object repository such as Maven central, it can be packaged into an application package file, which is a ZIP file that contains the above app.xml descriptor as well as any other artifacts organized using repository structure hierarchy. The following describes the structure of the application package file:
- app.xml - application descriptor
- m2/<groupId>/<artifactId>/<version>/<featuresRepo>
- m2/<groupId>/<artifactId>/<version>/<artifact>
- ...
Currently, application package files can be produced using maven-assembly-plugin, but in the near future onos-maven-plugin will offer capability to easily produce properly structured application package files.
CLI Commands
Administrators can interact with the inventory of applications using the following console commands:
- apps - lists all installed applications
- app install <mvn-url> ... - installs applications by downloading from the specified URLs (not implemented yet)
- app activate <app-name> ... - activates all specified applications
- app deactivate <app-name> ... - deactivates all specified applications
- app uninstall <app-name> ... - uninstalls all specified applications
REST API and Shell Utility
Orchestration systems and tools can use the REST API to interact with the application subsystem either directly, or using the onos-app shell utility, which uses the REST API and has the following usage:
- onos-app install <app.xml or app.zip> ... - installs application by uploading the specified app.xml or application package file
- onos-app install! <app.xml or app.zip> ... - installs and activates applications by uploading the specified app.xml or application package file
- onos-app reinstall <app-name> <app.xml or app.zip> ... - re-installs application by uploading the specified app.xml or application package file
- onos-app reinstall! <app-name> <app.xml or app.zip> ... - re-installs and activates applications by uploading the specified app.xml or application package file
- onos-app activate <app-name> ... - activates the specified application
- onos-app deactivate <app-name> ... - deactivates the specified application
- onos-app uninstall <app-name> ... - uninstalls the specified application
Maven Example
Example will come soon.
Builtin Sample and Test Applications
The following list describes the inventory of all builtin sample and test applications:
- org.onosproject.bgprouter - BGP router application, features
- org.onosproject.config - Network configuration application
- org.onosproject.demo - Flow throughput test application
- org.onosproject.election - Master election test application
- org.onosproject.fwd - Reactive forwarding application using flow subsystem
- org.onosproject.intentperf - Intent performance test application
- org.onosproject.metrics - Performance metrics collection
- org.onosproject.mobility - Host mobility application
- org.onosproject.null - Null southbound providers for testing
- org.onosproject.openflow - OpenFlow protocol southbound providers
- org.onosproject.optical - Packet/Optical use-case application
- org.onosproject.proxyarp - Proxy ARP/NDP application
- org.onosproject.sdnip - SDN/IP use-case application