Tuesday, April 28, 2015

Building Karaf-based OpenDaylight Helium from the source

This is going to be a long post, addressing the issues I found as I built OpenDaylight Helium from the source. If you just want to use Karaf-based OpenDaylight, you may just download the pre-built version and execute, as described in my previous post.

This page is based on the wiki (and I suggest reading it first).
Checking out the codefor PROJECT in aaa affinity bgpcep controller defense4all dlux docs groupbasedpolicy integration l2switch \
lispflowmapping odlparent opendove openflowjava openflowplugin opflex ovsdb packetcable releng/autorelease releng/builder reservation sdninterfaceapp sfc snbi snmp4sdn tcpmd5 toolkit ttp vtn yangtools; \
do git clone https://git.opendaylight.org/gerrit/${PROJECT}.git ${PROJECT}; \
done


Checkout Stable branch
 Helium is the latest stable branch, which is all hot and new.
Helium:
$ for i in affinity bgpcep controller lispflowmapping openflowjava openflowplugin ovsdb/commons/parent vtn yangtools
do (cd "$i" && git checkout stable/helium ); done

A few modules already have a Lithium branch. So you may try to build their Lithium branch. However, Lithium build was failing for controller, dlux, and yangtools (at the time of writing), and I had to revert back to the Helium branch to get them built. 

Lithium:
$ for i in affinity bgpcep controller lispflowmapping openflowjava openflowplugin ovsdb/commons/parent vtn yangtools
do (cd "$i" && git checkout stable/lithium ); done

Alternatively, checkout Release tag
Helium:
$ for i in affinity bgpcep controller lispflowmapping openflowjava openflowplugin ovsdb/commons/parent vtn yangtools
do (cd "$i" && git checkout tags/release/helium ); done

Lithium:
$ for i in affinity bgpcep controller lispflowmapping openflowjava openflowplugin ovsdb/commons/parent vtn yangtools
do (cd "$i" && git checkout tags/release/lithium ); done

Maven build
------------------
$ for i in affinity bgpcep controller lispflowmapping openflowjava openflowplugin ovsdb/commons/parent vtn yangtools
do (cd "$i" && mvn clean install ); done
 


 
Execute OpenDaylight Karaf-based distribution$ cd ~/OpenDaylight/controller/opendaylight/distribution/opendaylight-karaf/target/assembly/bin
$ ./karaf


Install Dlux and other relevant features for the interface.
opendaylight-user@root>feature:install odl-restconf odl-l2switch-switch odl-mdsal-apidocs odl-dlux-core
Refreshing bundles org.apache.xbean.finder-shaded (65)
Error executing command: No feature named 'odl-l2switch-switch' with version '0.0.0' available
Error executing command: No feature named 'odl-dlux-core' with version '0.0.0' available

Build Integrator Bundle

This is because controller does not incloude the l2switch and dlux projects in the source code, and they should be built separately. Core features such as MD-SAL and AD-SAL are bundled with controller, and hence can be installed as above using the OSGi console. Hence, we should instead build the integration module following the controller, skipping the tests.
 
$ mvn clean install -D skipTests

$ cd ~/OpenDaylight/integration/distributions/extra/karaf/target/distribution-karaf-0.2.4-SNAPSHOT/bin
Now install the features.
feature:install odl-restconf odl-l2switch-switch odl-mdsal-apidocs odl-dlux-core


Execute the OpenDaylight Build.

Using the OpenDaylight build inside the integration bundle.
$ cd ~/OpenDaylight/integration/distributions/extra/karaf/target/distribution-karaf-0.2.4-SNAPSHOT/bin
$ ./karaf

Now you should be able to log in to the admin console from http://localhost:8181/dlux/index.html#/login

1 comment:

You are welcome to provide your opinions in the comments. Spam comments and comments with random links will be deleted.