From 13062e23e86b5d86020949754540460cb5b0b4fe Mon Sep 17 00:00:00 2001 From: Sam Yaple Date: Wed, 13 May 2015 06:46:24 -0500 Subject: Restructure builds to allow more flexibility As a restructure, nothing is changed from the original behaviour and naming despite the file structure changing. The symlinks to build had to be updated generating lots of "deleted" and "new_file". The new structure is: docker/${base_distro}/${type}/${container} base_distro == centos, ubuntu, fedora, etc type == source, binary, rdo type rdo is a symlink to binary for backwards compatibility Two new flags are added to the build-all script to support the ability to support different base distros and a flag to support binary or source containers. There are several added folders that are empty to hold the directory structure for future containers of these types. To use a prefix other than centos-rdo- you can set PREFIX in the toplevel directory .buildconf file Change-Id: Ifc7bac0d827470f506c8b5c004a833da9ce13b90 --- docker/centos/binary/heat/heat-api-cfn/Dockerfile | 12 ++++ docker/centos/binary/heat/heat-api-cfn/build | 1 + docker/centos/binary/heat/heat-api-cfn/check.sh | 16 ++++++ docker/centos/binary/heat/heat-api-cfn/start.sh | 28 +++++++++ docker/centos/binary/heat/heat-api/Dockerfile | 14 +++++ docker/centos/binary/heat/heat-api/build | 1 + docker/centos/binary/heat/heat-api/check.sh | 16 ++++++ docker/centos/binary/heat/heat-api/start.sh | 29 ++++++++++ docker/centos/binary/heat/heat-base/Dockerfile | 5 ++ docker/centos/binary/heat/heat-base/build | 1 + docker/centos/binary/heat/heat-base/config-heat.sh | 67 ++++++++++++++++++++++ docker/centos/binary/heat/heat-engine/Dockerfile | 9 +++ docker/centos/binary/heat/heat-engine/build | 1 + docker/centos/binary/heat/heat-engine/start.sh | 17 ++++++ 14 files changed, 217 insertions(+) create mode 100644 docker/centos/binary/heat/heat-api-cfn/Dockerfile create mode 120000 docker/centos/binary/heat/heat-api-cfn/build create mode 100755 docker/centos/binary/heat/heat-api-cfn/check.sh create mode 100755 docker/centos/binary/heat/heat-api-cfn/start.sh create mode 100644 docker/centos/binary/heat/heat-api/Dockerfile create mode 120000 docker/centos/binary/heat/heat-api/build create mode 100755 docker/centos/binary/heat/heat-api/check.sh create mode 100755 docker/centos/binary/heat/heat-api/start.sh create mode 100644 docker/centos/binary/heat/heat-base/Dockerfile create mode 120000 docker/centos/binary/heat/heat-base/build create mode 100755 docker/centos/binary/heat/heat-base/config-heat.sh create mode 100644 docker/centos/binary/heat/heat-engine/Dockerfile create mode 120000 docker/centos/binary/heat/heat-engine/build create mode 100755 docker/centos/binary/heat/heat-engine/start.sh (limited to 'docker/centos/binary/heat') diff --git a/docker/centos/binary/heat/heat-api-cfn/Dockerfile b/docker/centos/binary/heat/heat-api-cfn/Dockerfile new file mode 100644 index 000000000..18a7e369d --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/Dockerfile @@ -0,0 +1,12 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%heat-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN yum -y install \ + openstack-heat-api-cfn \ + python-openstackclient \ + && yum clean all + +ADD ./start.sh /start.sh +ADD ./check.sh /check.sh + +CMD ["/start.sh"] diff --git a/docker/centos/binary/heat/heat-api-cfn/build b/docker/centos/binary/heat/heat-api-cfn/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/heat/heat-api-cfn/check.sh b/docker/centos/binary/heat/heat-api-cfn/check.sh new file mode 100755 index 000000000..ee03dc6d2 --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/check.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +RES=0 + +. /openrc +if ! keystone token-get > /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! heat stack-list > /dev/null; then + echo "ERROR: heat stack-list failed" >&2 + RES=1 + fi +fi + +exit $RES diff --git a/docker/centos/binary/heat/heat-api-cfn/start.sh b/docker/centos/binary/heat/heat-api-cfn/start.sh new file mode 100755 index 000000000..bcd72250b --- /dev/null +++ b/docker/centos/binary/heat/heat-api-cfn/start.sh @@ -0,0 +1,28 @@ +#!/bin/bash +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-heat.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + HEAT_CFN_KEYSTONE_USER HEAT_CFN_KEYSTONE_PASSWORD \ + KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_PORT \ + ADMIN_TENANT_NAME HEAT_API_CFN_SERVICE_HOST \ + HEAT_API_CFN_SERVICE_PORT + +fail_unless_os_service_running keystone + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0" + +crux user-create -n ${HEAT_CFN_KEYSTONE_USER} \ + -p ${HEAT_CFN_KEYSTONE_PASSWORD} \ + -t ${ADMIN_TENANT_NAME} \ + -r admin + +crux endpoint-create --remove-all -n ${HEAT_CFN_KEYSTONE_USER} -t cloudformation \ + -I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \ + -P "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" \ + -A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_CFN_SERVICE_HOST}:${HEAT_API_CFN_SERVICE_PORT}/v1" + +exec /usr/bin/heat-api-cfn diff --git a/docker/centos/binary/heat/heat-api/Dockerfile b/docker/centos/binary/heat/heat-api/Dockerfile new file mode 100644 index 000000000..407aee601 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/Dockerfile @@ -0,0 +1,14 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%heat-base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# TODO: configure cfn and cloudwatch +# TODO: remove python-openstackclient once crux feature is added in start.sh +RUN yum -y install \ + openstack-heat-api \ + python-openstackclient \ + && yum clean all + +ADD ./start.sh /start.sh +ADD ./check.sh /check.sh + +CMD ["/start.sh"] diff --git a/docker/centos/binary/heat/heat-api/build b/docker/centos/binary/heat/heat-api/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/heat/heat-api/check.sh b/docker/centos/binary/heat/heat-api/check.sh new file mode 100755 index 000000000..ee03dc6d2 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/check.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +RES=0 + +. /openrc +if ! keystone token-get > /dev/null; then + echo "ERROR: keystone token-get failed" >&2 + RES=1 +else + if ! heat stack-list > /dev/null; then + echo "ERROR: heat stack-list failed" >&2 + RES=1 + fi +fi + +exit $RES diff --git a/docker/centos/binary/heat/heat-api/start.sh b/docker/centos/binary/heat/heat-api/start.sh new file mode 100755 index 000000000..b57aaa710 --- /dev/null +++ b/docker/centos/binary/heat/heat-api/start.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -e + +. /opt/kolla/kolla-common.sh +. /opt/kolla/config-heat.sh + +check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \ + HEAT_KEYSTONE_USER HEAT_KEYSTONE_PASSWORD \ + KEYSTONE_AUTH_PROTOCOL ADMIN_TENANT_NAME \ + HEAT_API_SERVICE_HOST PUBLIC_IP + +fail_unless_os_service_running keystone + +export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}" +export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:35357/v2.0" +crux user-create -n ${HEAT_KEYSTONE_USER} \ + -p ${HEAT_KEYSTONE_PASSWORD} \ + -t ${ADMIN_TENANT_NAME} \ + -r admin + +crux endpoint-create --remove-all -n ${HEAT_KEYSTONE_USER} -t orchestration \ + -I "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" \ + -P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8004/v1/%(tenant_id)s" \ + -A "${KEYSTONE_AUTH_PROTOCOL}://${HEAT_API_SERVICE_HOST}:8004/v1/%(tenant_id)s" + +# will use crux after https://github.com/larsks/crux/issues/1 is implemented +openstack role list --os-token="${KEYSTONE_ADMIN_TOKEN}" --os-url $SERVICE_ENDPOINT -f csv | tail -n +2 | awk -F, '{print $2}' | grep heat_stack_user || keystone role-create --name heat_stack_user + +exec /usr/bin/heat-api diff --git a/docker/centos/binary/heat/heat-base/Dockerfile b/docker/centos/binary/heat/heat-base/Dockerfile new file mode 100644 index 000000000..ebe9fa15c --- /dev/null +++ b/docker/centos/binary/heat/heat-base/Dockerfile @@ -0,0 +1,5 @@ +FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%% +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +RUN mkdir -p /opt/kolla +COPY config-heat.sh /opt/kolla/config-heat.sh diff --git a/docker/centos/binary/heat/heat-base/build b/docker/centos/binary/heat/heat-base/build new file mode 120000 index 000000000..ec1913803 --- /dev/null +++ b/docker/centos/binary/heat/heat-base/build @@ -0,0 +1 @@ +../../../../../tools/build-docker-image \ No newline at end of file diff --git a/docker/centos/binary/heat/heat-base/config-heat.sh b/docker/centos/binary/heat/heat-base/config-heat.sh new file mode 100755 index 000000000..74b2718a4 --- /dev/null +++ b/docker/centos/binary/heat/heat-base/config-heat.sh @@ -0,0 +1,67 @@ +#!/bin/bash + +set -e + +. /opt/kolla/kolla-common.sh + +: ${ADMIN_TENANT_NAME:=admin} +: ${HEAT_DB_NAME:=heat} +: ${HEAT_DB_USER:=heat} +: ${HEAT_KEYSTONE_USER:=heat} +: ${HEAT_CFN_KEYSTONE_USER:=heat_cfn} +: ${KEYSTONE_AUTH_PROTOCOL:=http} +: ${PUBLIC_IP:=$HEAT_API_PORT_8004_TCP_ADDR} +: ${RABBIT_USER:=guest} +: ${RABBIT_PASSWORD:=guest} + +check_required_vars HEAT_DB_PASSWORD HEAT_KEYSTONE_PASSWORD \ + KEYSTONE_PUBLIC_SERVICE_HOST RABBITMQ_SERVICE_HOST + +fail_unless_db +dump_vars + +cat > /openrc <