diff --git a/docker/heat/heat-api/Dockerfile b/docker/heat/heat-api/Dockerfile new file mode 100644 index 0000000000..4a7799335d --- /dev/null +++ b/docker/heat/heat-api/Dockerfile @@ -0,0 +1,6 @@ +FROM fedora-rdo-heat-base +MAINTAINER Steven Dake <sdake@redhat.com> + +ADD ./start.sh /start.sh +CMD ["/start.sh"] + diff --git a/docker/heat/heat-api/start.sh b/docker/heat/heat-api/start.sh new file mode 100644 index 0000000000..9a35a49b94 --- /dev/null +++ b/docker/heat/heat-api/start.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +sh /opt/heat/config-glance.sh api + +exec /usr/bin/heat-api diff --git a/docker/heat/heat-base/Dockerfile b/docker/heat/heat-base/Dockerfile new file mode 100644 index 0000000000..1904d189c6 --- /dev/null +++ b/docker/heat/heat-base/Dockerfile @@ -0,0 +1,10 @@ +FROM fedora-rdo-base +MAINTAINER Steven Dake <sdake@redhat.com> + +RUN yum -y install \ + openstack-utils \ + openstack-heat && yum clean all + +# These will come after we sort out start time config +#RUN mkdir /opt/heat +#COPY config-heat.sh /opt/heat/config-heat.sh diff --git a/docker/heat/heat-engine/Dockerfile b/docker/heat/heat-engine/Dockerfile new file mode 100644 index 0000000000..49b80e1f66 --- /dev/null +++ b/docker/heat/heat-engine/Dockerfile @@ -0,0 +1,6 @@ +FROM fedora-rdo-base +MAINTAINER Steven Dake <sdake@redhat.com> + +ADD ./start.sh /start.sh +CMD ["/start.sh"] + diff --git a/docker/heat/heat-engine/start.sh b/docker/heat/heat-engine/start.sh new file mode 100644 index 0000000000..ac95ad3a1d --- /dev/null +++ b/docker/heat/heat-engine/start.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +: ${GLANCE_DB_USER:=heat} +: ${GLANCE_DB_NAME:=heat} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${GLANCE_KEYSTONE_USER:=heat} +: ${ADMIN_TENANT_NAME:=admin} + +if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then + echo "*** Missing KEYSTONE_ADMIN_TOKEN" >&2 + exit 1 +fi + +if ! [ "$DB_ROOT_PASSWORD" ]; then + echo "*** Missing DB_ROOT_PASSWORD" >&2 + exit 1 +fi + +if ! [ "$GLANCE_DB_PASSWORD" ]; then + GLANCE_DB_PASSWORD=$(openssl rand -hex 15) + export GLANCE_DB_PASSWORD +fi + +sh /opt/heat/config-heat.sh engine + +mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root \ + -p${DB_ROOT_PASSWORD} mysql <<EOF +CREATE DATABASE IF NOT EXISTS ${GLANCE_DB_NAME}; +GRANT ALL PRIVILEGES ON heat* TO + '${GLANCE_DB_USER}'@'%' IDENTIFIED BY '${GLANCE_DB_PASSWORD}' +EOF + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONEMASTER_35357_PORT_35357_TCP_ADDR}:35357/v2.0" + +/bin/keystone user-create --name ${GLANCE_KEYSTONE_USER} --pass ${GLANCE_ADMIN_PASSWORD} +/bin/keystone role-create --name ${GLANCE_KEYSTONE_USER} +/bin/keystone user-role-add --user ${GLANCE_KEYSTONE_USER} --role admin --tenant ${ADMIN_TENANT_NAME} + +exec /usr/bin/heat-engine diff --git a/docker/heat/heat.json b/docker/heat/heat.json new file mode 100644 index 0000000000..ca4fd08540 --- /dev/null +++ b/docker/heat/heat.json @@ -0,0 +1,56 @@ +{ + "id": "heat", + "desiredState": { + "manifest": { + "version": "v1beta1", + "id": "heat-1", + "containers": [ + { + "name": "heat-engine", + "image": "fedora-rdo-heat-engine", + "ports": [ + {"containerPort": 9292}, + ], + "env": [ + { + "name": "DB_ROOT_PASSWORD", + "value": "password" + }, + { + "name": "HEAT_DB_PASSWORD", + "value": "heatdbpassword" + }, + { + "name": "KEYSTONE_ADMIN_TOKEN", + "value": "ADMINTOKEN" + }, + ] + }, + { + "name": "heat-api", + "image": "fedora-rdo-heat-api", + "ports": [ + {"containerPort": 9292}, + ], + "env": [ + { + "name": "DB_ROOT_PASSWORD", + "value": "password" + }, + { + "name": "HEAT_DB_PASSWORD", + "value": "heatdbpassword" + }, + { + "name": "KEYSTONE_ADMIN_TOKEN", + "value": "ADMINTOKEN" + }, + ] + }, + ] + } + }, + "labels": { + "name": "keystone-master" + } +}