Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

SDN-R is an extension of CCSDK (Common Controller Software Development KIt), and SDN-R uses the same procedure as CCSDK to create a running instance.   To begin, clone the ccsdk/distribution repository and look at the docker-compose.yml file in ccsdk/distribution/src/main/yaml. 

Image Added

The file is shown below with annotations (master branch, July 25, 2014).  This file It creates a running instance of CCSDK that is made up of three containers:

  • db: standard MySQL container; used by Directed Graphs
  • odlsli: OpenDaylight with Service Logic Interpreter features installed
  • dgbuilder: Directed Graph builder

...

Executing this docker-compose.yml file will create and launch the containers.  Navigate to <path>/ccsdk/distribution/src/main/yml and enter the commands as in the sample terminal session below (the credentials to login to NEXUS_DOCKER_REPO are docker:docker).  If you are executing this command for the first time, you will see output as the images are downloaded and extracted.

Code Block
titleLaunching CCSDK
%: cd ~/git/ccsdk/distribution/src/main/yaml/
%: echo $NEXUS_DOCKER_REPO
nexus3.onap.org:10001
%: echo $CCSDK_DOCKER_IMAGE_VERSION
0.3-STAGING-latest
%: docker login $NEXUS_DOCKER_REPO
Username (docker): docker
Password:
Login Succeeded
%: docker-compose up -d
Pulling db (mysql/mysql-server:5.6)...
5.6: Pulling from mysql/mysql-server
b0efbbec3b2e: Pull complete
8e6e4f7af9b1: Pull complete
eec4656740d1: Pull complete
8b211b61b1a0: Pull complete
Digest: sha256:7b98e112b35984811ca7bca963568508d6ff8bcc2f5b6b2ab27c7904e7bddb88
Status: Downloaded newer image for mysql/mysql-server:5.6
Pulling odlsli (nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.3-STAGING-latest)...
0.3-STAGING-latest: Pulling from onap/ccsdk-odlsli-image
6b51aaaf6d73: Pull complete
3f7a200f3556: Pull complete
d9a877cba71d: Pull complete
0d15639f94e1: Pull complete
4ea4d2cfdc50: Pull complete
75911c07ee2c: Pull complete
3bf025c6f4b3: Pull complete
212f5bf640e1: Pull complete
dcc9199ca5f6: Pull complete
b1db6eee88e2: Pull complete
05aa0c1f0ab6: Pull complete
f6e603372fc5: Pull complete
c4b04e9e266e: Pull complete
343aebc23b49: Pull complete
f0979cbb6c3b: Pull complete
9792711a23f5: Pull complete
d79e6928e946: Pull complete
e890641574b8: Pull complete
33a73540ec6c: Pull complete
Digest: sha256:f9e5c94dcbd2d4082d096f56750148233d9734731a3bf86da98fd6ac3e9b01fd
Status: Downloaded newer image for nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.3-STAGING-latest
Pulling dgbuilder (nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:0.3-STAGING-latest)...
0.3-STAGING-latest: Pulling from onap/ccsdk-dgbuilder-image
6b51aaaf6d73: Already exists
3f7a200f3556: Already exists
d9a877cba71d: Already exists
0d15639f94e1: Already exists
4ea4d2cfdc50: Already exists
75911c07ee2c: Already exists
0b529c7bd296: Pull complete
Creating ccsdk_db_container ... done
Creating ccsdk_odlsli_container ... done
Creating ccsdk_dgbuilder_container ... done
Creating ccsdk_odlsli_container ...
Creating ccsdk_dgbuilder_container ...


%:

Concurrently, in an other terminal session, you can observe the progress of the launching of the CCSDK containers by using the command 'docker-compose logs -f,' which is similar to a 'tail -f' command.

...

