diff options
| author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2019-02-21 16:46:21 +0000 |
|---|---|---|
| committer | Pedro Alvarez Piedehierro <pedro.alvarez@codethink.co.uk> | 2019-03-28 16:26:22 +0000 |
| commit | 35394e25a33c6bbfdc2e1853adfa8f2a1a5614c1 (patch) | |
| tree | bf45e7133842a6848199ebc3b3b35b2e7fbc7b92 | |
| parent | 83e8be4f0597c4572f58a1052010d3660064cdb9 (diff) | |
| download | kolla-35394e25a33c6bbfdc2e1853adfa8f2a1a5614c1.tar.gz kolla-35394e25a33c6bbfdc2e1853adfa8f2a1a5614c1.zip | |
Install fluentd gem on debian/ubuntu for non x86_64
The package used to install fluentd on debian/ubuntu is not
available for architectures other than x86_64. For those cases
install fluentd as a gem until the package 'td-agent' is available
for more architectures.
Change-Id: Ic1b25b37d06b429a112f1418a79d385d505bb1e9
| -rw-r--r-- | docker/base/Dockerfile.j2 | 4 | ||||
| -rw-r--r-- | docker/fluentd/Dockerfile.j2 | 26 | ||||
| -rw-r--r-- | docker/fluentd/extend_start.sh | 2 | ||||
| -rw-r--r-- | docker/macros.j2 | 6 |
4 files changed, 31 insertions, 7 deletions
diff --git a/docker/base/Dockerfile.j2 b/docker/base/Dockerfile.j2 index 18212f0bb..6b23a73b6 100644 --- a/docker/base/Dockerfile.j2 +++ b/docker/base/Dockerfile.j2 @@ -18,7 +18,9 @@ LABEL kolla_version="{{ kolla_version }}" ENV KOLLA_BASE_DISTRO={{ base_distro }} \ KOLLA_INSTALL_TYPE={{ install_type }} \ KOLLA_INSTALL_METATYPE={{ install_metatype }} \ - KOLLA_DISTRO_PYTHON_VERSION={{ distro_python_version }} + KOLLA_DISTRO_PYTHON_VERSION={{ distro_python_version }} \ + KOLLA_BASE_ARCH={{ base_arch }} + #### Customize PS1 to be used with bash shell COPY kolla_bashrc /tmp/ diff --git a/docker/fluentd/Dockerfile.j2 b/docker/fluentd/Dockerfile.j2 index 27dee33af..ca1390e27 100644 --- a/docker/fluentd/Dockerfile.j2 +++ b/docker/fluentd/Dockerfile.j2 @@ -27,19 +27,29 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build ] %} {% elif base_package_type == 'deb' %} - {{ macros.configure_user(name='td-agent', groups='mysql') }} {% set fluentd_packages = [ 'g++', 'make', 'ruby', 'ruby-dev', - 'td-agent' ] %} + {% if base_arch == 'x86_64' %} + {{ macros.configure_user(name='td-agent', groups='mysql') }} + {% set fluentd_packages = fluentd_packages + [ + 'td-agent' + ] %} + {% else %} + {{ macros.configure_user(name='fluentd', groups='mysql') }} + {% endif %} {% endif %} {{ macros.install_packages(fluentd_packages | customizable("packages")) }} +{% if base_package_type == 'deb' and base_arch != 'x86_64' %} +RUN /usr/bin/gem install fluentd --no-rdoc --no-ri +{% endif %} + # Distro specific files and operations {% if base_package_type == 'rpm' %} COPY rpm_fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers @@ -47,11 +57,19 @@ RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \ && mkdir -p /var/run/fluentd \ && chown -R fluentd: /etc/fluentd /var/run/fluentd {% elif base_package_type == 'deb' %} + {% if base_arch == 'x86_64' %} COPY fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \ && sed -i -e "s/USER=td-agent/USER=root/" -e "s/GROUP=td-agent/GROUP=root/" /etc/init.d/td-agent \ && rm -f /etc/td-agent/td-agent.conf \ && chown -R td-agent: /etc/td-agent + {% else %} +COPY rpm_fluentd_sudoers /etc/sudoers.d/kolla_fluentd_sudoers +RUN chmod 440 /etc/sudoers.d/kolla_fluentd_sudoers \ + && mkdir -p /etc/fluentd \ + && mkdir -p /var/run/fluentd \ + && chown -R fluentd: /etc/fluentd /var/run/fluentd + {% endif %} {% endif %} @@ -90,8 +108,8 @@ RUN tar -xvf /tmp/fluentd-monasca.tar.gz -C /tmp \ {% block fluentd_footer %}{% endblock %} {% block footer %}{% endblock %} -{% if base_package_type == 'rpm' %} +{% if base_package_type == 'rpm' or (base_package_type == 'deb' and base_arch != 'x86_64') %} USER fluentd -{% elif base_package_type == 'deb' %} +{% elif base_package_type == 'deb' and base_arch == 'x86_64' %} USER td-agent {% endif %} diff --git a/docker/fluentd/extend_start.sh b/docker/fluentd/extend_start.sh index b2ace498e..93996766b 100644 --- a/docker/fluentd/extend_start.sh +++ b/docker/fluentd/extend_start.sh @@ -6,7 +6,7 @@ # Also set the setgid permission on the /var/log/kolla directory so that new # files and sub-directories in that directory inherit its group id ("kolla"). -if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then +if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu && "${KOLLA_BASE_ARCH}" == "x86_64" ]]; then USERGROUP="td-agent:kolla" FLUENTD="td-agent" else diff --git a/docker/macros.j2 b/docker/macros.j2 index 533a14aa5..6a0fdb568 100644 --- a/docker/macros.j2 +++ b/docker/macros.j2 @@ -110,7 +110,11 @@ RUN apt-get update \ {% if base_distro in ['centos', 'oraclelinux', 'rhel'] -%} RUN ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }} {%- elif base_distro in ['debian', 'ubuntu'] -%} - RUN ulimit -n 65536 && td-agent-gem install {{ plugins | join(' ') }} + {% if base_arch == 'x86_64' %} + RUN ulimit -n 65536 && td-agent-gem install {{ plugins | join(' ') }} + {% else %} + RUN ulimit -n 65536 && gem install --minimal-deps {{ plugins | join(' ') }} + {% endif %} {%- endif %} {%- endif %} {%- endmacro %} |
