Merge "Add OpenDaylight Container to kolla"

This commit is contained in:
Jenkins 2017-04-19 17:50:19 +00:00 committed by Gerrit Code Review
commit bf84c20e8f
11 changed files with 150 additions and 0 deletions

View 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 %}

View File

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

View 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

View 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 %}

View 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

View 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

View File

@ -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,
}
}

View File

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

View File

@ -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):