add panko dockerfile

Change-Id: Ibf74db39348dfb6f56f4fca0aff142a75ef53d38
Partially-Implements: blueprint add-panko
This commit is contained in:
zhubingbing 2016-10-17 15:54:00 +08:00
parent 2e01ce50f5
commit fabb22d505
7 changed files with 134 additions and 4 deletions

View File

@ -0,0 +1,25 @@
FROM {{ namespace }}/{{ image_prefix }}panko-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block panko_api_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set panko_api_packages = ['openstack-panko-api'] %}
{% elif base_distro in ['ubuntu'] %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
&& /bin/false
{% endif %}
{{ macros.install_packages(panko_api_packages | customizable("packages")) }}
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_panko_extend_start
RUN chmod 755 /usr/local/bin/kolla_panko_extend_start
{% block panko_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
{{ include_footer }}

View File

@ -0,0 +1,18 @@
#!/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
source /etc/apache2/envvars
rm -rf /var/run/apache2/*
else
rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
fi
# Bootstrap and exit if KOLLA_BOOTSTRAP variable is set. This catches all cases
# of the KOLLA_BOOTSTRAP variable being set, including empty.
if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
panko-dbsync
exit 0
fi

View File

@ -0,0 +1,69 @@
FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
MAINTAINER {{ maintainer }}
{% block panko_base_header %}{% endblock %}
{% import "macros.j2" as macros with context %}
{% if install_type == 'binary' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set panko_base_packages = [
'openstack-panko-common',
'httpd',
'mod_wsgi',
'python-ldappool'
] %}
{{ macros.install_packages(panko_base_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
{% elif base_distro in ['ubuntu', 'debian'] %}
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 panko_base_packages = [
'httpd',
'mod_wsgi',
'python-ldappool'
] %}
{{ macros.install_packages(panko_base_packages | customizable("packages")) }}
RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf
{% elif base_distro in ['ubuntu', 'debian'] %}
{% set panko_base_packages = [
'apache2',
'libapache2-mod-wsgi',
'python-ldappool'
] %}
{{ macros.install_packages(panko_base_packages | customizable("packages")) }}
RUN truncate -s 0 /etc/apache2/ports.conf
{% endif %}
ADD panko-base-archive /panko-base-source
RUN ln -s panko-base-source/* panko \
&& useradd --user-group panko \
&& /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt \
&& mkdir -p /etc/panko /home/panko \
&& cp -r /panko/etc/panko/* /etc/panko/ \
&& chown -R panko: /etc/panko /home/panko
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN usermod -a -G kolla panko \
&& mkdir -p /var/lib/panko \
&& chown -R panko: /var/lib/panko \
&& touch /usr/local/bin/kolla_panko_extend_start \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_panko_extend_start
{% block panko_base_footer %}{% endblock %}

View File

@ -0,0 +1,10 @@
#!/bin/bash
if [[ ! -d "/var/log/kolla/panko" ]]; then
mkdir -p /var/log/kolla/panko
fi
if [[ $(stat -c %a /var/log/kolla/panko) != "755" ]]; then
chmod 755 /var/log/kolla/panko
fi
. /usr/local/bin/kolla_panko_extend_start

View File

@ -47,9 +47,9 @@ _PROFILE_OPTS = [
cfg.ListOpt('aux',
default=['aodh', 'cloudkitty', 'congress', 'designate',
'gnocchi', 'influxdb', 'ironic', 'kuryr', 'magnum',
'manila', 'mistral', 'murano', 'rally', 'sahara',
'searchlight', 'senlin', 'solum', 'telegraf', 'trove',
'zaqar'],
'manila', 'mistral', 'murano', 'panko', 'rally',
'sahara', 'searchlight', 'senlin', 'solum',
'telegraf', 'trove', 'zaqar'],
help='Aux Images'),
cfg.ListOpt('default',
default=['chrony', 'cron', 'kolla-toolbox', 'glance',
@ -282,6 +282,10 @@ SOURCES = {
'type': 'url',
'location': ('http://github.com/kanaka/noVNC/tarball/'
'v0.5.1')},
'panko-base': {
'type': 'url',
'location': ('http://tarballs.openstack.org/panko/'
'panko-master.tar.gz')},
'rally': {
'type': 'url',
'location': ('http://tarballs.openstack.org/rally/'

View File

@ -0,0 +1,3 @@
---
features:
- Add Panko dockerfile, Panko is a component of the Telemetry project

View File

@ -105,7 +105,8 @@ class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase):
"congress-base",
"bifrost-base",
"cloudkitty-base",
"freezer-base"]
"freezer-base",
"panko-base"]
def setUp(self):
super(BuildTestUbuntuBinary, self).setUp()