From 1c6145f0da28c370575882793f2809e72b338f5a Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Thu, 17 Oct 2019 12:58:56 +0530 Subject: Provision building netcontrold container Netcontrold container service[1] is used to load balance PMD threads in OpenVSwitch for the dataplane traffic. This patch enables building netcontrold container for Openstack. [1] https://github.com/netcontrold/netcontrold-py Change-Id: I09cb42323d36fcff49da81fc2356c9f83400d5d6 Signed-off-by: Gowrishankar Muthukrishnan --- .../openvswitch-netcontrold/Dockerfile.j2 | 38 ++++++++++++++++++++++ .../openvswitch-netcontrold/extend_start.sh | 7 ++++ 2 files changed, 45 insertions(+) create mode 100644 docker/openvswitch/openvswitch-netcontrold/Dockerfile.j2 create mode 100644 docker/openvswitch/openvswitch-netcontrold/extend_start.sh (limited to 'docker/openvswitch') diff --git a/docker/openvswitch/openvswitch-netcontrold/Dockerfile.j2 b/docker/openvswitch/openvswitch-netcontrold/Dockerfile.j2 new file mode 100644 index 000000000..197c46a9e --- /dev/null +++ b/docker/openvswitch/openvswitch-netcontrold/Dockerfile.j2 @@ -0,0 +1,38 @@ +FROM {{ namespace }}/{{ image_prefix }}openvswitch-base:{{ tag }} +LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}" + +{% block openvswitch_netcontrold_header %}{% endblock %} + +{% import "macros.j2" as macros with context %} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% elif install_type == 'source' %} + +{% block openvswitch_netcontrold_install %} + +{% set openvswitch_netcontrold_packages = [ + 'python3-pip', + ] %} + +{{ macros.install_packages(openvswitch_netcontrold_packages | customizable("packages")) }} + +{% set openvswitch_netcontrold_pip_packages = [ + 'netcontrold', + ] +%} + +RUN {{ macros.install_pip(openvswitch_netcontrold_pip_packages | customizable("pip_packages"), constraints = false, pip_version = "pip3") }} + +{% endblock %} + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_openvswitch_extend_start +RUN chmod 755 /usr/local/bin/kolla_openvswitch_extend_start + +{% block openvswitch_netcontrold_footer %}{% endblock %} +{% block footer %}{% endblock %} diff --git a/docker/openvswitch/openvswitch-netcontrold/extend_start.sh b/docker/openvswitch/openvswitch-netcontrold/extend_start.sh new file mode 100644 index 000000000..716cb126c --- /dev/null +++ b/docker/openvswitch/openvswitch-netcontrold/extend_start.sh @@ -0,0 +1,7 @@ +#!/bin/bash +if [[ ! -d "/var/log/kolla/openvswitch/netcontrold" ]]; then + mkdir -p /var/log/kolla/openvswitch/netcontrold +fi +if [[ $(stat -c %a /var/log/kolla/openvswitch/netcontrold) != "755" ]]; then + chmod 755 /var/log/kolla/openvswitch/netcontrold +fi -- cgit v1.2.3