This tutorial will guide you through the development workflow for ONOS applications in SEBA. The aaa
application will be used as an example, but the same workflow is valid for any ONOS application.
In order to follow this tutorial you need to:
{% include "/partials/siab-short.md" %}
We assume you already have done changes to your application code and that you need to build it and push it to a running ONOS.
To build the application, just enter the appropriate folder and invoke the maven
target:
cd ~/cord/onos-apps/apps/aaa/ mvn clean install
Once the application is built, you can push it to ONOS using the onos-app
command:
onos-app -P 30120 -u karaf -p karaf <myregistrydomain.com> reinstall! org.opencord.aaa app/target/aaa-app-1.10.0-SNAPSHOT.oar
where myregistrydomain.com
is the public ip
of your SiaB
machine.
If the commands succeed you should see an output similar to:
{"name":"org.opencord.aaa","id":173,"version":"1.10.0.SNAPSHOT","category":"Traffic Steering","description":"802.","readme":"802.1x authentication service.","origin":"ON.Lab","url":"http://onosproject.org","featuresRepo":"mvn:org.opencord/aaa-app/1.10.0-SNAPSHOT/xml/features","state":"ACTIVE","features":["aaa-app"],"permissions":[],"requiredApps":["org.opencord.sadis"]}
Important!!
Please remember that the application .oar
can be generated in a different location depending on the application structure and that the version included in the SNAPSHOT file name can differ.
You can get the
onos-app
command you can get it here and add it to your$PATH
In certain cases you want to deploy SEBA-in-a-box automatically including your development applications, for example to verify that the end to end flow is correctly working.
In order to do that you need to:
We suggest to create a nginx
container and deploy it on top of the kubernetes cluster, but if have a company web-server that is reachable by ONOS that can be a viable option.
A Dockerfile
to build a nginx
web-server containing development .oar
s is provided with the code. You can build such container by:
cd ~/cord/onos-apps docker build -t opencord/mavenrepo:candidate -f Dockerfile.apps . ... Successfully built fda11faac37f Successfully tagged opencord/mavenrepo:candidate
NOTE that this step requires a
docker-registry
to be installed in the cluster. If you don't have it, you can follow these instructions.
Once the container is build, you can push it to the remote docker-registry
using these commands:
docker tag opencord/mavenrepo:candidate myregistrydomain.com:30500/opencord/mavenrepo:candidate docker push myregistrydomain.com:30500/opencord/mavenrepo:candidate The push refers to repository [myregistrydomain.com:30500/opencord/mavenrepo] 2781364a4526: Pushed 8a32ae098140: Pushed 7c9c7be9dce0: Pushed 9a6bd1609bff: Pushed 77e23640b533: Pushed 757d7bb101da: Pushed 3358360aedad: Pushed candidate: digest: sha256:38788909e84ffb955a41fd14eea9c19f4596bb9b3b7f3181a1332499b7709b94 size: 1786
where myregistrydomain.com
is the public ip
of your SiaB
machine.
Once the container is loaded in the docker-registry
you can you helm
to deploy it from the SiaB host machine:
cd ~/cord/helm-charts helm install -n mavenrepo cord/mavenrepo --set image.tag=candidate \ --set image.repository=myregistrydomain.com:30500/opencord/mavenrepo
In order to install custom versions of the application during the installation process, you need to create a value file called ~/custom.yaml
(on the SiaB host machine) with the following values:
If you already have a value file to specify other container images you can simply extend that one
aaaAppUrl: "myregistrydomain.com:30160/repository/aaa-app-1.10.0-SNAPSHOT.oar" aaaAppVersion: "1.10.0.SNAPSHOT"
where myregistrydomain.com
is the public ip
of your SiaB
machine.
You can then install SEBA-in-a-box with:
SEBAVALUES=~/custom.yaml make
You can find a full list of the application names and URLs here: