Add OpenDaylight Container to kolla
Implements docker container template for OpenDaylight. Change-Id: Icdcff77f0f6088f5a4db1bf77e37334dbd42074f Partially-Implements: blueprint opendaylight-support
This commit is contained in:
parent
1cad4813b6
commit
278bcdb154
22
contrib/template-override/opendaylight-template-overrides.j2
Normal file
22
contrib/template-override/opendaylight-template-overrides.j2
Normal file
@ -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 %}
|
@ -55,3 +55,12 @@ Developer Docs
|
|||||||
CONTRIBUTING
|
CONTRIBUTING
|
||||||
running-tests
|
running-tests
|
||||||
bug-triage
|
bug-triage
|
||||||
|
|
||||||
|
Template Override Docs
|
||||||
|
======================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
template-override/*
|
||||||
|
38
doc/template-override/opendaylight-source.rst
Normal file
38
doc/template-override/opendaylight-source.rst
Normal file
@ -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
Normal file
44
docker/opendaylight/Dockerfile.j2
Normal file
@ -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
Normal file
10
docker/opendaylight/extend_start.sh
Normal file
@ -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
Normal file
5
docker/opendaylight/opendaylight.repo
Normal file
@ -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
|
@ -49,6 +49,7 @@ _PROFILE_OPTS = [
|
|||||||
'mariadb',
|
'mariadb',
|
||||||
'memcached',
|
'memcached',
|
||||||
'mongodb',
|
'mongodb',
|
||||||
|
'opendaylight',
|
||||||
'openvswitch',
|
'openvswitch',
|
||||||
'rabbitmq',
|
'rabbitmq',
|
||||||
'redis',
|
'redis',
|
||||||
@ -460,6 +461,10 @@ SOURCES = {
|
|||||||
'type': 'url',
|
'type': 'url',
|
||||||
'location': ('$tarballs_base/neutron-lbaas/'
|
'location': ('$tarballs_base/neutron-lbaas/'
|
||||||
'neutron-lbaas-master.tar.gz')},
|
'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': {
|
'neutron-server-plugin-neutron-dynamic-routing': {
|
||||||
'type': 'url',
|
'type': 'url',
|
||||||
'location': ('$tarballs_base/neutron-dynamic-routing/'
|
'location': ('$tarballs_base/neutron-dynamic-routing/'
|
||||||
@ -496,6 +501,12 @@ SOURCES = {
|
|||||||
'type': 'url',
|
'type': 'url',
|
||||||
'location': ('$tarballs_base/octavia/'
|
'location': ('$tarballs_base/octavia/'
|
||||||
'octavia-master.tar.gz')},
|
'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': {
|
'panko-base': {
|
||||||
'type': 'url',
|
'type': 'url',
|
||||||
'location': ('$tarballs_base/panko/'
|
'location': ('$tarballs_base/panko/'
|
||||||
@ -798,6 +809,10 @@ USERS = {
|
|||||||
'uid': 42461,
|
'uid': 42461,
|
||||||
'gid': 42461,
|
'gid': 42461,
|
||||||
},
|
},
|
||||||
|
'opendaylight-user': {
|
||||||
|
'uid': 42462,
|
||||||
|
'gid': 42462,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Add OpenDaylight docker template and supporting files.
|
@ -102,6 +102,7 @@ class BuildTestCentosSource(BuildTest, base.BaseTestCase):
|
|||||||
"bifrost-base",
|
"bifrost-base",
|
||||||
"kafka",
|
"kafka",
|
||||||
"mistral-base",
|
"mistral-base",
|
||||||
|
"opendaylight"
|
||||||
]
|
]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -142,6 +143,7 @@ class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase):
|
|||||||
class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
|
class BuildTestUbuntuSource(BuildTest, base.BaseTestCase):
|
||||||
excluded_images = [
|
excluded_images = [
|
||||||
"bifrost-base",
|
"bifrost-base",
|
||||||
|
"opendaylight"
|
||||||
]
|
]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -182,6 +184,7 @@ class BuildTestDebianBinary(BuildTest, base.BaseTestCase):
|
|||||||
class BuildTestDebianSource(BuildTest, base.BaseTestCase):
|
class BuildTestDebianSource(BuildTest, base.BaseTestCase):
|
||||||
excluded_images = [
|
excluded_images = [
|
||||||
"bifrost-base",
|
"bifrost-base",
|
||||||
|
"opendaylight"
|
||||||
]
|
]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
@ -220,6 +223,7 @@ class BuildTestOracleLinuxSource(BuildTest, base.BaseTestCase):
|
|||||||
excluded_images = [
|
excluded_images = [
|
||||||
"bifrost-base",
|
"bifrost-base",
|
||||||
"kafka",
|
"kafka",
|
||||||
|
"opendaylight"
|
||||||
]
|
]
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user