summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZuul <zuul@review.openstack.org>2018-09-06 22:15:28 +0000
committerGerrit Code Review <review@openstack.org>2018-09-06 22:15:28 +0000
commitf1646ade63e9e8e115aa202562286f989d800e40 (patch)
tree5a9a09a9c08a99917790b0303783f7b14e0a5edc
parent488212de27aea0b6d080bd4f3fc3d1bfe491c3fd (diff)
parent170be6d17a2e4b85e376a88131ca488c619bebaf (diff)
Merge "Add support to deploy manila-api with Apache/wsgi"
-rw-r--r--docker/manila/manila-api/Dockerfile.j251
-rw-r--r--docker/manila/manila-api/extend_start.sh13
-rw-r--r--releasenotes/notes/add-manila-api-httpd-packages-and-conf-1bea1364037cd64e.yaml8
3 files changed, 68 insertions, 4 deletions
diff --git a/docker/manila/manila-api/Dockerfile.j2 b/docker/manila/manila-api/Dockerfile.j2
index a7be744..9ff1102 100644
--- a/docker/manila/manila-api/Dockerfile.j2
+++ b/docker/manila/manila-api/Dockerfile.j2
@@ -6,19 +6,62 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
6{% import "macros.j2" as macros with context %} 6{% import "macros.j2" as macros with context %}
7 7
8{% if install_type == 'binary' %} 8{% if install_type == 'binary' %}
9 {% if base_distro in ['debian', 'ubuntu'] %} 9 {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
10 {% set manila_api_packages = [
11 'httpd',
12 'mod_ssl',
13 'mod_wsgi'
14 ] %}
15{{ macros.install_packages(manila_api_packages | customizable("packages")) }}
16RUN mkdir -p /var/www/cgi-bin/manila \
17 && cp -a /usr/bin/manila-wsgi /var/www/cgi-bin/manila/manila-wsgi \
18 && sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
19 && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
10 20
21 {% elif base_distro in ['debian', 'ubuntu'] %}
11 {% set manila_api_packages = [ 22 {% set manila_api_packages = [
23 'apache2',
24 'libapache2-mod-wsgi',
12 'manila-api' 25 'manila-api'
13 ] %} 26 ] %}
27{{ macros.install_packages(manila_api_packages | customizable("packages")) }}
28RUN mkdir -p /var/www/cgi-bin/manila \
29 && cp -a /usr/bin/manila-wsgi /var/www/cgi-bin/manila/manila-wsgi \
30 && echo > /etc/apache2/ports.conf
31 {% endif %}
32
33
34{% elif install_type == 'source' %}
35
36 {% if base_distro in ['centos', 'oraclelinux', 'rhel'] %}
37 {% set manila_api_packages = [
38 'httpd',
39 'mod_ssl',
40 'mod_wsgi'
41 ] %}
42{{ macros.install_packages(manila_api_packages | customizable("packages")) }}
43RUN sed -i -r 's,^(Listen 80),#\1,' /etc/httpd/conf/httpd.conf \
44 && sed -i -r 's,^(Listen 443),#\1,' /etc/httpd/conf.d/ssl.conf
14 45
46 {% elif base_distro in ['debian', 'ubuntu'] %}
47 {% set manila_api_packages = [
48 'apache2',
49 'libapache2-mod-wsgi'
50 ] %}
15{{ macros.install_packages(manila_api_packages | customizable("packages")) }} 51{{ macros.install_packages(manila_api_packages | customizable("packages")) }}
52RUN echo > /etc/apache2/ports.conf
53
54 {% endif %}
55
56RUN mkdir -p /var/www/cgi-bin/manila \
57 && cp -a /var/lib/kolla/venv/bin/manila-wsgi /var/www/cgi-bin/manila/manila-wsgi
16 58
17 {% endif%} 59{% endif %}
18{% endif%}
19 60
20COPY extend_start.sh /usr/local/bin/kolla_manila_extend_start 61COPY extend_start.sh /usr/local/bin/kolla_manila_extend_start
21RUN chmod 755 /usr/local/bin/kolla_manila_extend_start 62RUN chmod 755 /usr/local/bin/kolla_manila_extend_start \
63 && chown -R manila: /var/www/cgi-bin/manila \
64 && chmod 755 /var/www/cgi-bin/manila/manila-wsgi
22 65
23{% block manila_api_footer %}{% endblock %} 66{% block manila_api_footer %}{% endblock %}
24{% block footer %}{% endblock %} 67{% block footer %}{% endblock %}
diff --git a/docker/manila/manila-api/extend_start.sh b/docker/manila/manila-api/extend_start.sh
index bea77db..3e5347a 100644
--- a/docker/manila/manila-api/extend_start.sh
+++ b/docker/manila/manila-api/extend_start.sh
@@ -7,3 +7,16 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
7 manila-manage db sync 7 manila-manage db sync
8 exit 0 8 exit 0
9fi 9fi
10
11# Assume the service runs on top of Apache when user is root
12if [[ "$(whoami)" == 'root' ]]; then
13 # NOTE(pbourke): httpd will not clean up after itself in some cases which
14 # results in the container not being able to restart. (bug #1489676, 1557036)
15 if [[ "${KOLLA_BASE_DISTRO}" =~ debian|ubuntu ]]; then
16 # Loading Apache2 ENV variables
17 . /etc/apache2/envvars
18 rm -rf /var/run/apache2/*
19 else
20 rm -rf /var/run/httpd/* /run/httpd/* /tmp/httpd*
21 fi
22fi
diff --git a/releasenotes/notes/add-manila-api-httpd-packages-and-conf-1bea1364037cd64e.yaml b/releasenotes/notes/add-manila-api-httpd-packages-and-conf-1bea1364037cd64e.yaml
new file mode 100644
index 0000000..fbaafc5
--- /dev/null
+++ b/releasenotes/notes/add-manila-api-httpd-packages-and-conf-1bea1364037cd64e.yaml
@@ -0,0 +1,8 @@
1---
2features:
3 - |
4 The manila-api dockerfile now contains support for httpd and mod_wsgi
5 packages for all supported platforms. It also contains the mod_ssl
6 package for RHEL/centos and oraclelinux. Docker entrypoints can now use
7 the httpd configuration seeded to run the manila-api service with
8 httpd/mod_wsgi.