summaryrefslogtreecommitdiffstats
path: root/fuel/build/f_lith_odl_docker/dockerfile
diff options
context:
space:
mode:
authorDan Smith <daniel.smith@ericsson.com>2015-06-12 13:08:42 -0400
committerDan Smith <daniel.smith@ericsson.com>2015-06-12 13:08:42 -0400
commiteb887812da568cfb4908f6ae14449b2ceaeb5bc0 (patch)
tree44ec0e7087fb4f63d60348a074c0a334c5ab3d49 /fuel/build/f_lith_odl_docker/dockerfile
parent5cc4c1455698767349e88022449c0c00d0e61239 (diff)
Adding in support for Lithium container.
Both will be present on the controller nodes and can be started/switches on and off at will. Networking scripts are not updated - will be deprecated in favour of plugin method of enabling / setting up VXLAN / OVSDB integration pulling from the latest nightly artifact at time of commit - will work on automated pulling each night to see if that makes sense. Change-Id: Ie911cdf61cd97a99b975c30c55c664daf70eb3ee JIRA: 0 Signed-off-by: Dan Smith <daniel.smith@ericsson.com>
Diffstat (limited to 'fuel/build/f_lith_odl_docker/dockerfile')
-rwxr-xr-xfuel/build/f_lith_odl_docker/dockerfile/Dockerfile72
-rwxr-xr-xfuel/build/f_lith_odl_docker/dockerfile/container_scripts/check_feature.sh8
-rwxr-xr-xfuel/build/f_lith_odl_docker/dockerfile/container_scripts/speak.sh17
-rwxr-xr-xfuel/build/f_lith_odl_docker/dockerfile/container_scripts/start_odl_docker.sh38
4 files changed, 135 insertions, 0 deletions
diff --git a/fuel/build/f_lith_odl_docker/dockerfile/Dockerfile b/fuel/build/f_lith_odl_docker/dockerfile/Dockerfile
new file mode 100755
index 0000000..e3c7ee5
--- /dev/null
+++ b/fuel/build/f_lith_odl_docker/dockerfile/Dockerfile
@@ -0,0 +1,72 @@
+####################################################################
+#
+# Dockerfile to build a ODL (Karaf) Docker Container
+#
+# Copyright daniel.smith@ericsson.com
+# License: Apache GPL
+#
+####################################################################
+
+
+#Set the base image - note: the current release of Karaf is using Jdk7 and alot of 12.04, so we will use it rather than 14.04 and backport a ton of stuff
+FROM ubuntu:12.04
+
+# Maintainer Info
+MAINTAINER Daniel Smith
+
+#Run apt-get update one start just to check for updates when building
+RUN echo "Updating APT"
+RUN apt-get update
+RUN echo "Adding wget"
+RUN apt-get install -y wget
+RUN apt-get install -y net-tools
+RUN apt-get install -y openjdk-7-jre
+RUN apt-get install -y openjdk-7-jdk
+RUN apt-get install -y openssh-server
+RUN apt-get install -y vim
+RUN apt-get install -y expect
+RUN apt-get install -y daemontools
+RUN mkdir -p /opt/odl_source
+RUN bash -c 'echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> ~/.bashrc'
+
+
+#Now lets got and fetch the ODL distribution
+RUN echo "Fetching ODL"
+RUN wget https://nexus.opendaylight.org/content/groups/public/org/opendaylight/integration/distribution-karaf/0.2.3-Helium-SR3/distribution-karaf-0.2.3-Helium-SR3.tar.gz -O /opt/odl_source/distribution-karaf-0.2.3-Helium-SR3.tar.gz
+
+RUN echo "Untarring ODL inplace"
+RUN mkdir -p /opt/odl
+RUN tar zxvf /opt/odl_source/distribution-karaf-0.2.3-Helium-SR3.tar.gz -C /opt/odl
+
+RUN echo "Installing DLUX and other features into ODL"
+COPY tmp/dockerfile/container_scripts/start_odl_docker.sh /etc/init.d/start_odl_docker.sh
+COPY tmp/dockerfile/container_scripts/speak.sh /etc/init.d/speak.sh
+RUN chmod 777 /etc/init.d/start_odl_docker.sh
+RUN chmod 777 /etc/init.d/speak.sh
+
+
+# Expose the ports
+# PORTS FOR BASE SYSTEM AND DLUX
+EXPOSE 8101
+EXPOSE 6633
+EXPOSE 1099
+EXPOSE 43506
+EXPOSE 8181
+EXPOSE 8185
+EXPOSE 9000
+EXPOSE 39378
+EXPOSE 33714
+EXPOSE 44444
+EXPOSE 6653
+
+# PORTS FOR OVSDB AND ODL CONTROL
+EXPOSE 12001
+EXPOSE 6640
+EXPOSE 8080
+EXPOSE 7800
+EXPOSE 55130
+EXPOSE 52150
+EXPOSE 36826
+
+# set the ENTRYPOINT - An entry point allows us to run this container as an exectuable
+CMD ["/etc/init.d/start_odl_docker.sh"]
diff --git a/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/check_feature.sh b/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/check_feature.sh
new file mode 100755
index 0000000..3e5d0b2
--- /dev/null
+++ b/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/check_feature.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/expect
+spawn /opt/odl/distribution-karaf-0.2.3-Helium-SR3/bin/client
+expect "root>"
+send "feature:list | grep -i odl-restconf\r"
+send "\r\r\r"
+expect "root>"
+send "logout\r"
+
diff --git a/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/speak.sh b/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/speak.sh
new file mode 100755
index 0000000..3ba07a8
--- /dev/null
+++ b/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/speak.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/expect
+# Ericsson Research Canada
+#
+# Author: Daniel Smith <daniel.smith@ericsson.com>
+#
+# Simple expect script to start up ODL client and load feature set for DLUX and OVSDB
+#
+# NOTE: THIS WILL BE REPLACED WITH A PROGRAMATIC METHOD SHORTLY
+# DEPRECATED AFTER ARNO
+
+spawn /opt/odl/distribution-karaf-0.2.3-Helium-SR3/bin/client
+expect "root>"
+send "feature:install odl-base-all odl-aaa-authn odl-restconf odl-nsf-all odl-adsal-northbound odl-mdsal-apidocs odl-ovsdb-openstack odl-ovsdb-northbound odl-dlux-core"
+send "\r\r\r"
+expect "root>"
+send "logout\r"
+
diff --git a/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/start_odl_docker.sh b/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/start_odl_docker.sh
new file mode 100755
index 0000000..1c72dda
--- /dev/null
+++ b/fuel/build/f_lith_odl_docker/dockerfile/container_scripts/start_odl_docker.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+# Ericsson Research Canada
+#
+# Author: Daniel Smith <daniel.smith@ericsson.com>
+#
+# Start up script for calling karaf / ODL inside a docker container.
+#
+# This script will also call a couple expect scripts to load the feature set that we want
+
+
+#ENV
+export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
+
+#MAIN
+echo "Starting up the da Sheilds..."
+/opt/odl/distribution-karaf-0.2.3-Helium-SR3/bin/karaf server &
+echo "Sleeping 5 bad hack"
+sleep 10
+echo "should see stuff listening now"
+netstat -na
+echo " should see proess running for karaf"
+ps -efa
+echo " Starting the packages we want"
+/etc/init.d/speak.sh
+echo "Printout the status - if its right, you should see 8181 appear now"
+netstat -na
+ps -efa
+
+
+
+## This is a loop that keeps our container going currently, prinout the "status of karaf" to the docker logs every minute
+## Cheap - but effective
+while true;
+do
+ echo "Checking status of ODL:"
+ /opt/odl/distribution-karaf-0.2.3-Helium-SR3/bin/status
+ sleep 60
+done