From f36b5aef718fc41344afd8e6cd01a40d671d1da1 Mon Sep 17 00:00:00 2001 From: hparekh Date: Thu, 17 Dec 2015 18:14:53 +0900 Subject: [PATCH] Added dockerfiles for mistral. Change-Id: Ie74a91dccf654da9305722d14af2f0a893dbaaff Partially-implements: blueprint enable-mistral-container --- docker/mistral/mistral-api/Dockerfile.j2 | 9 ++++++++ docker/mistral/mistral-api/extend_start.sh | 8 +++++++ docker/mistral/mistral-base/Dockerfile.j2 | 21 +++++++++++++++++++ docker/mistral/mistral-engine/Dockerfile.j2 | 6 ++++++ docker/mistral/mistral-executor/Dockerfile.j2 | 6 ++++++ etc/kolla/kolla-build.conf | 6 +++++- tests/test_build.py | 3 ++- 7 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 docker/mistral/mistral-api/Dockerfile.j2 create mode 100644 docker/mistral/mistral-api/extend_start.sh create mode 100644 docker/mistral/mistral-base/Dockerfile.j2 create mode 100644 docker/mistral/mistral-engine/Dockerfile.j2 create mode 100644 docker/mistral/mistral-executor/Dockerfile.j2 diff --git a/docker/mistral/mistral-api/Dockerfile.j2 b/docker/mistral/mistral-api/Dockerfile.j2 new file mode 100644 index 0000000000..3e313ddef5 --- /dev/null +++ b/docker/mistral/mistral-api/Dockerfile.j2 @@ -0,0 +1,9 @@ +FROM {{ namespace }}/{{ image_prefix }}mistral-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 mistral diff --git a/docker/mistral/mistral-api/extend_start.sh b/docker/mistral/mistral-api/extend_start.sh new file mode 100644 index 0000000000..4316395acb --- /dev/null +++ b/docker/mistral/mistral-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 + mistral-db-manage --config-file /etc/mistral/mistral.conf upgrade head + exit 0 +fi diff --git a/docker/mistral/mistral-base/Dockerfile.j2 b/docker/mistral/mistral-base/Dockerfile.j2 new file mode 100644 index 0000000000..fbcc7f3e84 --- /dev/null +++ b/docker/mistral/mistral-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 mistral-base-archive /mistral-base-source +RUN ln -s mistral-base-source/* mistral \ + && useradd --user-group mistral \ + && /var/lib/kolla/venv/bin/pip --no-cache-dir install /mistral \ + && mkdir -p /etc/mistral /var/log/mistral /home/mistral \ + && cp -r /mistral/etc/* /etc/mistral/ \ + && chown -R mistral: /etc/mistral /var/log/mistral /home/mistral + +{% endif %} + +RUN usermod -a -G kolla mistral diff --git a/docker/mistral/mistral-engine/Dockerfile.j2 b/docker/mistral/mistral-engine/Dockerfile.j2 new file mode 100644 index 0000000000..75649cf474 --- /dev/null +++ b/docker/mistral/mistral-engine/Dockerfile.j2 @@ -0,0 +1,6 @@ +FROM {{ namespace }}/{{ image_prefix }}mistral-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{{ include_footer }} + +USER mistral diff --git a/docker/mistral/mistral-executor/Dockerfile.j2 b/docker/mistral/mistral-executor/Dockerfile.j2 new file mode 100644 index 0000000000..75649cf474 --- /dev/null +++ b/docker/mistral/mistral-executor/Dockerfile.j2 @@ -0,0 +1,6 @@ +FROM {{ namespace }}/{{ image_prefix }}mistral-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{{ include_footer }} + +USER mistral diff --git a/etc/kolla/kolla-build.conf b/etc/kolla/kolla-build.conf index 02bdfc1374..74f3784ed9 100644 --- a/etc/kolla/kolla-build.conf +++ b/etc/kolla/kolla-build.conf @@ -56,7 +56,7 @@ [profiles] infra = ceph,data,mariadb,haproxy,keepalived,kolla-ansible,memcached,mongodb,openvswitch,rabbitmq,rsyslog main = cinder,ceilometer,glance,heat,horizon,keystone,neutron,nova,swift -aux = aodh,designate,gnocchi,ironic,magnum,trove,zaqar +aux = aodh,designate,gnocchi,ironic,magnum,mistral,trove,zaqar default = data,kolla-ansible,glance,haproxy,heat,horizon,keepalived,keystone,memcached,mariadb,neutron,nova,openvswitch,rabbitmq,rsyslog gate = ceph,cinder,data,dind,glance,haproxy,heat,horizon,keepalived,keystone,kolla-ansible,mariadb,memcached,neutron,nova,openvswitch,rabbitmq,rsyslog @@ -121,6 +121,10 @@ location = http://tarballs.openstack.org/keystone/keystone-master.tar.gz type = url location = http://tarballs.openstack.org/magnum/magnum-master.tar.gz +[mistral-base] +type = url +location = http://tarballs.openstack.org/mistral/mistral-master.tar.gz + [murano-base] type = url location = http://tarballs.openstack.org/murano/murano-master.tar.gz diff --git a/tests/test_build.py b/tests/test_build.py index e0827eec3e..e724382992 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -42,7 +42,8 @@ class BuildTest(base.BaseTestCase): excluded_images = ["gnocchi-base", "murano-base", "ironic-pxe", - "ironic-discoverd"] + "ironic-discoverd", + "mistral-base"] failures = 0 for image, result in six.iteritems(bad_results):