aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Koderer <marc@koderer.com>2016-01-18 11:46:29 +0100
committerMarc Koderer <marc@koderer.com>2016-01-18 20:33:32 +0000
commitf7085c1f6f00aecb823d9e6c92925552a75942ce (patch)
tree84e328f6ccb6a6c2f214dfe4c212c724b59f651b
parent3f064206b8572ab18587c380e9bcd59d1e6384fe (diff)
downloadkolla-f7085c1f6f00aecb823d9e6c92925552a75942ce.tar.gz
kolla-f7085c1f6f00aecb823d9e6c92925552a75942ce.zip
Add manila container (source only)
Support manila as container. First step only supports building from source. Change-Id: I60bb67536c9afdb9f0532b3cdc2c400a68608003 Partially-Implements: blueprint enable-manila-containers
-rw-r--r--docker/manila/manila-api/Dockerfile.j29
-rw-r--r--docker/manila/manila-api/extend_start.sh9
-rw-r--r--docker/manila/manila-base/Dockerfile.j221
-rw-r--r--docker/manila/manila-scheduler/Dockerfile.j26
-rw-r--r--docker/manila/manila-share/Dockerfile.j26
-rw-r--r--kolla/common/config.py4
-rw-r--r--tests/test_build.py3
7 files changed, 57 insertions, 1 deletions
diff --git a/docker/manila/manila-api/Dockerfile.j2 b/docker/manila/manila-api/Dockerfile.j2
new file mode 100644
index 000000000..ac2fe479d
--- /dev/null
+++ b/docker/manila/manila-api/Dockerfile.j2
@@ -0,0 +1,9 @@
+FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+COPY extend_start.sh /usr/local/bin/kolla_extend_start
+RUN chmod 755 /usr/local/bin/kolla_extend_start
+
+{{ include_footer }}
+
+USER manila
diff --git a/docker/manila/manila-api/extend_start.sh b/docker/manila/manila-api/extend_start.sh
new file mode 100644
index 000000000..bea77dbba
--- /dev/null
+++ b/docker/manila/manila-api/extend_start.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -o errexit
+
+# 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
+ manila-manage db sync
+ exit 0
+fi
diff --git a/docker/manila/manila-base/Dockerfile.j2 b/docker/manila/manila-base/Dockerfile.j2
new file mode 100644
index 000000000..adbcc9711
--- /dev/null
+++ b/docker/manila/manila-base/Dockerfile.j2
@@ -0,0 +1,21 @@
+FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{% if install_type == 'binary' %}
+
+RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \
+ && /bin/false
+
+{% elif install_type == 'source' %}
+
+ADD manila-base-archive /manila-base-source
+RUN ln -s manila-base-source/* manila \
+ && useradd --user-group manila \
+ && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /manila \
+ && mkdir -p /etc/manila /var/log/manila /home/manila \
+ && cp -r /manila/etc/manila/* /etc/manila/ \
+ && chown -R manila: /etc/manila /var/log/manila /home/manila
+
+{% endif %}
+
+RUN usermod -a -G kolla manila
diff --git a/docker/manila/manila-scheduler/Dockerfile.j2 b/docker/manila/manila-scheduler/Dockerfile.j2
new file mode 100644
index 000000000..a3ca1820b
--- /dev/null
+++ b/docker/manila/manila-scheduler/Dockerfile.j2
@@ -0,0 +1,6 @@
+FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{{ include_footer }}
+
+USER manila
diff --git a/docker/manila/manila-share/Dockerfile.j2 b/docker/manila/manila-share/Dockerfile.j2
new file mode 100644
index 000000000..a3ca1820b
--- /dev/null
+++ b/docker/manila/manila-share/Dockerfile.j2
@@ -0,0 +1,6 @@
+FROM {{ namespace }}/{{ image_prefix }}manila-base:{{ tag }}
+MAINTAINER {{ maintainer }}
+
+{{ include_footer }}
+
+USER manila
diff --git a/kolla/common/config.py b/kolla/common/config.py
index 478d2a5d2..a6222bded 100644
--- a/kolla/common/config.py
+++ b/kolla/common/config.py
@@ -187,6 +187,10 @@ SOURCES = {
'type': 'url',
'location': ('http://tarballs.openstack.org/magnum/'
'magnum-master.tar.gz')},
+ 'manila-base': {
+ 'type': 'url',
+ 'location': ('http://tarballs.openstack.org/manila/'
+ 'manila-master.tar.gz')},
'mistral-base': {
'type': 'url',
'location': ('http://tarballs.openstack.org/mistral/'
diff --git a/tests/test_build.py b/tests/test_build.py
index bfc334f96..8fec97ebb 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -47,7 +47,8 @@ class BuildTest(base.BaseTestCase):
"murano-base",
"ironic-pxe",
"ironic-discoverd",
- "mistral-base"]
+ "mistral-base",
+ "manila-base"]
failures = 0
for image, result in six.iteritems(bad_results):