Code Block
titleBash session with the odlsli container
%: docker exec -t -i ccsdk_odlsli_container /bin/bash -c 'TERM=xterm exec /bin/bash'
root@744e3cc8a7fb:/# pwd
/
root@744e3cc8a7fb:/# echo $ODL_HOME
/opt/opendaylight/current
root@744e3cc8a7fb:/# echo $SDNC_CONFIG_DIR/
/opt/onap/ccsdk/data/properties/
root@744e3cc8a7fb:/# ps -elf | grep opendaylight
4 S root         1     0  0  80   0 -  1126 wait   18:34 ?        00:00:00 /bin/sh /opt/opendaylight/current/bin/karaf
0 S root        96     1  8  80   0 - 2002545 futex_ 18:34 ?      00:10:07 /usr/lib/jvm/java-8-openjdk-amd64/bin/java -Djava.security.properties=/opt/opendaylight/current/etc/odl.java.security -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+UnsyncloadClass -XX:+HeapDumpOnOutOfMemoryError -Dcom.sun.management.jmxremote -Djava.security.egd=file:/dev/./urandom -Djava.endorsed.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/endorsed:/usr/lib/jvm/java-8-openjdk-amd64/lib/endorsed:/opt/opendaylight/current/lib/endorsed -Djava.ext.dirs=/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext:/usr/lib/jvm/java-8-openjdk-amd64/lib/ext:/opt/opendaylight/current/lib/ext -Dkaraf.instances=/opt/opendaylight/current/instances -Dkaraf.home=/opt/opendaylight/current -Dkaraf.base=/opt/opendaylight/current -Dkaraf.data=/opt/opendaylight/current/data -Dkaraf.etc=/opt/opendaylight/current/etc -Dkaraf.restart.jvm.supported=true -Djava.io.tmpdir=/opt/opendaylight/current/data/tmp -Djava.util.logging.config.file=/opt/opendaylight/current/etc/java.util.logging.properties -Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true -classpath /opt/opendaylight/current/lib/boot/org.apache.karaf.diagnostic.boot-4.0.10.jar:/opt/opendaylight/current/lib/boot/org.apache.karaf.jaas.boot-4.0.10.jar:/opt/opendaylight/current/lib/boot/org.apache.karaf.main-4.0.10.jar:/opt/opendaylight/current/lib/boot/org.osgi.core-6.0.0.jar org.apache.karaf.main.Main
0 S root      1186  1164  0  80   0 -  2821 pipe_w 20:30 pts/0    00:00:00 grep --color=auto opendaylight
root@744e3cc8a7fb:/# cd $ODL_HOME
root@744e3cc8a7fbroot@cded16733254:/opt/opendaylight/current#opendaylight# ls
CONTRIBUTING.markdown  configuration  etc                lib        taglist.log
LICENSE                daexim         idmlight.db.mv.db  lock
README.markdown        data           instances          patches
bin                    deploy         journal            snapshots
build.url              derby.log      karaf.pid          system -l
total 76
-rw-r--r-- 1 root root  1126 Apr 19 02:59 CONTRIBUTING.markdown
-rw-r--r-- 1 root root 11266 Apr 19 02:59 LICENSE
-rw-r--r-- 1 root root   172 Apr 19 02:59 README.markdown
drwxr-xr-x 1 root root  4096 Jul 26 18:26 bin
-rw-r--r-- 1 root root    76 Apr 19 02:59 build.url
drwxr-xr-x 1 root root  4096 Jul 26 18:26 configuration
lrwxrwxrwx 1 root root    17 Jul 26 12:47 current -> /opt/opendaylight
drwxr-xr-x 3 root root  4096 Jul 26 18:26 daexim
drwxr-xr-x 1 root root  4096 Jul 26 18:26 data
drwxr-xr-x 2 root root  4096 Apr 19 02:59 deploy
drwxr-xr-x 1 root root  4096 Jul 26 18:26 etc
drwxr-xr-x 2 root root  4096 Jul 26 18:25 instances
drwxr-xr-x 2 root root  4096 Jul 26 18:26 journal
lrwxrwxrwx 1 root root    17 Jul 26 12:47 karaf-0.8.1 -> /opt/opendaylight
-rw-r--r-- 1 root root     3 Jul 26 18:25 karaf.pid
drwxr-xr-x 5 root root  4096 Apr 19 02:59 lib
-rw-r--r-- 1 root root     0 Jul 26 18:25 lock
drwxr-xr-x 2 root root  4096 Jul 26 18:26 snapshots
drwxr-xr-x 1 root root  4096 Jul 26 13:00 system
-rw-r--r-- 1 root root  1926 Apr 19 02:59 taglist.log
root@cded16733254:/opt/opendaylight# ls -l bin
total 3316
-rwxr-xr-x 1 root root 3231548 Apr 19 02:59 aaa-cli-jar.jar
-rwxr-xr-x 1 root root    3243 Apr 19 02:59 client
-rw-r--r-- 1 root root    4334 Apr 19 02:59 client.bat
-rwxr-xr-x 1 root root    8328 Apr 19 02:59 configure-cluster-ipdetect.sh
-rwxr-xr-x 1 root root    7388 Apr 19 02:59 configure_cluster.sh
drwxr-xr-x 2 root root    4096 Apr 19 02:59 contrib
-rwxr-xr-x 1 root root     722 Apr 19 02:59 custom_shard_config.txt
-rw-r--r-- 1 root root   16071 Jul 26 18:26 idmtool
-rwxr-xr-x 1 root root    9999 Apr 19 02:59 inc
-rwxr-xr-x 1 root root    4090 Apr 19 02:59 instance
-rw-r--r-- 1 root root    5364 Apr 19 02:59 instance.bat
-rwxr-xr-x 1 root root   11560 Apr 19 02:59 karaf
-rw-r--r-- 1 root root   16816 Apr 19 02:59 karaf.bat
-rwxr-xr-x 1 root root    2924 Apr 19 02:59 set_persistence.sh
-rwxr-xr-x 1 root root    2284 Apr 19 02:59 setenv
-rw-r--r-- 1 root root    2330 Apr 19 02:59 setenv.bat
-rwxr-xr-x 1 root root    3227 Apr 19 02:59 shell
-rw-r--r-- 1 root root    4702 Apr 19 02:59 shell.bat
-rwxr-xr-x 1 root root    2016 Apr 19 02:59 start
-rw-r--r-- 1 root root    2495 Apr 19 02:59 start.bat
-rwxr-xr-x 1 root root    1865 Apr 19 02:59 status
-rw-r--r-- 1 root root    2448 Apr 19 02:59 status.bat
-rwxr-xr-x 1 root root    1867 Apr 19 02:59 stop
-rw-r--r-- 1 root root    2444 Apr 19 02:59 stop.bat
root@744e3cc8a7fb:/opt/opendaylight/current# ./bin/client
Logging in as karaf

    ________                       ________                .__  .__       .__     __
    \_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_
     /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\
    /    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |
    \_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|
            \/|__|        \/     \/        \/     \/\/            /_____/      \/


Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root>




The entrypoint script for the odlsli container

...

And here is the startODL.sh file:

Creating the ODLSLI Container

To see how the ODLSLI container is constructed, we look at the pom.xml file in the directory ccsdk/distribution/odlsli.

...

ODLSLI pom.xml initialization and dependencies

Image Modified

ODLSLI pom.xml: Build Phases




We now see how the karaf features for OpenDaylight are structured so they can be installed and OpenDaylight launched.  The next step is to understand how the installation folders in CCSDK_HOME/features are created.  A good example is the 'sliapi' feature that is part of the CCSDK_CORE_FEATURES.  In the gerrit repository, this code appears in ccsdk/sli/core/sliapi.

...

Below is the annotated pom.xml file.  It executes two maven phases: prepare-package and package.  Maven executes the prepare-package phase before the package phase, although, in the pom.xml file, the prepare-package code appears after the prepare code.  In the annotations, the sequence is indicated by number.

Build Phase

The pom.xml file has three phases in the default life cycle:

  • validate
  • generate-sources
  • process-sources

And then, with