SDN-R Compile for Flourine SR1
SDN-R microservices in ONAP Dublin/El Alto are compiled in gerrit since first version of 0.4.2 for Opendaylight Flourine SR2.
If there is the need to run this services in Opendaylight Flourine SR1 environment the adaption can be done in a few simple steps, that are descirbed here.
Test environment for creating and running docker container is located here: https://github.com/onap-oof-pci-poc/ccsdk/tree/master/distribution/odlwt-alpine-standalone-0.4.1-SNAPSHOT
- 1 ONAP to ODL Dependency Background
- 2 Example for adapting to a different Opendaylight version
- 3 Create and run a Wireless transport micro services (wt) Container
- 3.1 Creation of 0.4.1-SNAPSHOUT Version for ODL Flourine SR1
- 3.2 Compile features and create image
- 3.3 Parameters
- 3.3.1 Cluster specific
- 3.3.2 Examples
- 3.3.2.1 Start single node
- 3.3.2.2 Start three node clusters
- 3.3.3 Reference
- 3.4 Container ports
- 4 Version reference ODL ↔ ONAP
ONAP to ODL Dependency Background
The parent used in the pom file for a CCSDK feature is defining the Opendaylight Version that is targeted as run time environment. The interfaces provided by an Opendaylight main version, like Flourine, are not changed from one SRn to SRn+1.
If the feature needs to be executed by using a different opendaylight version, all pom.xml need to be adjusted and the features need to be compiled. That's it.
The artifacts version number should be use the schema from table below to prevent confusion.
Artifacts version number | Parents version number | Target ODL Version |
---|---|---|
0.4.1/0.4.1-SNAPSHOT | 1.2.1/1.2.1-SNAPSHOT | Flourine SR1 |
0.4.2/0.4.2-SNAPSHOT | 1.2.2/1.2.2-SNAPSHOT | Flourine SR2 |
0.5.0/0.5.0-SNAPSHOT | 1.3.0/1.3.0-SNAPSHOT | Flourine SR2 |
0.5.0/0.5.0-SNAPSHOT | 1.3.1/1.3.1-SNAPSHOT | Flourine SR2 |
Example for adapting to a different Opendaylight version
Prerequ:
Server with Ubuntu with development setup for ONAP with access to ONAP Nexus.
Example uses:
onap microservice: ccsdk/features:sdnr/wt
artifact version/parent version: 0.4.2-SNAPSHOT with 1.2.2-SNAPSHOT
Target version is: 0.4.1-SNAPSHOT/1.2.1-SNAPSHOT
Steps to create a Flourine SR1 Version, by example for using 0.4.2-SNAPSHOT.
Clone gerrit ccsdk/feature repository to features
Copy recurse sdnr/wt tree into new sdnr/wt-0.4.1 directory
Change the version numbers in th pom files accordingly
Compile the microservice that the result is in local .m2 repository for related use
in .m2/repository under org/onap/ccsdk/features/sdnr/wt the bundles are now available with version 0.4.1-SNAPSHOT
All bundles are included into sdnr-wt-feature-aggregator. See dependency below.
<dependency>
<groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
<artifactId>sdnr-wt-feature-aggregator-installer</artifactId>
<version>0.4.1-SNAPSHOT</version>
<classifier>repo</classifier>
<type>zip</type>
</dependency>
Related command sequence
Example with Ubuntu and bash, ONAP dev environment.
Hint:It can not be excluded that the version number to replace by sed is used by something else in the pom.xml.
As a check use grep command with the version numbers to replace and verify if the list contains the elementes expected:
grep "<version>1\.2\.2-SNAPSHOT</version>" $(find . -name pom.xml)
grep "<version>0\.4\.2-SNAPSHOT</version>" $(find . -name pom.xml)
Replacing the version number:
cd ~
git clone git clone https://gerrit.onap.org/r/ccsdk/features
cd features/sdnr/wt
cp -r wt wt-0.4.1
cd wt-0.4.1
sed -i 's#<version>1.2.2-SNAPSHOT</version>#<version>1.2.1-SNAPSHOT</version>#g' $(find . -name "pom.xml")
sed -i 's#<version>0.4.2-SNAPSHOT</version>#<version>0.4.1-SNAPSHOT</version>#g' $(find . -name "pom.xml")
mvn clean install
Create and run a Wireless transport micro services (wt) Container
Refering to github repository https://github.com/onap-oof-pci-poc/ccsdk with distribution/odlwt-alpine-standalone-0.4.1-SNAPSHOT
This distribution uses the ONAP ODL image "onap/ccsdk-odl-fluorine-alpine-image" to create the ONAP WT Container.
Container image versin 0.4.1-SNAPSHOUT with OpenDaylight Flourine SR1
There is no dependency to other ONAP Containers.
This version is including 0.4.1-SNAPSHOT features.
Configuration used by this container
Linux alpine as OS
ODL as single node or cluster node
Added bundles are Repository: 'ccsdk/features'/sdnr
ENTRYPOINT /opt/onap/ccsdk/bin/startSdnr.sh
ODLUX Login: - ODL Default is user here: admin/admin
Creation of 0.4.1-SNAPSHOUT Version for ODL Flourine SR1
The ONAP Dublin parents 1.2.1-SNAPSHOT and 1.2.1 are creating the bundles for ODL Flourine SR1. Parents with higher version number are creating bundles for ODL Floutine SR2.
Prerequ: Ubuntu with development setup for ONAP with access to ONAP Nexus.
Steps to create a Flourine SR1 Version, by example for using 0.4.2-SNAPSHOT:
cd features/sdnr/wt cp -r wt wt-0.4.1 cd wt-0.4.1 sed -i 's#<version>1.2.2-SNAPSHOT</version>#<version>1.2.1-SNAPSHOT</version>#g' $(find . -name "pom.xml") sed -i 's#<version>0.4.2-SNAPSHOT</version>#<version>0.4.1-SNAPSHOT</version>#g' $(find . -name "pom.xml")
Hint: It could occur that the versin number is used by something in the pom.xml. As a check use grep command with the version numbers to replace:
grep "<version>1\.2\.1-SNAPSHOT</version>" $(find . -name pom.xml)
Compile features and create image
After changing the version numbers a private build is required of "wireless transport" features for version "0.4.1-SNAPSHOT".
cd features/sdnr/wt mvn clean install
Create image with
cd distribution/odlwt-alpine-standalone-0.4.1-SNAPSHOT mvn clean install -P docker
HINT: ONAP/Nexus does contain also a bundle with such a version number. This version is used as default if no compilation was done. Indication is such error: "[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.16.5:build (generate-images) on project distribution-odlwt-alpine: Unable to build image [oof-pci/ccsdk-odlwt-alpine-image]: COPY failed: stat /var/lib/docker/tmp/docker-builder864199067/preload.cache.schema: no such file or directory -> [Help 1]"
Parameters
SDNRWT true|false
Switch on the SDNRWT feature.
Cluster specific
Node index, provided via host-name
Format name-n
n defines the host index. Starts with 0 .. N-1. Index of the cluster node that is started.
--env SDNC_REPLICAS=n
n Number of cluster members.
--env PEERODLCLUSTER="true"
Set to any value for non GEO redundant setup.
--env ENABLEODLCLUSTER="true"
Mandatory to enable cluster configuration
Examples
Start single node
docker run imageName
Start three node clusters
docker run imageName --env NODE_INDEX="1" --env NODE_LIST="10.42.167.43 10.42.168.2 192.168.178.65" docker run imageName --env NODE_INDEX="2" --env NODE_LIST="10.42.167.43 10.42.168.2 192.168.178.65" docker run imageName --env NODE_INDEX="3" --env NODE_LIST="10.42.167.43 10.42.168.2 192.168.178.65"
Reference
Opendaylight cluster configuration
Container ports
docker run --detach --publish 8181:8181 --name sdnr "$IMAGE"
Version reference ODL ↔ ONAP
Import during compile is to have the same mdsal version inuse that is also provided by the Opendaylight/Karaf OSGi system.
If the Opendaylight Version name is known, e.g. Flourine/SR2 the related mdsal api information can be found by github opendaylight repository in the pom that is creating this API. This repository contains the names of the opendaylight version as Tag or Branch. It is located here: https://github.com/opendaylight/mdsal/blob/release/fluorine-sr3/binding/mdsal-binding-api/pom.xml . The artifact <version> is the relevant version number, here 2.5.2
Client: Enter a running sdnr container and open client by $ODL_HOME/bin/client. that is also visible with karaf/opendaylight/client under feature:list and used by a specific ODL Version. Search for odl-mdsal-binding: odl-mdsal-binding │ 2.5.2 │ │ Started │ odl-mdsal-binding │ OpenDaylight :: MD-SAL :: Binding
Repository: The list command "ls $ODL_HOME/system/org/opendaylight/mdsal/mdsal-binding-api/" indicates a directory with related version number. Here "2.5.2"
In ONAP/ccsdk the same version number is specified in via parent pom.xml by the <odl.mdsal.version>2.5.2</odl.mdsal.version> parameter.
In the example above all this version numbers should show 2.5.2 and the world is OK.