diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-12-30 05:49:42 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-12-30 05:49:42 +0000 |
| commit | b18653d98f19a4df8448934a729757389a341e79 (patch) | |
| tree | a785c4a1e2f46610ccaa48c7fb5a95b0f25db6d1 | |
| parent | e18678c65c2694665562d691403831c0bb7b3101 (diff) | |
| parent | 4c2156a45c2d0f3b859626359e1fded6f4423aa2 (diff) | |
| download | kolla-b18653d98f19a4df8448934a729757389a341e79.tar.gz kolla-b18653d98f19a4df8448934a729757389a341e79.zip | |
Merge "Add zun container"
| -rw-r--r-- | docker/zun/zun-api/Dockerfile.j2 | 19 | ||||
| -rw-r--r-- | docker/zun/zun-api/extend_start.sh | 8 | ||||
| -rw-r--r-- | docker/zun/zun-base/Dockerfile.j2 | 29 | ||||
| -rw-r--r-- | docker/zun/zun-base/extend_start.sh | 10 | ||||
| -rw-r--r-- | docker/zun/zun-compute/Dockerfile.j2 | 16 | ||||
| -rw-r--r-- | kolla/common/config.py | 7 | ||||
| -rw-r--r-- | tests/test_build.py | 3 |
7 files changed, 91 insertions, 1 deletions
diff --git a/docker/zun/zun-api/Dockerfile.j2 b/docker/zun/zun-api/Dockerfile.j2 new file mode 100644 index 000000000..a23e8d67d --- /dev/null +++ b/docker/zun/zun-api/Dockerfile.j2 @@ -0,0 +1,19 @@ +FROM {{ namespace }}/{{ image_prefix }}zun-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block zun_api_header %}{% endblock %} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_zun_extend_start +RUN chmod 755 /usr/local/bin/kolla_zun_extend_start + +{% block zun_api_footer %}{% endblock %} +{% block footer %}{% endblock %} + +USER zun diff --git a/docker/zun/zun-api/extend_start.sh b/docker/zun/zun-api/extend_start.sh new file mode 100644 index 000000000..eaed680e2 --- /dev/null +++ b/docker/zun/zun-api/extend_start.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +# 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 + zun-db-manage upgrade + exit 0 +fi diff --git a/docker/zun/zun-base/Dockerfile.j2 b/docker/zun/zun-base/Dockerfile.j2 new file mode 100644 index 000000000..a7b0da834 --- /dev/null +++ b/docker/zun/zun-base/Dockerfile.j2 @@ -0,0 +1,29 @@ +FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block zun_base_header %}{% endblock %} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% elif install_type == 'source' %} + +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 \ + && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /zun \ + && mkdir -p /etc/zun \ + && cp -r /zun/etc/* /etc/zun/ \ + && chown -R zun: /etc/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 \ + && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_zun_extend_start + +{% block zun_base_footer %}{% endblock %} diff --git a/docker/zun/zun-base/extend_start.sh b/docker/zun/zun-base/extend_start.sh new file mode 100644 index 000000000..f864b99bc --- /dev/null +++ b/docker/zun/zun-base/extend_start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [[ ! -d "/var/log/kolla/zun" ]]; then + mkdir -p /var/log/kolla/zun +fi +if [[ $(stat -c %a /var/log/kolla/zun) != "755" ]]; then + chmod 755 /var/log/kolla/zun +fi + +. /usr/local/bin/kolla_zun_extend_start diff --git a/docker/zun/zun-compute/Dockerfile.j2 b/docker/zun/zun-compute/Dockerfile.j2 new file mode 100644 index 000000000..7d6fc41fd --- /dev/null +++ b/docker/zun/zun-compute/Dockerfile.j2 @@ -0,0 +1,16 @@ +FROM {{ namespace }}/{{ image_prefix }}zun-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% block zun_compute_header %}{% endblock %} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% endif %} + +{% block zun_compute_footer %}{% endblock %} +{% block footer %}{% endblock %} + +USER zun diff --git a/kolla/common/config.py b/kolla/common/config.py index 8879389b8..7eb66075d 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -96,6 +96,7 @@ _PROFILE_OPTS = [ 'trove', 'zaqar', 'zookeeper', + 'zun', ], help='Aux Images'), cfg.ListOpt('default', @@ -490,7 +491,11 @@ SOURCES = { 'zaqar': { 'type': 'url', 'location': ('http://tarballs.openstack.org/zaqar/' - 'zaqar-master.tar.gz')} + 'zaqar-master.tar.gz')}, + 'zun-base': { + 'type': 'url', + 'location': ('http://tarballs.openstack.org/zun/' + 'zun-master.tar.gz')} } diff --git a/tests/test_build.py b/tests/test_build.py index 01cf78b4d..a16491087 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -83,6 +83,7 @@ class BuildTestCentosBinary(BuildTest, base.BaseTestCase): "vmtp", "watcher-base", "zookeeper", + "zun-base", ] def setUp(self): @@ -123,6 +124,7 @@ class BuildTestUbuntuBinary(BuildTest, base.BaseTestCase): "vmtp", "watcher-base", "zaqar", + "zun-base", ] def setUp(self): @@ -159,6 +161,7 @@ class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase): "vmtp", "watcher-base", "zookeeper", + "zun-base", ] def setUp(self): |
