Merge "Fix zun images"

This commit is contained in:
Jenkins 2017-05-15 02:15:06 +00:00 committed by Gerrit Code Review
commit 5bdd158767
5 changed files with 50 additions and 10 deletions

View File

@ -15,5 +15,3 @@ RUN chmod 755 /usr/local/bin/kolla_zun_extend_start
{% block zun_api_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER zun

View File

@ -1,5 +1,15 @@
#!/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
# 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

View File

@ -5,6 +5,8 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
{% import "macros.j2" as macros with context %}
{{ macros.configure_user(name='zun') }}
{% if install_type == 'binary' %}
RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
@ -12,6 +14,33 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% elif install_type == 'source' %}
{% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
{% set zun_base_packages = [
'httpd',
'mod_wsgi',
'mod_ssl',
'python-ldappool'
] %}
{{ macros.install_packages(zun_base_packages | customizable("packages")) }}
RUN mkdir -p /var/www/cgi-bin/zun \
&& 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 zun_base_packages = [
'apache2',
'libapache2-mod-wsgi',
'python-ldappool'
] %}
{{ macros.install_packages(zun_base_packages | customizable("packages")) }}
RUN mkdir -p /var/www/cgi-bin/zun \
&& echo > /etc/apache2/ports.conf
{% endif %}
ADD zun-base-archive /zun-base-source
{% set zun_base_pip_packages = [
@ -19,18 +48,19 @@ ADD zun-base-archive /zun-base-source
] %}
RUN ln -s zun-base-source/* zun \
&& useradd --user-group --create-home --home-dir /var/lib/zun zun \
&& {{ macros.install_pip(zun_base_pip_packages | customizable("pip_packages")) }} \
&& mkdir -p /etc/zun \
&& cp -r /zun/etc/* /etc/zun/ \
&& chown -R zun: /etc/zun
&& mkdir -p /etc/zun /var/www/cgi-bin/zun \
&& cp -r /zun/etc/zun/* /etc/zun/ \
&& cp /zun/zun/api/app.wsgi /var/www/cgi-bin/zun \
&& cp -r /zun/etc/nova /etc/zun/ \
&& chown -R zun: /etc/zun /var/www/cgi-bin/zun
{% endif %}
COPY extend_start.sh /usr/local/bin/kolla_extend_start
RUN usermod -a -G kolla zun \
&& touch /usr/local/bin/kolla_zun_extend_start \
RUN touch /usr/local/bin/kolla_zun_extend_start \
&& chmod 755 /var/www/cgi-bin/zun \
&& chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_zun_extend_start
{% block zun_base_footer %}{% endblock %}

View File

@ -12,5 +12,3 @@ RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
{% block zun_compute_footer %}{% endblock %}
{% block footer %}{% endblock %}
USER zun

View File

@ -835,6 +835,10 @@ USERS = {
'opendaylight-user': {
'uid': 42462,
'gid': 42462,
},
'zun-user': {
'uid': 42463,
'gid': 42463,
}
}