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 <gmuthukr@redhat.com>
This commit is contained in:
Gowrishankar Muthukrishnan 2019-10-17 12:58:56 +05:30
parent 112928f5f0
commit 1c6145f0da
4 changed files with 49 additions and 0 deletions

View File

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

View File

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

View File

@ -119,6 +119,7 @@ UNBUILDABLE_IMAGES = {
"monasca-base",
"monasca-thresh",
"nova-mksproxy",
"openvswitch-netcontrold",
"qinling-base",
"searchlight-base",
"solum-base",

View File

@ -0,0 +1,3 @@
---
features:
- Adds possibility to run netcontrold image for openvswitch service.