Add heat api and engine docker boilerplates

This adds a directory layout for Heat based on the Glance setup,
but does not actually attempt to build functional images at this time.
This commit is contained in:
Steven Dake 2014-09-20 12:24:19 -07:00 committed by Lars Kellogg-Stedman
parent 3c7e0da467
commit 3b9c556254
6 changed files with 123 additions and 0 deletions

View File

@ -0,0 +1,6 @@
FROM fedora-rdo-heat-base
MAINTAINER Steven Dake <sdake@redhat.com>
ADD ./start.sh /start.sh
CMD ["/start.sh"]

View File

@ -0,0 +1,5 @@
#!/bin/sh
sh /opt/heat/config-glance.sh api
exec /usr/bin/heat-api

View File

@ -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

View File

@ -0,0 +1,6 @@
FROM fedora-rdo-base
MAINTAINER Steven Dake <sdake@redhat.com>
ADD ./start.sh /start.sh
CMD ["/start.sh"]

View File

@ -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

56
docker/heat/heat.json Normal file
View File

@ -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"
}
}