You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 21 Next »

Launching CCSDK

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.  The file is shown below with annotations (master branch, July 25, 2014).  This file 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 installed
  • dgbuilder: Directed Graph builder

Here are annotated contents of that file (master branch July 25, 2018, version 0.3.0-SNAPSHOT).

Executing this docker-compose.yml file will create and launch the containers.  Navigate to <path>/ccsdk/distribution/src/main/yml and enter the commands 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.

Launching 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.

Viewing the docker-compose log
%: cd ~/git/ccsdk/distribution/src/main/yaml/
%: docker-compose logs -f
Attaching to ccsdk_dgbuilder_container, ccsdk_odlsli_container, ccsdk_db_container
ccsdk_odlsli_container | Waiting for mysql
ccsdk_dgbuilder_container | ReleaseDir:sdnc1.0
ccsdk_dgbuilder_container | tput: No value for $TERM and no -T specified
ccsdk_dgbuilder_container | tput: No value for $TERM and no -T specified
ccsdk_dgbuilder_container | tput: No value for $TERM and no -T specified
ccsdk_dgbuilder_container | tput: No value for $TERM and no -T specified
ccsdk_odlsli_container | ..........
...
voluminous logging
...
ccsdk_dgbuilder_container | Welcome to Node-RED
ccsdk_dgbuilder_container | ===================
ccsdk_dgbuilder_container |
ccsdk_dgbuilder_container | 26 Jul 18:26:29 - [red] Version: 0.9.1
ccsdk_dgbuilder_container | 26 Jul 18:26:29 - [red] Loading palette nodes
ccsdk_dgbuilder_container | 26 Jul 18:26:30 - [red] Server now running at http://127.0.0.1:3100/

...

There may be additional messages, but you can check the status CCSDK containers as shown below:

View running docker containers
%: docker ps
CONTAINER ID        IMAGE                                                                 COMMAND                  CREATED             STATUS                   PORTS                     NAMES
7fd4d8d8ab15        nexus3.onap.org:10001/onap/ccsdk-dgbuilder-image:0.3-STAGING-latest   "/bin/bash -c 'cd /o…"   2 minutes ago       Up 2 minutes             0.0.0.0:3000->3100/tcp    ccsdk_dgbuilder_container
cded16733254        nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.3-STAGING-latest      "/opt/onap/ccsdk/bin…"   2 minutes ago       Up 2 minutes             0.0.0.0:8383->8181/tcp    ccsdk_odlsli_container
1880decd2cfc        mysql/mysql-server:5.6                                                "/entrypoint.sh mysq…"   2 minutes ago       Up 2 minutes (healthy)   0.0.0.0:32789->3306/tcp   ccsdk_db_container

You can browse to the OpenDaylight apidoc/explorer.  Note that port 8383 in the host is forwarded to port 8181 in the odlsli container, and the credentials are not the usual "admin:admin."  The password is shown below in the annotated startODL.sh file.

Working with the CCSDK containers

You can work with the CCSDK containers as you would any docker container, for example:

Bash 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@744e3cc8a7fb:/opt/opendaylight/current# 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
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

The entrypoint script for the odlsli container is /opt/onap/ccsdk/bin/startODL.sh.  Here is the home directory for the user ccsdk.

CCSDK home and bin directories
root@744e3cc8a7fb:~# cd /opt/onap/ccsdk
root@744e3cc8a7fb:/opt/onap/ccsdk# ls -l
total 28
drwxrwxr-x  1 root root 4096 Jun 28 23:58 ./
drwxrwxr-x  1 root root 4096 Jun  1 12:26 ../
-rw-r--r--  1 root root   42 Jun 28 23:58 .installed
drwxrwxr-x  2 root root 4096 Jun  1 12:26 bin/
drwxrwxr-x  4 root root 4096 Jun  1 12:26 data/
drwxrwxr-x 16 root root 4096 Jun  1 12:26 features/
drwxrwxr-x  6 root root 4096 Jun  1 12:26 svclogic/
root@744e3cc8a7fb:/opt/onap/ccsdk# ls -l bin
total 36
drwxrwxr-x 2 root root 4096 Jun  1 12:26 ./
drwxrwxr-x 1 root root 4096 Jun 28 23:58 ../
-rwxrwxr-x 1 root root 3131 Jun  1 12:26 installCcsdkFeatures.sh*
-rwxrwxr-x 1 root root 1082 Jun  1 12:26 installFeatures.sh*
-rwxrwxr-x 1 root root 1438 Jun  1 12:26 installOdlHostKey.sh*
-rwxrwxr-x 1 root root 1814 Jun  1 12:26 installSdncDb.sh*
-rwxrwxr-x 1 root root 4510 Jun  1 12:26 installZips.sh*
-rwxrwxr-x 1 root root 2311 Jun  1 12:26 startODL.sh*

And here is the startODL.sh file:

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

The ~/git/ccsdk/distribution/odlsli pom.xml file

This pom.xml file contructs the odlsli docker container.  We will discuss the file in sections.


So that script simply calls another script, possibly for backwards compatibility.  The installCcsdkFeatures.sh script contains:

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.

The sliapi directory contains the usual directories for a karaf feature with an additional directory "installer."  This directory contains the code that creates the installation folder stored in the CCSDK_HOME/features folder in the ODLSLI container.

Taking a look at the pom.xml file.

Inspecting the installer pom.xml file

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.

  • No labels