ODL Honeycomb Development Notes =============================== Links ===== 1) Ed's ODL Summit 2015 Honeycomb Application Development Tuturial https://wiki.opendaylight.org/view/Controller_Core_Functionality_Tutorials:Application_Development_Tutorial https://github.com/flavio-fernandes/odlHelloTutorial 2) Maven http://maven.apache.org/install.html https://maven.apache.org/guides/mini/guide-proxies.html https://maven.apache.org/ref/3.3.3/maven-settings/settings.html https://maven.apache.org/guides/mini/guide-configuring-maven.html http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html 3) OpenDayLight https://wiki.opendaylight.org/view/GIT_Cheat_Sheet https://www.opendaylight.org/project-lifecycle-releases https://wiki.opendaylight.org/view/CrossProject:Integration_Group:System_Test:Step_by_Step_Guide https://wiki.opendaylight.org/view/Simultaneous_Release:Beryllium_Release_Plan https://wiki.opendaylight.org/view/OpenDaylight_Presentations:Main https://wiki.opendaylight.org/view/YANG_Tools:YANG_to_Java_Mapping https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Concepts https://wiki.opendaylight.org/view/OpenDaylight_Controller:Netconf:Design https://wiki.opendaylight.org/view/OpenDaylight_Controller:Config:Examples:Netconf#Configuring_Netconf_logging https://wiki.opendaylight.org/view/OpenDaylight_Controller:Lithium:Netconf:Integration_Test https://wiki.opendaylight.org/view/Controller_Core_Functionality_Tutorials:Tutorials:Netconf_Mount#Testing_against_ODL_itself_.28MD-SAL_netconf_northbound_loopback_mount.29 https://github.com/opendaylight/coretutorials https://github.com/opendaylight/mdsal/tree/master/model // IETF Yang Models https://github.com/opendaylight/ovsdb/blob/master/southbound/southbound-api/pom.xml#L78 // for 2013-07-15 version of ietf-yang-types https://github.com/opendaylight/ovsdb/blob/master/southbound/southbound-api/pom.xml#L54 // for mdsal.model // Data Change Listener examples https://github.com/opendaylight/vtn/blob/master/manager/neutron/src/main/java/org/opendaylight/vtn/manager/neutron/NeutronNetworkChangeListener.java https://github.com/opendaylight/ovsdb/blob/master/southbound/southbound-impl/src/main/java/org/opendaylight/ovsdb/southbound/OvsdbDataChangeListener.java https://github.com/opendaylight/vpnservice/blob/078ae023c9cceb14aaadea10c81a5f1d90f47789/interfacemgr/interfacemgr-impl/src/main/java/org/opendaylight/vpnservice/interfacemgr/InterfaceManager.java http://karaf.apache.org/ https://karaf.apache.org/manual/latest-2.2.x/developers-guide/features-maven-plugin-generate.html 4) Java / JNI http://stackoverflow.com/questions/3949260/java-class-isinstance-vs-class-isassignablefrom http://stackoverflow.com/questions/7275844/interface-as-a-type-in-java http://www.xyzws.com/javafaq/what-does-classforname-method-do/17 https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html https://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/types.html#type_signatures 5) Misc http://www.w3schools.com/tags/ref_urlencode.asp Installation/Environment ======================== 1) Packages to install apache-maven-3.3.3 (https://wiki.opendaylight.org/view/Install_On_Ubuntu_14.04) openjdk-7-jdk libssl-dev eclipse 2) Environment Variables: export ODL_USERNAME=dwallace export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.3 export PATH=/usr/local/apache-maven/apache-maven-3.3.3/bin:$PATH export MAVEN_OPTS='-Xmx4096m -XX:MaxPermSize=2048m' export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 export PATH=$JAVA_HOME/bin:$PATH Building/Installing ODL ======================= How-To's ======== 1) Build ODL - cd honeycomb/ - mvn clean install 4) Start up ODL - cd honeycomb/v3po/karaf/target/assembly/bin - sudo bash - ./karaf Note: use "./karaf debug" to enable remote debugging. Note: DON'T USE CTRL-D to quit. That fails to clean up gracefully. Best practice is to use "shutdown -f". Note: Building will run karaf which will fail if another instance is already running. It also touches/creates files in v3po/karaf... See #5 below for clean up recipe. 5) Testing with YANGUI - DOESN'T WORK WITH FIREFOX! :-( - Install google chrome. - Start chrome and enter the URL: http://localhost:8080/index.html#/yangui/index - Select "Yang UI" on left region - Expand (click on '+') v3po rev.2015.01.05 - Expand (click on '+') operations - Enter text ("Dave") in textbox next to "me" - Select "Send" - Results show up in "version" textbox: "Yo Dave! VPP interface list is [GigabitEthernet8/0/1: 5, TenGigabitEthernet86/0/0: 6, local0: 0]!" 6) Pre-build clean up - Running karaf as root touches files which will break the build. Do the following to clean up before building: shutdown -f sudo chown -R dwallace:floppy /scratch/dwallace/honeycomb-vpp/v3po/karaf 7) Adding YANG models NOTE: pom.xml dependency versions are managed via specifications. When including standard yang models (e.g. from org.opendaylight.mdsal.model), there needs to be a depencency defined to tell maven what version to download into the local repo. This isw why each dependency in the section does not contain version information. - Add a dependency in .../honeycomb/v3po/api/pom.xml - Add a dependency in .../honeycomb/v3po/features/pom.xml - Add a bundle in ../honeycomb/v3po/features/pom.xml NOTE: Yangtools don't unravel nested import statements, so all imported yang models referenced in v3po.yang must be explicitly imported (e.g. ietf-interfaces) 8) Useful CURL commands for debugging netconf mounts # show mounted nodes curl -su admin:admin http://127.0.0.1:8181/restconf/config/opendaylight-inventory:nodes?prettyPrint=true;echo # show node configuration curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/controller-config?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/vpp1?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/config:modules/module/odl-sal-netconf-connector-cfg:sal-netconf-connector/vpp2?prettyPrint=true;echo # show node connection status curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/controller-config?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp1?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp2?prettyPrint=true;echo # show mount config modules curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node//yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp1/yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp2/yang-ext:mount/?prettyPrint=true;echo # show mount config modules curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node//yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp1/yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin -H 'Accept: application/xml' -H 'Content-Type: application/xml' http://localhost:8181/restconf/config/network-topology:network-topology/topology/topology-netconf/node/vpp2/yang-ext:mount/?prettyPrint=true;echo # show mount operational modules curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node//yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/controller-config/yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp1/yang-ext:mount/?prettyPrint=true;echo curl -su admin:admin http://localhost:8181/restconf/operational/network-topology:network-topology/topology/topology-netconf/node/vpp2/yang-ext:mount/?prettyPrint=true;echo 9) Clean up ODL cache/state cd /scratch/dwallace/honeycomb-demo/r2demo/karaf/target/assembly/bin sudo rm -rf ../data/* sudo rm -f ../etc/opendaylight/current/*