Browse Source

Add OpenDaylight Container to kolla

Implements docker container template for OpenDaylight.

Change-Id: Icdcff77f0f6088f5a4db1bf77e37334dbd42074f
Partially-Implements: blueprint opendaylight-support
changes/69/416369/42
Marcus G K Williams 6 years ago
parent
commit
278bcdb154
  1. 0
      contrib/template-override/.keep
  2. 22
      contrib/template-override/opendaylight-template-overrides.j2
  3. 9
      doc/index.rst
  4. 0
      doc/template-override/.keep
  5. 38
      doc/template-override/opendaylight-source.rst
  6. 44
      docker/opendaylight/Dockerfile.j2
  7. 10
      docker/opendaylight/extend_start.sh
  8. 5
      docker/opendaylight/opendaylight.repo
  9. 15
      kolla/common/config.py
  10. 3
      releasenotes/notes/add-opendaylight-fee2807442ce3c6d.yaml
  11. 4
      tests/test_build.py

0
contrib/template-override/.keep

22
contrib/template-override/opendaylight-template-overrides.j2

@ -0,0 +1,22 @@
{% extends parent_template %}
{% block neutron_server_footer %}
ADD plugins-archive /
RUN pip --no-cache-dir install /plugins/*
{% endblock %}
{% block opendaylight_source_install %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set opendaylight_packages = ['java-1.8.0-openjdk'] %}
{% elif base_distro in ['ubuntu', 'debian'] %}
{% set opendaylight_packages = ['openjdk-8-jre'] %}
{% endif %}
{{ macros.install_packages(opendaylight_packages | customizable("packages")) }}
{% if opendaylight_distro is not defined %}
{% set opendaylight_distro = 'distribution-karaf-0.5.3-Boron-SR3' %}
{% endif %}
ADD opendaylight-archive /opendaylight
RUN ln -s /opendaylight/{{ opendaylight_distro }} /opt/opendaylight
{% endblock %}

9
doc/index.rst

@ -55,3 +55,12 @@ Developer Docs
CONTRIBUTING
running-tests
bug-triage
Template Override Docs
======================
.. toctree::
:maxdepth: 1
:glob:
template-override/*

0
doc/template-override/.keep

38
doc/template-override/opendaylight-source.rst

@ -0,0 +1,38 @@
==================
OpenDaylight Build
==================
To build OpenDaylight, use of a template override
`opendaylight-template-overrides.j2` is needed.
The template override enables OpenDaylight use
with OpenStack by installing required networking-odl
plugin in neutron-server container.
If you wish to install a different version of OpenDaylight
then distro packages, use a source build (in most cases this is
a prebuilt binary package).
Building OpenDaylight Containers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- For source builds append the following to kolla-build.conf,
selecting the version of OpenDaylight to use for your source build.
- Change `opendaylight_distro` to match the folder where OpenDaylight
build resides. For example, if using prebuilt archive from OpenDaylight
downloads `distribution-karaf-0.5.3-Boron-SR3.tar.gz` becomes
`distribution-karaf-0.5.3-Boron-SR3`.
kolla-build.conf
________________
.. code-block:: console
opendaylight_distro = distribution-karaf-0.5.3-Boron-SR3
[opendaylight]
type = url
location = https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/integration/distribution-karaf/0.5.3-Boron-SR3/distribution-karaf-0.5.3-Boron-SR3.tar.gz
Build the container (source or binary) by executing the following command::
::
kolla-build --template-override contrib/template-override/opendaylight-template-overrides.j2 opendaylight

44
docker/opendaylight/Dockerfile.j2

@ -0,0 +1,44 @@
FROM {{ namespace }}/{{ image_prefix }}base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block opendaylight_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='opendaylight') }}
{% if install_type == 'binary' %}
{% set opendaylight_packages = ['opendaylight'] %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% if opendaylight_repo is not defined %}
{% set opendaylight_repo = 'opendaylight.repo' %}
{% endif %}
COPY {{ opendaylight_repo }} /etc/yum.repos.d/
{% elif base_distro in ['ubuntu', 'debian'] %}
{% if odl_release_deb_url is not defined %}
{% if base_distro in 'ubuntu' %}
{% set odl_release_deb_url = 'http://download.opensuse.org/repositories/home:/akshitajha/xUbuntu_16.04/' %}
{% elif base_distro in 'debian' %}
{% set odl_release_deb_url = 'http://download.opensuse.org/repositories/home:/akshitajha/Debian_8.0/' %}
{% endif %}
{% endif %}
RUN sh -c "echo 'deb {{ odl_release_deb_url }} /' > /etc/apt/sources.list.d/opendaylight.list" \
&& apt-get update
{% endif %}
{{ macros.install_packages(opendaylight_packages | customizable("packages")) }}
{% elif install_type == 'source' %}
{% block opendaylight_source_install %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endblock %}
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
{% block opendaylight_footer %}{% endblock %}
{% block footer %}{% endblock %}

10
docker/opendaylight/extend_start.sh

@ -0,0 +1,10 @@
#!/bin/bash
OPENDAYLIGHT_LOG_DIR=/var/log/kolla/opendaylight
if [[ ! -d "${OPENDAYLIGHT_LOG_DIR}" ]]; then
mkdir -p "${OPENDAYLIGHT_LOG_DIR}"
fi
if [[ $(stat -c %a "${OPENDAYLIGHT_LOG_DIR}") != "755" ]]; then
chmod 755 "${OPENDAYLIGHT_LOG_DIR}"
fi

5
docker/opendaylight/opendaylight.repo

@ -0,0 +1,5 @@
[opendaylight]
name=CentOS CBS OpenDaylight Release Repository
baseurl=http://cbs.centos.org/repos/nfv7-opendaylight-5-release/$basearch/os/
enabled=1
gpgcheck=0

15
kolla/common/config.py

@ -49,6 +49,7 @@ _PROFILE_OPTS = [
'mariadb',
'memcached',
'mongodb',
'opendaylight',
'openvswitch',
'rabbitmq',
'redis',
@ -460,6 +461,10 @@ SOURCES = {
'type': 'url',
'location': ('$tarballs_base/neutron-lbaas/'
'neutron-lbaas-master.tar.gz')},
'neutron-server-plugin-networking-odl': {
'type': 'url',
'location': ('$tarballs_base/networking-odl/'
'networking-odl-master.tar.gz')},
'neutron-server-plugin-neutron-dynamic-routing': {
'type': 'url',
'location': ('$tarballs_base/neutron-dynamic-routing/'
@ -496,6 +501,12 @@ SOURCES = {
'type': 'url',
'location': ('$tarballs_base/octavia/'
'octavia-master.tar.gz')},
'opendaylight': {
'type': 'url',
'location': ('https://nexus.opendaylight.org/content/'
'repositories/opendaylight.release/org/opendaylight/'
'integration/distribution-karaf/0.5.3-Boron-SR3/'
'distribution-karaf-0.5.3-Boron-SR3.tar.gz')},
'panko-base': {
'type': 'url',
'location': ('$tarballs_base/panko/'
@ -798,6 +809,10 @@ USERS = {
'uid': 42461,
'gid': 42461,
},
'opendaylight-user': {
'uid': 42462,
'gid': 42462,
}
}

3
releasenotes/notes/add-opendaylight-fee2807442ce3c6d.yaml

@ -0,0 +1,3 @@
---
features:
- Add OpenDaylight docker template and supporting files.

4
tests/test_build.py

@ -102,6 +102,7 @@ class BuildTestCentosSource(BuildTest, base.BaseTestCase):
"bifrost-base",
"kafka",
"mistral-base",
"opendaylight"
]
def setUp(self):
@ -142,6 +143,7 @@ class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase):
class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
excluded_images = [
"bifrost-base",
"opendaylight"
]
def setUp(self):
@ -182,6 +184,7 @@ class BuildTestDebianBinary(BuildTest, base.BaseTestCase):
class BuildTestDebianSource(BuildTest, base.BaseTestCase):
excluded_images = [
"bifrost-base",
"opendaylight"
]
def setUp(self):
@ -220,6 +223,7 @@ class BuildTestOracleLinuxSource(BuildTest, base.BaseTestCase):
excluded_images = [
"bifrost-base",
"kafka",
"opendaylight"
]
def setUp(self):

Loading…
Cancel
Save