diff options
| author | Eduardo Gonzalez <dabarren@gmail.com> | 2016-06-29 17:05:30 +0200 |
|---|---|---|
| committer | Eduardo Gonzalez <dabarren@gmail.com> | 2016-06-30 16:36:25 +0200 |
| commit | 1d399461ac1678490fb7a9b697464efbfd0a8411 (patch) | |
| tree | 9c944d9e6b3a820b31758d6f819b345a92851d53 | |
| parent | 100e4aba622d8edfeccd5d50ee365e7df6e856db (diff) | |
| download | kolla-1d399461ac1678490fb7a9b697464efbfd0a8411.tar.gz kolla-1d399461ac1678490fb7a9b697464efbfd0a8411.zip | |
Add Senlin Docker container
Change-Id: I52e08e2df77106969c5975ebda2510ea8aefa8b5
Partially-implements: bp senlin-container
Signed-off-by: Eduardo Gonzalez <dabarren@gmail.com>
| -rw-r--r-- | docker/senlin/senlin-api/Dockerfile.j2 | 16 | ||||
| -rw-r--r-- | docker/senlin/senlin-api/extend_start.sh | 8 | ||||
| -rw-r--r-- | docker/senlin/senlin-base/Dockerfile.j2 | 25 | ||||
| -rw-r--r-- | docker/senlin/senlin-base/extend_start.sh | 10 | ||||
| -rw-r--r-- | docker/senlin/senlin-engine/Dockerfile.j2 | 13 | ||||
| -rw-r--r-- | kolla/common/config.py | 4 | ||||
| -rw-r--r-- | tests/test_build.py | 6 |
7 files changed, 80 insertions, 2 deletions
diff --git a/docker/senlin/senlin-api/Dockerfile.j2 b/docker/senlin/senlin-api/Dockerfile.j2 new file mode 100644 index 000000000..db594e1c4 --- /dev/null +++ b/docker/senlin/senlin-api/Dockerfile.j2 @@ -0,0 +1,16 @@ +FROM {{ namespace }}/{{ image_prefix }}senlin-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% 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_senlin_extend_start +RUN chmod 755 /usr/local/bin/kolla_senlin_extend_start + +{{ include_footer }} + +USER senlin diff --git a/docker/senlin/senlin-api/extend_start.sh b/docker/senlin/senlin-api/extend_start.sh new file mode 100644 index 000000000..2de5b4c65 --- /dev/null +++ b/docker/senlin/senlin-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 + senlin-manage --config-file /etc/senlin/senlin.conf db_sync + exit 0 +fi diff --git a/docker/senlin/senlin-base/Dockerfile.j2 b/docker/senlin/senlin-base/Dockerfile.j2 new file mode 100644 index 000000000..cb3a4894f --- /dev/null +++ b/docker/senlin/senlin-base/Dockerfile.j2 @@ -0,0 +1,25 @@ +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 senlin-base-archive /senlin-base-source +RUN ln -s senlin-base-source/* senlin \ + && useradd --user-group senlin \ + && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /senlin \ + && mkdir -p /etc/senlin \ + && cp -r /senlin/etc/senlin/* /etc/senlin \ + && chown -R senlin: /etc/senlin + +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_extend_start + +RUN usermod -a -G kolla senlin \ + && touch /usr/local/bin/kolla_senlin_extend_start \ + && chmod 755 /usr/local/bin/kolla_extend_start /usr/local/bin/kolla_senlin_extend_start diff --git a/docker/senlin/senlin-base/extend_start.sh b/docker/senlin/senlin-base/extend_start.sh new file mode 100644 index 000000000..02886d459 --- /dev/null +++ b/docker/senlin/senlin-base/extend_start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [[ ! -d "/var/log/kolla/senlin" ]]; then + mkdir -p /var/log/kolla/senlin +fi +if [[ $(stat -c %a /var/log/kolla/senlin) != "755" ]]; then + chmod 755 /var/log/kolla/senlin +fi + +source /usr/local/bin/kolla_senlin_extend_start diff --git a/docker/senlin/senlin-engine/Dockerfile.j2 b/docker/senlin/senlin-engine/Dockerfile.j2 new file mode 100644 index 000000000..565c71bf4 --- /dev/null +++ b/docker/senlin/senlin-engine/Dockerfile.j2 @@ -0,0 +1,13 @@ +FROM {{ namespace }}/{{ image_prefix }}senlin-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% if install_type == 'binary' %} + +RUN echo '{{ install_type }} not yet available for {{ base_distro }}' \ + && /bin/false + +{% endif %} + +{{ include_footer }} + +USER senlin diff --git a/kolla/common/config.py b/kolla/common/config.py index 0aceb990a..83494c5d3 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -254,6 +254,10 @@ SOURCES = { 'type': 'url', 'location': ('http://tarballs.openstack.org/sahara/' 'sahara-master.tar.gz')}, + 'senlin-base': { + 'type': 'url', + 'location': ('http://tarballs.openstack.org/senlin/' + 'senlin-master.tar.gz')}, 'swift-base': { 'type': 'url', 'location': ('http://tarballs.openstack.org/swift/' diff --git a/tests/test_build.py b/tests/test_build.py index e5832aaac..85f6b5c01 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -67,7 +67,8 @@ class BuildTest(object): class BuildTestCentosBinary(BuildTest, base.BaseTestCase): - excluded_images = ["kuryr"] + excluded_images = ["kuryr", + "senlin-base"] def setUp(self): super(BuildTestCentosBinary, self).setUp() @@ -104,7 +105,8 @@ class BuildTestUbuntuSource(BuildTest, base.BaseTestCase): class BuildTestOracleLinuxBinary(BuildTest, base.BaseTestCase): - excluded_images = ["kuryr"] + excluded_images = ["kuryr", + "senlin-base"] def setUp(self): super(BuildTestOracleLinuxBinary, self).setUp() |
