<commit_before># Code
A common folder to share code for the 4th ONF Wireless PoC.

According to the software architecture ODL internal applications are stored in folder "apps" (applications), while the ODL DLUX client applications are stored in folder "ux" (user experience).

## Software Architecture
The following figure shows the proposed software architecture. 
Please consider it as a "working document" or guidelines.

![Software architecture](software_architecture.png?raw=true "Software architecture")

## Installation


This chapter describes how to install the SDN-Controller OpenDaylight and the applications
of the 3.  ONF Microwave Transport Network Proof-of-Concept on Ubuntu 16.04. 
These instructions should also work on other Debian derivative distributions.


### Step #1 Preparations

  - java-jdk: the Java development kit.
  
    Java8 is mandatory, below one of thousend procedures to install java8 on ubuntu.

      ```
      wget http://www.java.net/download/jdk8u60/archive/b07/binaries/jdk-8u60-ea-bin-b07-linux-x64-17_mar_2015.tar.gzsudo tar -xzvf jdk-8u60-ea-bin-b07-linux-x64-17_mar_2015.tar.gz
      sudo mkdir /usr/lib/jvm
      sudo mv ~/jdk1.8.0_60/ /usr/lib/jvm/
      sudo chown -R root:root /usr/lib/jvm/jdk1.8.0_60/
      sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_60/bin/java" 0
      sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_60/bin/javac" 0
      sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_60/bin/java
      sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_60/bin/javac
      ```
      
      Add the following two lines at the end of the profile file 
      ```
      export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_60 
      export PATH=$PATH:$JAVA_HOME/bin       
      ```
      ... and activate the profile.
      ```
      source /etc/profile
      ```
      
      Verify java installation : 
      ```
      update-alternatives --list java
      update-alternatives --list javac
      echo $JAVA_HOME
      java -version
      ```
      
  - maven: the Apache build manager for Java projects.
           Follow the [maven installation](https://maven.apache.org/install.html) instructions.
       
       Here a short version.

      ```
      wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
      sudo tar xzvf apache-maven-3.3.9-bin.tar.gz -C /usr/share/
      sudo update-alternatives --install /usr/bin/mvn mvn /usr/share/apache-maven-3.3.9/bin/mvn 150
      sudo update-alternatives --config mvn
      export PATH=/usr/share/apache-maven-3.3.9/bin:$PATH
      ```

      Feel to update PATH variable in /etc/environment.

      OpenDaylight requires specific maven settings. Please see  [ODL wiki](https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup#Edit_your_.7E.2F.m2.2Fsettings.xml)      
      
      ```
      mkdir -p ~/.m2 && \
      cp -n ~/.m2/settings.xml{,.orig} ; \
      wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
      ```
       
  - git: the version control system.

      ```
      sudo add-apt-repository ppa:git-core/ppa -y
      sudo apt-get update
      sudo apt-get install git -y
      ```

  - node.js: the JavaScript runtime environment.

      ```
      sudo apt-get install nodejs npm jq --
      sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 150
      sudo update-alternatives --config node
      sudo ln -s /usr/bin/nodejs /usr/bin/node
      curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
      sudo apt-get install -y nodejs
      sudo npm install -g npm
      ```
      Please see also the instrucion for the [test automation app](https://github.com/OpenNetworkingFoundation/CENTENNIAL/blob/master/test/INSTALL.md).

  - bower: the package manager for the web components.

      ```
      sudo npm install -g bower
      ```

The setup can be verified with the following commands:

package | min. Version
------- | -----------
java -version | 1.8
mvn --version | 3.3.9
git --version | 2.7.4
node --version | 6.7.0
npm --version | 3.10.3
jq --version | 1.5
bower --version | 1.7.9


### Step #2 - OpenDaylight and database

Example directory structure under user's home:
```
drwxrwxr-x  5 your_user_name your_user_name 4096 Okt 25 17:18 ./
drwxr-xr-x 25 your_user_name your_user_name 4096 Okt 25 16:50 ../
drwxrwxr-x 15 your_user_name your_user_name 4096 Okt 20 14:26 CENTENNIAL/
drwxrwxr-x 14 your_user_name your_user_name 4096 Okt 25 20:04 distribution-karaf-0.5.1-Boron-SR1/
drwxrwxr-x  6 your_user_name your_user_name 4096 Okt 25 17:18 elasticsearch-head/
```

#### Step #2.1 - Download Karaf/ Opendaylight package and unpack
The 4th ONF Wireless PoC applications are developed for OpenDaylight Boron-SR1 release.

```
wget https://nexus.opendaylight.org/groups/public/org/opendaylight/integration/distribution-karaf/0.5.1-Boron-SR1/distribution-karaf-0.5.1-Boron-SR1.tar.gz
tar -xvzf distribution-karaf-0.5.1-Boron-SR1.tar.gz
cd distribution-karaf-0.5.1-Boron-SR1/
```
The folder "distribution-karaf-0.5.1-Boron-SR1/" is also called "$ODL_KARAF_HOME" in the following sections.
Add an environment variable with an editor to the end of ~/.profile and ~/.bashrc

```<commit_msg>ODL Boron SR1 download path changed<commit_after># Code
A common folder to share code for the 4th ONF Wireless PoC.

According to the software architecture ODL internal applications are stored in folder "apps" (applications), while the ODL DLUX client applications are stored in folder "ux" (user experience).

## Software Architecture
The following figure shows the proposed software architecture. 
Please consider it as a "working document" or guidelines.

![Software architecture](software_architecture.png?raw=true "Software architecture")

## Installation


This chapter describes how to install the SDN-Controller OpenDaylight and the applications
of the 3.  ONF Microwave Transport Network Proof-of-Concept on Ubuntu 16.04. 
These instructions should also work on other Debian derivative distributions.


### Step #1 Preparations

  - java-jdk: the Java development kit.
  
    Java8 is mandatory, below one of thousend procedures to install java8 on ubuntu.

      ```
      wget http://www.java.net/download/jdk8u60/archive/b07/binaries/jdk-8u60-ea-bin-b07-linux-x64-17_mar_2015.tar.gzsudo tar -xzvf jdk-8u60-ea-bin-b07-linux-x64-17_mar_2015.tar.gz
      sudo mkdir /usr/lib/jvm
      sudo mv ~/jdk1.8.0_60/ /usr/lib/jvm/
      sudo chown -R root:root /usr/lib/jvm/jdk1.8.0_60/
      sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0_60/bin/java" 0
      sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0_60/bin/javac" 0
      sudo update-alternatives --set java /usr/lib/jvm/jdk1.8.0_60/bin/java
      sudo update-alternatives --set javac /usr/lib/jvm/jdk1.8.0_60/bin/javac
      ```
      
      Add the following two lines at the end of the profile file 
      ```
      export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_60 
      export PATH=$PATH:$JAVA_HOME/bin       
      ```
      ... and activate the profile.
      ```
      source /etc/profile
      ```
      
      Verify java installation : 
      ```
      update-alternatives --list java
      update-alternatives --list javac
      echo $JAVA_HOME
      java -version
      ```
      
  - maven: the Apache build manager for Java projects.
           Follow the [maven installation](https://maven.apache.org/install.html) instructions.
       
       Here a short version.

      ```
      wget https://archive.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
      sudo tar xzvf apache-maven-3.3.9-bin.tar.gz -C /usr/share/
      sudo update-alternatives --install /usr/bin/mvn mvn /usr/share/apache-maven-3.3.9/bin/mvn 150
      sudo update-alternatives --config mvn
      export PATH=/usr/share/apache-maven-3.3.9/bin:$PATH
      ```

      Feel to update PATH variable in /etc/environment.

      OpenDaylight requires specific maven settings. Please see  [ODL wiki](https://wiki.opendaylight.org/view/GettingStarted:Development_Environment_Setup#Edit_your_.7E.2F.m2.2Fsettings.xml)      
      
      ```
      mkdir -p ~/.m2 && \
      cp -n ~/.m2/settings.xml{,.orig} ; \
      wget -q -O - https://raw.githubusercontent.com/opendaylight/odlparent/master/settings.xml > ~/.m2/settings.xml
      ```
       
  - git: the version control system.

      ```
      sudo add-apt-repository ppa:git-core/ppa -y
      sudo apt-get update
      sudo apt-get install git -y
      ```

  - node.js: the JavaScript runtime environment.

      ```
      sudo apt-get install nodejs npm jq --
      sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 150
      sudo update-alternatives --config node
      sudo ln -s /usr/bin/nodejs /usr/bin/node
      curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
      sudo apt-get install -y nodejs
      sudo npm install -g npm
      ```
      Please see also the instrucion for the [test automation app](https://github.com/OpenNetworkingFoundation/CENTENNIAL/blob/master/test/INSTALL.md).

  - bower: the package manager for the web components.

      ```
      sudo npm install -g bower
      ```

The setup can be verified with the following commands:

package | min. Version
------- | -----------
java -version | 1.8
mvn --version | 3.3.9
git --version | 2.7.4
node --version | 6.7.0
npm --version | 3.10.3
jq --version | 1.5
bower --version | 1.7.9


### Step #2 - OpenDaylight and database

Example directory structure under user's home:
```
drwxrwxr-x  5 your_user_name your_user_name 4096 Okt 25 17:18 ./
drwxr-xr-x 25 your_user_name your_user_name 4096 Okt 25 16:50 ../
drwxrwxr-x 15 your_user_name your_user_name 4096 Okt 20 14:26 CENTENNIAL/
drwxrwxr-x 14 your_user_name your_user_name 4096 Okt 25 20:04 distribution-karaf-0.5.1-Boron-SR1/
drwxrwxr-x  6 your_user_name your_user_name 4096 Okt 25 17:18 elasticsearch-head/
```

#### Step #2.1 - Download Karaf/ Opendaylight package and unpack
The 4th ONF Wireless PoC applications are developed for OpenDaylight Boron-SR1 release.

```
wget https://nexus.opendaylight.org/content/repositories/public/org/opendaylight/integration/distribution-karaf/0.5.1-Boron-SR1/distribution-karaf-0.5.1-Boron-SR1.tar.gz
tar -xvzf distribution-karaf-0.5.1-Boron-SR1.tar.gz
cd distribution-karaf-0.5.1-Boron-SR1/
```
The folder "distribution-karaf-0.5.1-Boron-SR1/" is also called "$ODL_KARAF_HOME" in the following sections.
Add an environment variable with an editor to the end of ~/.profile and ~/.bashrc

```
{'fraction_non_alphanumeric': 0.11686252564819996, 'fraction_numerical': 0.0400111919418019, 'mean_word_length': 2.7065330107155203, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 14, 'lorem ipsum': 0, 'www.': 2, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '711132', 'n_tokens_mistral': 3971, 'n_tokens_neox': 3559, 'n_words': 969}