diff options
| author | Zuul <zuul@review.opendev.org> | 2019-09-27 19:01:27 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2019-09-27 19:01:27 +0000 |
| commit | 93f9962774f46b5170f127695208597245065dff (patch) | |
| tree | fc95315064ccd1b2cebd49bc3b5aa208bcfb5e6b /docker | |
| parent | a0712ceef3d6c20cdd79417dcff10525c527fb3d (diff) | |
| parent | 76fbf2c08b17f73dd304c1316fbabbbbe9d9468a (diff) | |
| download | kolla-93f9962774f46b5170f127695208597245065dff.tar.gz kolla-93f9962774f46b5170f127695208597245065dff.zip | |
Merge "Debian: switch fluentd to td-agent on x86_64"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/fluentd/Dockerfile.j2 | 15 | ||||
| -rw-r--r-- | docker/macros.j2 | 4 |
2 files changed, 10 insertions, 9 deletions
diff --git a/docker/fluentd/Dockerfile.j2 b/docker/fluentd/Dockerfile.j2 index 79397e071..83ceb2965 100644 --- a/docker/fluentd/Dockerfile.j2 +++ b/docker/fluentd/Dockerfile.j2 @@ -3,7 +3,7 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build {% if base_package_type == 'rpm' and base_arch != 'x86_64' %} LABEL fluentd_version="0.12" fluentd_binary="fluentd" {% set fluentd_user = 'fluentd' %} -{% elif base_distro == 'debian' or (base_distro == 'ubuntu' and base_arch != 'x86_64') %} +{% elif base_package_type == 'deb' and base_arch != 'x86_64' %} LABEL fluentd_version="0.14" fluentd_binary="fluentd" {% set fluentd_user = 'fluentd' %} {% else %} @@ -42,7 +42,8 @@ LABEL fluentd_version="0.14" fluentd_binary="td-agent" 'g++', 'make' ] %} - {% if base_arch == 'x86_64' and base_distro == 'ubuntu' %} + + {% if base_arch == 'x86_64' %} {% set fluentd_packages = fluentd_packages + [ 'td-agent' ] %} @@ -59,8 +60,8 @@ LABEL fluentd_version="0.14" fluentd_binary="td-agent" {{ macros.install_packages(fluentd_packages | customizable("packages")) }} # Distro specific files and operations -# Fluentd on CentOS non x86_64 is installed from rpm -{% if base_distro == 'debian' or (base_distro == 'ubuntu' and base_arch != 'x86_64') %} +# Fluentd on rpm-based non-x86_64 is installed from rpm +{% if base_package_type == 'deb' and base_arch != 'x86_64' %} RUN /usr/bin/gem install fluentd --no-rdoc --no-ri {% endif %} @@ -76,7 +77,7 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start {% block fluentd_plugins_install %} -{% if (base_package_type == 'rpm' and base_arch == 'x86_64') or base_package_type == 'deb' %} +{% if not (base_package_type == 'rpm' and base_arch != 'x86_64') %} {% set fluentd_plugins = [ 'fluent-plugin-elasticsearch', 'fluent-plugin-grep', @@ -86,7 +87,7 @@ RUN chmod 755 /usr/local/bin/kolla_extend_start ] %} {% endif %} -{{ macros.install_fluent_plugins(fluentd_plugins | customizable("plugins")) }} +{{ macros.install_fluent_plugins(fluentd_user, fluentd_plugins | customizable("plugins")) }} {% endblock %} @@ -103,7 +104,7 @@ RUN curl -sSL $monasca_output_plugin_url -o /tmp/fluentd-monasca.tar.gz \ {% else %} && td-agent-gem build fluentd-monasca-output.gemspec \ {% endif %} - && {{ macros.install_fluent_plugins(['fluentd-monasca-output-*.gem'], chain=True) }} \ + && {{ macros.install_fluent_plugins(fluentd_user, ['fluentd-monasca-output-*.gem'], chain=True) }} \ && rm -rf /tmp/fluentd* {% endblock %} diff --git a/docker/macros.j2 b/docker/macros.j2 index 0af3fe43c..0e4078ec9 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -105,10 +105,10 @@ RUN apt-get update \ && chmod 755 /usr/bin/kubectl {% endmacro %} -{% macro install_fluent_plugins(plugins, chain=False) -%} +{% macro install_fluent_plugins(binary, plugins, chain=False) -%} {% if plugins is defined and plugins|length > 0 -%} {% if not chain -%} RUN {% endif -%} - {%- if base_arch == 'x86_64' and base_distro in ['centos', 'rhel', 'ubuntu'] -%} + {%- if binary == 'td-agent' -%} ulimit -n 65536 && td-agent-gem install {{ plugins | join(' ') }} {%- else -%} ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }} |
