Merge "Fix vitrage images"

This commit is contained in:
Zuul 2017-10-17 09:24:38 +00:00 committed by Gerrit Code Review
commit 255ce619c5
9 changed files with 151 additions and 8 deletions

View File

@ -3,14 +3,36 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block vitrage_api_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_api_packages = [
'httpd',
'mod_wsgi',
'mod_ssl',
'python-ldappool',
'openstack-vitrage-api'
] %}
{{ macros.install_packages(vitrage_api_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'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_vitrage_extend_start
RUN chmod 755 /usr/local/bin/kolla_vitrage_extend_start
{% block vitrage_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER vitrage

View File

@ -0,0 +1,11 @@
#!/bin/bash
# NOTE(pbourke): httpd will not clean up after itself in some cases which
# results in the container not being able to restart. (bug #1489676, 1557036)
if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
# Loading Apache2 ENV variables
. /etc/apache2/envvars
rm -rf /var/run/apache2/*
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
fi

View File

@ -9,11 +9,48 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_base_packages = [
'openstack-vitrage-common'
] %}
{{ macros.install_packages(vitrage_base_packages | customizable("packages")) }}
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_base_packages = [
'httpd',
'mod_wsgi',
'mod_ssl',
'python-ldappool'
] %}
{{ macros.install_packages(vitrage_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 vitrage_base_packages = [
'apache2',
'libapache2-mod-wsgi',
'python-ldappool'
] %}
{{ macros.install_packages(vitrage_base_packages | customizable("packages")) }}
RUN echo > /etc/apache2/ports.conf
{% endif %}
{% set vitrage_base_pip_packages = [
'/vitrage'
] %}
@ -21,14 +58,15 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
ADD vitrage-base-archive /vitrage-base-source
RUN ln -s vitrage-base-source/* vitrage \
&& {{ macros.install_pip(vitrage_base_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/vitrage \
&& mkdir -p /etc/vitrage /var/www/cgi-bin/vitrage \
&& cp -r /vitrage/etc/vitrage/* /etc/vitrage/ \
&& chown -R vitrage: /etc/vitrage
&& cp /vitrage/vitrage/api/app.wsgi /var/www/cgi-bin/vitrage \
&& chown -R vitrage: /etc/vitrage /var/www/cgi-bin/vitrage
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN chmod 755 /usr/local/bin/kolla_extend_start
RUN touch /usr/local/bin/kolla_vitrage_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_vitrage_extend_start
{% block vitrage_base_footer %}{% endblock %}

View File

@ -10,3 +10,5 @@ fi
if [[ $(stat -c %a ${VITRAGE_LOG_DIR}) != "755" ]]; then
chmod 755 ${VITRAGE_LOG_DIR}
fi
. /usr/local/bin/kolla_vitrage_extend_start

View File

@ -0,0 +1,30 @@
FROM {{ namespace }}/{{ image_prefix }}vitrage-base:{{ tag }}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% block vitrage_collector_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_collector_packages = [
'openstack-vitrage-collector'
] %}
{{ macros.install_packages(vitrage_collector_packages | customizable("packages")) }}
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% endif %}
{% block vitrage_collector_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER vitrage

View File

@ -3,11 +3,25 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block vitrage_graph_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_graph_packages = [
'openstack-vitrage-graph'
] %}
{{ macros.install_packages(vitrage_graph_packages | customizable("packages")) }}
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% endif %}
{% block vitrage_graph_footer %}{% endblock %}

View File

@ -3,11 +3,25 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block vitrage_ml_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_ml_packages = [
'openstack-vitrage-ml'
] %}
{{ macros.install_packages(vitrage_ml_packages | customizable("packages")) }}
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% endif %}
{% block vitrage_ml_footer %}{% endblock %}

View File

@ -3,11 +3,25 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% block vitrage_notifier_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set vitrage_notifier_packages = [
'openstack-vitrage-notifier'
] %}
{{ macros.install_packages(vitrage_notifier_packages | customizable("packages")) }}
{% elif base_distro in ['debian', 'ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{% endif %}
{% block vitrage_notifier_footer %}{% endblock %}

View File

@ -109,7 +109,6 @@ SKIPPED_IMAGES = {
"searchlight-base",
"senlin-base",
"solum-base",
"vitrage-base",
"vmtp",
"zun-base",
],
@ -189,7 +188,6 @@ SKIPPED_IMAGES = {
"searchlight-base",
"senlin-base",
"solum-base",
"vitrage-base",
"vmtp",
"zun-base"
],