Browse Source

Merge "Add support to deploy manila-api with Apache/wsgi"

tags/8.0.0.0b1
Zuul 10 months ago
parent
commit
f1646ade63

+ 47
- 4
docker/manila/manila-api/Dockerfile.j2 View File

@@ -6,19 +6,62 @@ LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build
6 6
 {% import "macros.j2" as macros with context %}
7 7
 
8 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")) }}
16
+RUN 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 22
         {% set manila_api_packages = [
23
+                'apache2',
24
+                'libapache2-mod-wsgi',
12 25
                 'manila-api'
13 26
         ] %}
27
+{{ macros.install_packages(manila_api_packages | customizable("packages")) }}
28
+RUN 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")) }}
43
+RUN 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 51
 {{ macros.install_packages(manila_api_packages | customizable("packages")) }}
52
+RUN echo > /etc/apache2/ports.conf
53
+
54
+    {% endif %}
55
+
56
+RUN 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%}
18
-{% endif%}
59
+{% endif %}
19 60
 
20 61
 COPY extend_start.sh /usr/local/bin/kolla_manila_extend_start
21
-RUN chmod 755 /usr/local/bin/kolla_manila_extend_start
62
+RUN 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 66
 {% block manila_api_footer %}{% endblock %}
24 67
 {% block footer %}{% endblock %}

+ 13
- 0
docker/manila/manila-api/extend_start.sh View File

@@ -7,3 +7,16 @@ if [[ "${!KOLLA_BOOTSTRAP[@]}" ]]; then
7 7
     manila-manage db sync
8 8
     exit 0
9 9
 fi
10
+
11
+# Assume the service runs on top of Apache when user is root
12
+if [[ "$(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
22
+fi

+ 8
- 0
releasenotes/notes/add-manila-api-httpd-packages-and-conf-1bea1364037cd64e.yaml View File

@@ -0,0 +1,8 @@
1
+---
2
+features:
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.

Loading…
Cancel
Save