kolla/docker/gnocchi/gnocchi-base/Dockerfile.j2
Farid Da Encarnacao 24f1714a16 Fix Gnocchi support ceph
Based on gnocchi issue #412 [0], cradox is more stable and recommended
to use.

* Add cradox for source and  RHEL family distro binary.
* Ubuntu binary lacks of cradox package, so install from pypi

[0] https://github.com/gnocchixyz/gnocchi/issues/412

Co-Authored-By: Jeffrey Zhang <zhang.lei.fly@gmail.com>
Change-Id: Icf7d6425884fb889d48c786caebbfc7b7050ae8e
Closes-Bug: #1718701
2017-11-28 09:54:15 +08:00

118 lines
3.7 KiB
Django/Jinja

FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block gnocchi_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='gnocchi') }}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set gnocchi_base_packages = [
'httpd',
'mod_ssl',
'mod_wsgi',
'openstack-gnocchi-common',
'python-ldappool',
'python2-cradox'
] %}
{{ macros.install_packages(gnocchi_base_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set gnocchi_base_packages = [
'apache2',
'build-essential',
'gnocchi-common',
'libapache2-mod-wsgi',
'librados-dev',
'python-dev',
'python-ldappool',
'python-rados',
'python-setuptools'
] %}
{% set gnocchi_base_pip_packages = [
'cradox'
] %}
{{ macros.install_packages(gnocchi_base_packages | customizable("packages")) }}
RUN {{ macros.install_pip(gnocchi_base_pip_packages | customizable("pip_packages"), constraints=false) }} \
&& truncate -s 0 /etc/apache2/ports.conf
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set gnocchi_base_packages = [
'httpd',
'librados2-devel',
'mod_ssl',
'mod_wsgi',
'python-ldappool'
] %}
# on x86-64 pip grabs precompiled numpy/scipy - on aarch64/ppc64le
# it needs to be built
{% if base_arch != 'x86_64' %}
{% set gnocchi_base_packages = gnocchi_base_packages + [
'blas-devel',
'lapack-devel'
] %}
{% endif %}
{{ macros.install_packages(gnocchi_base_packages | customizable("packages")) }}
RUN mkdir -p /var/www/cgi-bin/gnocchi \
&& sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
&& sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
{% elif base_distro in ['debian', 'ubuntu'] %}
{% set gnocchi_base_packages = [
'apache2',
'libapache2-mod-wsgi',
'librados-dev',
'python-ldappool'
] %}
# on x86-64 pip grabs precompiled numpy/scipy - on aarch64/ppc64le
# it needs to be built
{% if base_arch != 'x86_64' %}
{% set gnocchi_base_packages = gnocchi_base_packages + [
'libblas-dev',
'liblapack-dev'
] %}
{% endif %}
{{ macros.install_packages(gnocchi_base_packages | customizable("packages")) }}
RUN truncate -s 0 /etc/apache2/ports.conf
{% endif %}
ADD gnocchi-base-archive /gnocchi-base-source
{% set gnocchi_base_pip_packages = [
'gnocchiclient',
'/gnocchi[keystone,mysql,file,ceph]'
] %}
RUN ln -s gnocchi-base-source/* gnocchi \
&& {{ macros.install_pip(gnocchi_base_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/gnocchi \
&& chown -R gnocchi: /etc/gnocchi
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
COPY gnocchi_sudoers /etc/sudoers.d/kolla_gnocchi_sudoers
RUN chmod 750 /etc/sudoers.d \
&& chmod 640 /etc/sudoers.d/kolla_gnocchi_sudoers \
&& touch /usr/local/bin/kolla_gnocchi_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_gnocchi_extend_start
{% block gnocchi_base_footer %}{% endblock %}