diff options
author | 2018-07-10 18:07:44 +0200 | |
---|---|---|
committer | 2018-07-11 16:30:28 -0400 | |
commit | 27fb2d06608fbb070ae2c15a5580a4f5b2423d15 (patch) | |
tree | ccd717991b4e556b67f1fd2cacb345b4d174b41f /sdnr/wireless-transport/code-Carbon-SR1/docs | |
parent | 60315525ab5e7c12a9f47c409092e8dba6ad656d (diff) |
Add seed code for sdnr app based on ONF Centennial
At this point in time all the Carbon code from ONF Centennial is added to ONAP.
Later it needs to be refactored and modified for ODL Oxygen.
Change-Id: Iff85dd940c05c3827f1c4e6f9542ecd060c58a46
Issue-ID: SDNC-374
Signed-off-by: demx8as6 <martin.skorupski@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wireless-transport/code-Carbon-SR1/docs')
10 files changed, 752 insertions, 0 deletions
diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/README2CreateApp4Carbon.md b/sdnr/wireless-transport/code-Carbon-SR1/docs/README2CreateApp4Carbon.md new file mode 100644 index 00000000..e21b3aa4 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/README2CreateApp4Carbon.md @@ -0,0 +1,292 @@ +# Create app for ODL Boron and some backgrounds + +## Common information and workshop tasks + +### Overall + + - Demo ODL, GUI and Simulators + - [Opendaylight](http://5g-crosshaul.eu/wp-content/uploads/2016/10/UC3M_5tonic_SdnOdlDay_19Oct2016.pdf) + - Three slides: 6:MDSAL, 8:AppDev, 11:Karaf + - Demo Eclipse + - User's home and the tools to use + - Git/ Maven &co mvn command, .m2 + - HANDS-ON: Setup Single server development environment + - Follow [DevEnv](READMEInstallDevelopmentEnvironment.md) + +### Karaf + + - OSGi and what does Karaf do + - [osgi](https://en.wikipedia.org/wiki/OSGi) + - [karaf](https://stackoverflow.com/questions/17350281/what-exactly-is-apache-karaf) + - How does it come and the directory structure + - Opendaylight karaf [odlkaraf](https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/) + - show setup + - Repository + - data log + - Bundles and Features + - related xml files + - clean start + - Start&stop + - commands start/stop/client + - command karaf + - command line + - start and list features and bundles + - Debug and log files + - see read me + - Problems + - Startup timing + +### Network applications + + - commons bundle and parents + - See CENTENNIAL/code/features (features-parent) + - binding-parent => Access of MDSAL + - config-parent => Push config xml file + - Karaf / Yang and the device model + - DLUX, Angular JS, Chromium + - Clone myapp + - ODL Datamodel, Access the database and the Netconf model + - [Documentation Boron](http://docs.opendaylight.org/en/stable-boron/) + - [ArchetypeRPCHelloWorld](https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Startup_Project_Archetype) + + +## 1. Create app for ODL Boron + +### 1.1. Prerequirements + +- Development environment for ODL Boron according to Description "InstallDevelopmentEnvironment". +- Clone from git the projects CENTENNIAL and WirelessTranportEmulator to get the following structure + ``` + odl + ├── CENTENNIAL + ├── WirelessTransportEmulator + └── distribution-karaf-0.6.1-Carbon + ``` + +### 1.2. Create the app + +Approach is to copy the template application in the CENTENNIAL repository apps directory and adapt it to the needs.<br/> + - Northbound: Provide RPC northbound + - Southbound: Monitors mountpoints connected to netconf devices. + +The template app is located here: + + CENTENNIAL/code/apps/template/ + ├── api + │ ├── pom.xml + │ └── src + ├── impl + │ ├── pom.xml + │ └── src + ├── features + │ ├── pom.xml + │ └── src + └── pom.xml + +Use the commandline and copy template to a new directory and modify with vi + + cd ~/odl/CENTENNIAL/code/apps + cp -r template myapp + +### 1.3. Adapt myapp + +Remove files which are recreated later + + cd myapp + rm -r target api/target impl/target + rm -r .settings/ api/.settings/ impl/.settings/ + rm -r .project api/.project impl/.project + +Change with eclipse editor (or vi) within the directory tree the four pom.xml files from<br/> +template_something to myapp_something + + Example: + + <artifactId>myapp</artifactId> + <name>myapp</name> + +Adapt in the impl/pom.xml and the features/pom.xml the dependency to the myapps-api project. + +Import into eclipse under the apps working set, that you see the new projects: + - myapp + - myapp-api + - myapp-impl + - myapp-features + +Using eclipse do rename + + - filename or partial filenames from "template" to "myapp" + - .yang file in myapp-api + - .yang file in myapp-impl + - bundle name in myapp-impl/src/main/java to org.opendaylight.mwtn.myapp + +Modify module name, namespace, prefix revision date of myapp-api yang file: + + module myapp { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:myapp"; + prefix "myapp"; + + revision "2018-01-23" { + description "Initial revision of myapp model"; + } + + rpc hello-world { + input { + leaf name { + type string; + } + } + output { + leaf greeting { + type string; + } + } + } + } + +Similar with myapp-impl yang file. Adapt module name, namespace, prefix, revision date, java-name-prefix. + + module myapp-impl { + yang-version 1; + namespace "urn:opendaylight:params:xml:ns:yang:myapp:impl"; + prefix "myapp-impl"; + + import config { prefix config; revision-date 2013-04-05; } + import opendaylight-md-sal-binding { prefix md-sal-binding; revision-date 2013-10-28;} + + description + "Service definition for myapp project"; + + revision "2018-01-23" { + description + "Initial myapp revision"; + } + + identity myapp { + base config:module-type; + config:java-name-prefix MyappImpl; + } + + augment "/config:modules/config:module/config:configuration" { + case myapp { + when "/config:modules/config:module/config:type = 'myapp'"; + container broker { + uses config:service-ref { + refine type { + mandatory true; + config:required-identity md-sal-binding:binding-broker-osgi-registry; + } + } + } + } + } + } + +Adapt Java classes using eclipse refactor + + - TemplateAppProvider -> MyAppProvider + - TemplateServiceImpl -> MyAppServiceImpl + +HINT1: The enabled *eclipse -> project -> Build Automatically* option interferes with external Maven builds in the command line. You can see strange errors during maven build. If this is the case than disable it and try again. Basically handling is easier if option is switched on, but disable it before you use cli/maven. + +HINT2: After cli/maven build is done use F5 to see all generated files files. + +HINT3: If you feel that errors are all corrected, but the errors will not go away in eclipse use *eclipse -> projects -> clean* for the project. + +Enable *eclipse -> project -> Build Automatically* or use maven build command below to build the app.<br/> + + cd myapp + mvn clean install -DskipTests -Dmaven.javadoc.skip=true + +You see the new created sources with the timestamp in the package name.<br/> +Open "MyAppImplModule" and fill the implementation with addapted code similar to the code in the "TemplateImplModule.java" in the function "createInstance()". The eclipse refactor has already renamed the code snippet to the right class name. + +Next steps: + + - Remove the old package. + - Correct the imports where necessary + +If all errors are corrected, do a cli maven build. If you see this you are ready with this section. + + [INFO] Reactor Summary: + [INFO] + [INFO] myapp-api .......................................... SUCCESS [ 10.130 s] + [INFO] myapp-impl ......................................... SUCCESS [ 4.644 s] + [INFO] ONF :: Wireless :: myapp-features .................. SUCCESS [ 8.811 s] + [INFO] myapp .............................................. SUCCESS [ 3.727 s] + [INFO] ------------------------------------------------------------------------ + [INFO] BUILD SUCCESS + [INFO] ------------------------------------------------------------------------ + +In case of errors: + + - Remove all targets + rm -r target api/target impl/target features/target + - Grep for all string "template" and replace + grep -r template + - Activate enough logging + - (!)Remove in the karaf the xml config file: rm $ODL_KARAF_HOME/etc/opendaylight/karaf/myapp.xml. New install of the feature/bundle is required to re-create this file. + + +### 1.4 Test it + +HINT1: At this point your .m2 repository needs to contain all jars of the applications in apps, features and ux. If not done before you need to compile everything with the following command: + + cd ~/odl/CENTENNIAL/code + mvn clean install -DskipTests + +HINT2: If karaf container is already running you get a feedback that start is not possible. Use the stop command to stop it: + + cd ~/odl/CENTENNIAL/code + ./install.sh stop + +HIN3: In new environment you should use the the ```./odl``` command insteadt of ```./install.sh``` +Change to the code directory and start the karaf container using the *imd* option: + + cd ~/odl/CENTENNIAL/code + ./install.sh imd + +To **Test it** step into to the karaf cli: + + ./karafcmd.sh + +Add the new feature in the karaf command line: + + feature:repo-add mvn:org.opendaylight.mwtn/myapp-features/0.4.0-SNAPSHOT/xml/features + feature:install odl-mwt-myapp + bundle:list + +You are done with this test if you see something like this, especially the last line is important! + + herbert@vm2-herbert:~/odl/distribution-karaf-0.5.3-Boron-SR3/data/log$ grep -ia "session i" * + 2018-01-23 20:24:18,651 | INFO | config-pusher | TemplateProvider | 331 - org.opendaylight.mwtn.template-impl - 0.4.0.SNAPSHOT | TemplateProvider Session Initiated + 2018-01-23 20:24:18,760 | INFO | config-pusher | WebsocketmanagerProvider | 329 - org.opendaylight.mwtn.websocketmanager-impl - 0.4.0.SNAPSHOT | WebsocketmanagerProvider Session Initiated + 2018-01-23 20:26:39,218 | INFO | config-pusher | MyAppProvider | 337 - org.opendaylight.mwtn.myapp-impl - 0.4.0.SNAPSHOT | TemplateProvider Session Initiated + +Nect test is to access the RPC via restonf. This is done via ODLs APIDOC explorer. +Use this link to open the application, enter login credentials admin, admin <br/> +[odl apidoc](http://127.0.0.1:8181/apidoc/explorer/index.html) + + +### 1.5. Change higher-level POM files + + - code/feature.xml + - code/pom.xml + +### 1.6. Adapt install.sh script + + - code/install.sh + +## 2.0 Test and debug app + +### 2.1 Setup and connect netconf simulator + + +### 2.2 Setup ODL debug level + + +### Remarks + + - Karaf Intro and Install + - Simulators diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/README2CreateTarBundle.md b/sdnr/wireless-transport/code-Carbon-SR1/docs/README2CreateTarBundle.md new file mode 100644 index 00000000..24396842 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/README2CreateTarBundle.md @@ -0,0 +1,124 @@ +# Create a delivery Tar bundle + +Comprehensive How-to-create list for a ODL/Karaf bundle that can be used to be installed as "Choice 1" refering to the README.MD. +In the CENTENNIAL/bin directory the script *createTarBundle.sh* bases on this description. + +#### Start configuration + +Setup a server + - ubuntu 16.04 + - odl-karaf boron + +Setup OpenDaylight + - All ODL-Setup steps executed from README.MD Choice 2 Steps #1 - #3.1 + +During step #2.3 enable logging within karaf command line: + + log:set DEBUG com.highstreet.technologies + log:set TRACE org.opendaylight.netconf + + +#### build applications + + mvn clean install -DskipTests + +#### some checks + + echo $JAVA_HOME + echo $JAVA_MAX_MEM + echo $ODL_KARAF_HOME + + +#### clean + + rm -rf ~/.m2/repository/com/highstreet/technologies/odl/app/closedLoopAutomation-karaf/ + rm -rf ~/.m2/repository/com/highstreet/technologies/odl/app/spectrum/scheduler-karaf/ + find ~/.m2/repository/org/opendaylight/mwtn/* -type d -name "*-module" -exec rm -rf {} \; + find ~/.m2/repository/com/hcl/* -type d -name "*-module" -exec rm -rf {} \; + find ~/.m2/repository/com/highstreet/* -type d -name "*-module" -exec rm -rf {} \; + rm -rf $ODL_KARAF_HOME/cache/schema/tailf*.yang + rm -rf $ODL_KARAF_HOME/cache/schema/yuma*.yang + +#### remove + + rm $ODL_KARAF_HOME/etc/org.ops4j.pax.web.cfg + rm -rf $ODL_KARAF_HOME/data/* + rm -rf $ODL_KARAF_HOME/system/org/opendaylight/mwtn + rm -rf $ODL_KARAF_HOME/system/com/hcl + rm -rf $ODL_KARAF_HOME/system/com/highstreet + +#### deploy + + mkdir -p $ODL_KARAF_HOME/system/cn + mkdir -p $ODL_KARAF_HOME/system/cn/com + cp -R ~/.m2/repository/org/opendaylight/mwtn $ODL_KARAF_HOME/system/org/opendaylight + cp -R ~/.m2/repository/cn/com/zte $ODL_KARAF_HOME/system/cn/com + cp -R ~/.m2/repository/com/hcl $ODL_KARAF_HOME/system/com + cp -R ~/.m2/repository/com/highstreet $ODL_KARAF_HOME/system/com + +#### Copy into new directory and create tar file + + TARDIR=onf-wireless-4th-poc-karaf-0.5.3-Boron-SR3-2017-06-22 + mkdir $TARDIR + cp -r distribution-karaf-0.5.3-Boron-SR3/* $TARDIR + tar -czvf "$TARDIR.tar.gz" $TARDIR + + +#### install in karaf console + + cd $ODL_KARAF_HOME + ./bin/karaf clean + + feature:install odl-netconf-topology + feature:install odl-netconf-connector-all + feature:install odl-restconf-all + feature:install odl-mdsal-apidocs + feature:install odl-dlux-all + feature:repo-add mvn:org.opendaylight.mwtn/mwtn-parent/0.4.0-SNAPSHOT/xml/features + feature:install elasticsearch + feature:install odl-mwtn-all + feature:repo-add mvn:com.highstreet.technologies.odl.app/route-features/0.4.0-SNAPSHOT/xml/features + feature:install odl-route + +#### perform tests with DLUX UI + +-> if test successfully done deliver already created TAR package +-> Link in Centennial anpassen + +#### Appendix +.......................... + + # remove all required nes + # unmount all devices + # close DLUX UI + + # delete logs in ElasticSearch using delete plug in + + http://localhost:9200/mwtn/log/ + http://localhost:9200/sdnevents/ + http://localhost:9200/sdnperformance/ + + + # shutdown karaf + logout + + + # clear karaf + + ./bin/karaf clean + logout + rm -rf $ODL_KARAF_HOME/cache/schema/tailf*.yang + rm -rf $ODL_KARAF_HOME/cache/schema/yuma*.yang + rm -rf $ODL_KARAF_HOME/data/log/* + + + # IMPORTANT!!! + # make sure that no hardcoded references are in karaf + + rm $ODL_KARAF_HOME/etc/org.ops4j.pax.web.cfg + + cd .. + + mv onf-wireless-4th-poc-karaf-0.5.3-Boron-SR3-2017-06-22 + + tar -czvf onf-wireless-4th-poc-karaf-0.5.3-Boron-SR3-2017-06-22.tar.gz onf-wireless-4th-poc-karaf-0.5.3-Boron-SR3-2017-06-22 diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment.md b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment.md new file mode 100644 index 00000000..be6f2f50 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment.md @@ -0,0 +1,133 @@ +## 1. Setup ODL network app development environment + +Description of how to get an development environment for creating network applications on top of opendaylight. +The development environment is a single server solution with graphical front-end for the developer. +The ODL Boron release is used as basis. + +### 1.1. Server setup + +Server setup for a development server with eclipse as IDE, ODL Boron Karaf container and NE Simulators. +Remote Desktop is used to access the server via a VPN connection. + - From Windows PC: MS Remote Desktop + - From Ubuntu PC: There are some. Example: Remmina Remote Desktop Client (sudo apt install remmina) + +Capacity of the VM Server should be about 4 CPUs and 8 Gig of RAM and 50 Gig of HDD. + +#### Base software: + + - ubuntu server edition (16.04.03 LTS) + - xfce desktop + - xrdp : remote management GUI + - For setup that supports copy and paste use the PPA Version 0.9.x + - version standard repository version 0.6.x is basically also working. + - chromium + +#### xrdp PPA install + +Do the following steps and restart server if done. + +1. Answer yes, if asked about overwriting etc/xrdp/xrdp.ini + + ``` + sudo add-apt-repository ppa:hermlnx/xrdp + sudo apt-get update + sudo apt-get install xrdp + sudo apt-get upgrade + ``` + +2. Switch of extensive gui features. In ubuntu desktop goto menu on the left right corner <br/> + to **Applications-> Settings -> Windows Manager Tweaks**, select folder Compositor and + disable it by unchecking the option. + +3. Improve performance (if required) + + Change configuration in /etc/xrdp/xrdp.ini + - Security level high to none + +4. Change sudo vi /etc/xrdp/sessman.ini and add change to '.thinclient_drives' (see the dot) + + [Chansrv] + ; drive redirection, defaults to xrdp_client if not set + FuseMountName=.thinclient_drives + + +4. reboot server to activate xrdp configuration + +5. Login with RPC application connect to server. Use defaults and enter existing user an password. + + +#### Adaption for Windows Client: + - Adapt TAB key handling ([details askubuntu](https://askubuntu.com/questions/352121/bash-auto-completion-with-xubuntu-and-xrdp-from-windows)):<br/> + edit the `~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml` file to unset the following mapping + ``` + < <property name="<Super>Tab" type="string" value="switch_window_key"/> + --- + > <property name="<Super>Tab" type="string" value="empty"/> + ``` + NOTE: There may be two entries, and the first already has the value "empty". If this is the case, edit the second entry. + +#### Adding further tools + +Add chromium as browser + - See [details askubuntu](https://wiki.ubuntuusers.de/Chromium/Installation/) + + sudo apt-get install chromium-browser chromium-browser-l10n chromium-codecs-ffmpeg + +### 1.2 Directory structure + +home + - eclipse (Eclipse installation directory) + - odl (Workspace) + - CENTENNIAL (network application) + - other projects go here + - distribution-karaf-0.6.1-Carbon (opendaylight karaf run-time environment) + +Prereq: + - Access to highstreet technologies gitlab server and to project "CENTENNIAL" + - Gerrit account [Create account](https://wiki.opendaylight.org/view/OpenDaylight_Controller:Gerrit_Setup) + + +### 1.3 Install setup ODL_KARAF_HOME, Java, eclipse, mvn, draw and tools + + Setup in home directory .bashrc like follows and logout/login to activate. + + export ODL_KARAF_DIST="distribution-karaf-0.6.1-Carbon" + export ODL_KARAF_HOME="$HOME/odl/$ODL_KARAF_DIST" + export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" + + Verify + + echo $ODL_KARAF_HOME + + According to step 2.2 [CENTENNIAL/code/README.md](../README.md#step-22---download-CENTENNIAL-applications) + - openjdk (sudo apt-get install) + - mvn, configure maven for ODL + - bower + - ODL Boron distribution + + And this software + - libre office draw (sudo apt-get install libreoffice-draw) + - eclipse via oomph for ODL Development + + Example eclipse configuration for user "Herbert" + + ![eclipse parameters](READMEInstallDevelopmentEnvironment_1_eclipseinst.png?raw=true "Eclipse parameters") + + After install .. change setting below for Secure Store: + + ![eclipse adaption](READMEInstallDevelopmentEnvironment_2_secureStore.png?raw=true "Secure store option") + + Add plugins from eclipse marketplace + - "GitHub Flavored Markdown viewer plugin 1.8.3" (GFM) + - Elcipse YANG editor + + +### 2. Create app + +See the documentation [create app documentation](READMECreateApp4Carbon.md) + + +### 3. Remarks + + - Karaf Intro and Install + - Simulators (Three times) diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment_1_eclipseinst.png b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment_1_eclipseinst.png Binary files differnew file mode 100644 index 00000000..bfb752f4 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment_1_eclipseinst.png diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment_2_secureStore.png b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment_2_secureStore.png Binary files differnew file mode 100644 index 00000000..aeeabc80 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEInstallDevelopmentEnvironment_2_secureStore.png diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEMigrateBoronSR1-2-SR3.md b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEMigrateBoronSR1-2-SR3.md new file mode 100644 index 00000000..ac207762 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEMigrateBoronSR1-2-SR3.md @@ -0,0 +1,86 @@ +# Change ODL version from "Boron-SR1" to "Boron-SR3" + +## Update ~/.profile +Change the Environment variables ODL_KARAF_HOME and ODL_KARAF_DIST. + +``` +sed -i 's/1-Boron-SR1/3-Boron-SR3/g' ~/.profile +source ~/.profile +``` + +## Download the distribution +Download the required disctribution into the Download folder. + +``` +cd $HOME/Downloads/ +wget https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.5.3-Boron-SR3/distribution-karaf-0.5.3-Boron-SR3.tar.gz +``` + +## Create the DLUX patch +For updating DLUX with newer anagular-bootstrap version and small modification in css, the ODL DLUX project must be cloned modified and build. + +``` +mkdir $HOME/dlux-patch-boron-sr3 +cd $HOME/dlux-patch-boron-sr3 +git clone https://git.opendaylight.org/gerrit/dlux +cd dlux +git checkout tags/release/boron-sr3 + +# modify anchor color (must not always be dark) +sed -i 's/\tcolor: #414042 !important;/\tcolor: #414042;/' dlux-web/src/less/design.less + +# select new versions for angular-bootstrap and font-awesome +sed -i 's/"angular-bootstrap": "~0.13.0",/"angular-bootstrap": "~2.1.3",/' dlux-web/bower.json +sed -i 's/"font-awesome": "~4.0.3",/"font-awesome": "~4.7.0",/' dlux-web/bower.json + +# build dlux - ignore all errors ;) or update ODL DLUX project - it may take 5 to 15min +mvn clean install -DskipTests + +# deploy ($ODL_KARAF_HOME does not exits yet - deploy later) +# cp $HOME/dlux-patch-boron-sr3/dlux/loader/impl/target/loader.implementation-0.4.3-Boron-SR3.jar $ODL_KARAF_HOME/system/org/opendaylight/dlux/loader.implementation/0.4.3-Boron-SR3/ +cp $HOME/dlux-patch/dlux/loader/impl/target/loader.implementation-0.4.3-Boron-SR3.jar $HOME/workspace/ht/SDN-Projects-Boron/code/apps/dlux/ +``` + +## Prepare OpenDaylight karaf +``` +cd $HOME/workspace/ht/SDN-Projects-Boron/code +find . -name \pom.xml -exec sed -i "s/1-Boron-SR1/3-Boron-SR3/g" {} \; +find . -name \mwtnCommons.services.js -exec sed -i "s/Boron-SR1/Boron-SR3/g" {} \; +./install.sh prepare +./install.sh a +cp $HOME/dlux-patch-boron-sr3/dlux/loader/impl/target/loader.implementation-0.4.3-Boron-SR3.jar $ODL_KARAF_HOME/system/org/opendaylight/dlux/loader.implementation/0.4.3-Boron-SR3/ +``` + +## Start the engines! +``` +cd $ODL_KARAF_HOME +./bin/karaf clean +``` + +## Install karaf features +``` +# pure OpenDaylight +feature:install odl-netconf-topology +feature:install odl-restconf-all +feature:install odl-mdsal-apidocs +feature:install odl-dlux-all + +# persistent database (ElasticSearch) +feature:repo-add mvn:org.apache.karaf.decanter/apache-karaf-decanter/1.1.0/xml/features +feature:install elasticsearch + +# Wireless (mwtn: microwave transport network) +feature:repo-add mvn:org.opendaylight.mwtn/mwtn-parent/0.4.0-SNAPSHOT/xml/features +feature:install odl-mwtn-all + +# Logging settings +log:set DEBUG org.opendaylight.mwtn +log:set TRACE org.opendaylight.netconf + +# check +info +log:list +``` + + + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEOperateAndDebugODL.md b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEOperateAndDebugODL.md new file mode 100644 index 00000000..40ec62c2 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/READMEOperateAndDebugODL.md @@ -0,0 +1,63 @@ +## Operate and debug ODL for testing + +### Debug ODL + +#### Activate or deactivate log point + +Getting Log info about a specific service: + + log:set DEBUG com.highstreet.technologies + +Getting all NETCONF/YANG traffic (Hint: huge amount of data, only for test purpose): + + log:set TRACE org.opendaylight.netconf + +For switching off logging set level to INFO to see the log point + + log:set INFO org.opendaylight.netconf + +For deleting the log point for a package + + log:set DEFAULT org.opendaylight.netconf + +Configuration of logging is done here: + + vi $ODL_KARAF_HOME/etc/org.ops4j.pax.logging.cfg + +#### View the log + +A good option is to cd into the log directory and use grep and vi to view into the logs. + + cd $ODL_KARAF_HOME/bin/data/log + +A second option is within the karaf command line to use the command *log:display* in combination with grep. + + log:display | grep + + +### Operate ODL + +#### In shell or background + +There are two way to start and run ODL. The command are available in the $ODL_KARAF_HOME/bin directory. + + 1. In the karaf shell + - Using *./bin/karaf* command to run ODL in a shell. + - In this way of operation ODL is running if the shell is running. + - If you leave the shell by shutdown or logout command ODL is stopped. + + 2. In the background + - Use command *./bin/start*, *./bin/stop* to run and stop ODL. + - Attaching to the command line with *client* + - In this way of operation ODL is running in the background. + +#### Check if ODL is running + +A good way to check if ODL is running is to use the command + + ps -ef | grep karaf + +The feedback of *status* is not always true during startup or shutdown. +In some cases ODL run two times in a JVM what needs to be avoided. + + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/dist.conf b/sdnr/wireless-transport/code-Carbon-SR1/docs/dist.conf new file mode 100644 index 00000000..78c60300 --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/dist.conf @@ -0,0 +1,6 @@ +#Example configuration +ODL_KARAF_DIST="distribution-karaf-0.6.1-Carbon" +ODL_KARAF_HOME=$HOME/odl/$ODL_KARAF_DIST +ODL_KARAF_DISTGZ="$HOME/Downloads/"$ODL_KARAF_DIST".tar.gz" +#ODL_KARAF_AFTERCMD_DELAY_SECONDS="0" +export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/installServiceExample.sh b/sdnr/wireless-transport/code-Carbon-SR1/docs/installServiceExample.sh new file mode 100644 index 00000000..e83c350d --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/installServiceExample.sh @@ -0,0 +1,48 @@ +#!/bin/bash +# Install feature powercontroll / FRINX +# Example for script based setup of KARAF container + +karafcmd() { + echo $1 + ./bin/client "$1" +} + +echo pull from git +cd ~/apps/CENTENNIAL/code/apps/wirelessPowerControl/impl +git pull +echo compile +mvn clean install -DskipTests + + +echo copy the files +cp -R ~/.m2/repository/com/highstreet/technologies/odl/app/wi* $ODL_KARAF_HOME/system/com/highstreet/technologies/odl/app + +cd $ODL_KARAF_HOME +echo stop +./bin/stop +sleep 30 + +echo start clean +./bin/start clean + +sleep 30 +echo install +karafcmd "feature:install odl-netconf-topology" +karafcmd "feature:install odl-netconf-connector-all" +karafcmd "feature:install odl-restconf-all" +karafcmd "feature:install odl-mdsal-apidocs" +karafcmd "feature:install odl-dlux-all" +karafcmd "feature:repo-add mvn:org.opendaylight.mwtn/mwtn-parent/0.4.0-SNAPSHOT/xml/features" +karafcmd "feature:install elasticsearch" +karafcmd "feature:repo-add mvn:com.highstreet.technologies.odl.app/wirelessPowerControl-features/0.4.0-SNAPSHOT/xml/features" +karafcmd "feature:install odl-wirelessPowerControl" +karafcmd "feature:install odl-mwtn-all" +karafcmd "feature:repo-add mvn:com.highstreet.technologies.odl.app/route-features/0.4.0-SNAPSHOT/xml/features" +karafcmd "feature:install odl-route" + +./bin/stop +sleep 30 +./bin/start + +echo "Ready" + diff --git a/sdnr/wireless-transport/code-Carbon-SR1/docs/software_architecture.png b/sdnr/wireless-transport/code-Carbon-SR1/docs/software_architecture.png Binary files differnew file mode 100755 index 00000000..3f59963e --- /dev/null +++ b/sdnr/wireless-transport/code-Carbon-SR1/docs/software_architecture.png |