From fb003d66ceb46f35675f7e209b18272717841e4c Mon Sep 17 00:00:00 2001 From: Eduardo Gonzalez Date: Tue, 2 May 2017 13:41:46 +0200 Subject: [PATCH] Add sfc plugin into neutron-base image Neutron-server and openvswitch-agent images consume sfc plugin code to run sfc services. This change adds db sync for sfc plugin. Also move sfc code into neutron-base so other services can make use of the plugin. Change-Id: I60ba1333231a4ae38a041d41e551f7d74fe15e3b Closes-Bug: #1664493 --- docker/neutron/neutron-base/Dockerfile.j2 | 3 +++ docker/neutron/neutron-server/extend_start.sh | 8 +++++++ .../neutron/neutron-sfc-agent/Dockerfile.j2 | 21 ------------------- kolla/common/config.py | 8 +++---- 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/docker/neutron/neutron-base/Dockerfile.j2 b/docker/neutron/neutron-base/Dockerfile.j2 index 01ca2f4ddb..9847177598 100644 --- a/docker/neutron/neutron-base/Dockerfile.j2 +++ b/docker/neutron/neutron-base/Dockerfile.j2 @@ -20,6 +20,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build 'openstack-neutron-lbaas', 'openstack-neutron-ml2', 'openvswitch', + 'python-networking-sfc', 'python-openvswitch', 'python2-oslo-vmware' ] %} @@ -33,6 +34,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build 'neutron-plugin-ml2', 'neutron-server', 'openvswitch-switch', + 'python-networking-sfc', 'python-openvswitch', 'python-oslo.vmware' ] %} @@ -47,6 +49,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build 'neutron-plugin-ml2', 'neutron-server', 'openvswitch-switch', + 'python-networking-sfc', 'python-openvswitch', 'python-oslo.vmware' ] %} diff --git a/docker/neutron/neutron-server/extend_start.sh b/docker/neutron/neutron-server/extend_start.sh index 1d3a314796..a027bb7868 100644 --- a/docker/neutron/neutron-server/extend_start.sh +++ b/docker/neutron/neutron-server/extend_start.sh @@ -7,6 +7,14 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then exit 0 fi +# Bootstrap and exit if KOLLA_BOOTSTRAP and NEUTRON_SFC_ENABLED variables are set. +# This catches all cases of the KOLLA_BOOTSTRAP and NEUTRON_SFC_ENABLED variable +# being set, including empty. +if [[ "${!NEUTRON_SFC_BOOTSTRAP[@]}" ]]; then + neutron-db-manage --subproject networking-sfc --config-file /etc/neutron/neutron.conf upgrade head + exit 0 +fi + # Migrate database and exit if KOLLA_UPGRADE variable is set. This catches all cases # of the KOLLA_UPGRADE variable being set, including empty. if [[ "${!KOLLA_UPGRADE[@]}" ]]; then diff --git a/docker/neutron/neutron-sfc-agent/Dockerfile.j2 b/docker/neutron/neutron-sfc-agent/Dockerfile.j2 index 9fb4e7c0fe..02b5e89ad6 100644 --- a/docker/neutron/neutron-sfc-agent/Dockerfile.j2 +++ b/docker/neutron/neutron-sfc-agent/Dockerfile.j2 @@ -5,27 +5,6 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% import "macros.j2" as macros with context %} -{% if install_type == 'binary' %} - {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %} - {% set networking_sfc_agent = ['python-networking-sfc'] %} - {% elif base_distro in ['debian', 'ubuntu'] %} - {% set networking_sfc_agent = ['python-networking-sfc'] %} - {% endif %} - {{ macros.install_packages(networking_sfc_agent | customizable("packages")) }} - -{% elif install_type == 'source' %} - -ADD neutron-sfc-agent-archive /neutron-sfc-agent-source - -{% set neutron_sfc_agent_pip_packages = [ - '/neutron-sfc-agent' -] %} - -RUN ln -s neutron-sfc-agent-source/* neutron-sfc-agent \ - && {{ macros.install_pip(neutron_sfc_agent_pip_packages | customizable("pip_packages")) }} - -{% endif %} - COPY extend_start.sh /usr/local/bin/kolla_neutron_extend_start RUN chmod 755 /usr/local/bin/kolla_neutron_extend_start diff --git a/kolla/common/config.py b/kolla/common/config.py index 2db6f5e7d0..ae6ee4ffea 100755 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -488,6 +488,10 @@ SOURCES = { 'type': 'url', 'location': ('$tarballs_base/networking-generic-switch/' 'networking-generic-switch-master.tar.gz')}, + 'neutron-base-plugin-networking-sfc': { + 'type': 'url', + 'location': ('$tarballs_base/networking-sfc/' + 'networking-sfc-master.tar.gz')}, 'neutron-base-plugin-vmware-nsx': { 'type': 'url', 'location': ('$tarballs_base/vmware-nsx/' @@ -532,10 +536,6 @@ SOURCES = { 'type': 'url', 'location': ('$tarballs_base/neutron-vpnaas/' 'neutron-vpnaas-master.tar.gz')}, - 'neutron-sfc-agent': { - 'type': 'url', - 'location': ('$tarballs_base/networking-sfc/' - 'networking-sfc-master.tar.gz')}, 'neutron-vpnaas-agent': { 'type': 'url', 'location': ('$tarballs_base/neutron-vpnaas/'