diff --git a/docker/sahara/sahara-api/Dockerfile.j2 b/docker/sahara/sahara-api/Dockerfile.j2 new file mode 100644 index 0000000000..5cb3154e5e --- /dev/null +++ b/docker/sahara/sahara-api/Dockerfile.j2 @@ -0,0 +1,25 @@ +FROM {{ namespace }}/{{ image_prefix }}sahara-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + +RUN yum -y install \ + openstack-sahara-api \ + && yum clean all + + {% elif base_distro in ['ubuntu'] %} + +RUN apt-get -y install --no-install-recommends \ + sahara-api \ + && apt-get clean + + {% endif %} +{% endif %} + +COPY extend_start.sh /usr/local/bin/kolla_extend_start +RUN chmod 755 /usr/local/bin/kolla_extend_start + +{{ include_footer }} + +USER sahara diff --git a/docker/sahara/sahara-api/extend_start.sh b/docker/sahara/sahara-api/extend_start.sh new file mode 100644 index 0000000000..d3d2c316e6 --- /dev/null +++ b/docker/sahara/sahara-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 + sahara-manage db_sync + exit 0 +fi diff --git a/docker/sahara/sahara-base/Dockerfile.j2 b/docker/sahara/sahara-base/Dockerfile.j2 new file mode 100644 index 0000000000..ab059585d3 --- /dev/null +++ b/docker/sahara/sahara-base/Dockerfile.j2 @@ -0,0 +1,31 @@ +FROM {{ namespace }}/{{ image_prefix }}openstack-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + +RUN yum -y install \ + openstack-sahara-common \ + && yum clean all + + {% elif base_distro in ['ubuntu'] %} + +RUN apt-get -y install --no-install-recommends \ + sahara-common \ + && apt-get clean + + {% endif %} + +{% elif install_type == 'source' %} + +ADD sahara-base-archive /sahara-base-source +RUN ln -s sahara-base-source/* sahara \ + && useradd --user-group sahara \ + && /var/lib/kolla/venv/bin/pip --no-cache-dir install --upgrade -c requirements/upper-constraints.txt /sahara \ + && mkdir -p /etc/sahara /var/log/sahara /home/sahara \ + && cp -r /sahara/etc/* /etc/sahara/ \ + && chown -R sahara: /etc/sahara /var/log/sahara /home/sahara + +{% endif %} + +RUN usermod -a -G kolla sahara diff --git a/docker/sahara/sahara-base/extend_start.sh b/docker/sahara/sahara-base/extend_start.sh new file mode 100644 index 0000000000..74a9dbdddd --- /dev/null +++ b/docker/sahara/sahara-base/extend_start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +if [[ ! -d "/var/log/kolla/sahara" ]]; then + mkdir -p /var/log/kolla/sahara +fi +if [[ $(stat -c %a /var/log/kolla/sahara) != "755" ]]; then + chmod 755 /var/log/kolla/sahara +fi + +source /usr/local/bin/kolla_sahara_extend_start diff --git a/docker/sahara/sahara-engine/Dockerfile.j2 b/docker/sahara/sahara-engine/Dockerfile.j2 new file mode 100644 index 0000000000..48362a46f9 --- /dev/null +++ b/docker/sahara/sahara-engine/Dockerfile.j2 @@ -0,0 +1,22 @@ +FROM {{ namespace }}/{{ image_prefix }}sahara-base:{{ tag }} +MAINTAINER {{ maintainer }} + +{% if install_type == 'binary' %} + {% if base_distro in ['centos', 'fedora', 'oraclelinux', 'rhel'] %} + +RUN yum -y install \ + openstack-sahara-engine \ + && yum clean all + + {% elif base_distro in ['ubuntu'] %} + +RUN apt-get -y install --no-install-recommends \ + sahara-engine \ + && apt-get clean + + {% endif %} +{% endif %} + +{{ include_footer }} + +USER sahara diff --git a/kolla/common/config.py b/kolla/common/config.py index 21ac064b61..ea890167b1 100644 --- a/kolla/common/config.py +++ b/kolla/common/config.py @@ -240,6 +240,10 @@ SOURCES = { 'type': 'url', 'location': ('http://github.com/kanaka/noVNC/tarball/' 'v0.5.1')}, + 'sahara-base': { + 'type': 'url', + 'location': ('http://tarballs.openstack.org/sahara/' + 'sahara-master.tar.gz')}, 'swift-base': { 'type': 'url', 'location': ('http://tarballs.openstack.org/swift/'