aboutsummaryrefslogtreecommitdiff
path: root/docker/centos/binary/ceilometer/ceilometer-api
diff options
context:
space:
mode:
authorSam Yaple <sam@yaple.net>2015-05-13 06:46:24 -0500
committerSam Yaple <sam@yaple.net>2015-05-15 01:32:22 -0500
commit13062e23e86b5d86020949754540460cb5b0b4fe (patch)
treee0b3c8411418949a3d8df221da7c8cb2831b6d5d /docker/centos/binary/ceilometer/ceilometer-api
parent354ba01c8f5c7e1695cbea3bfc07aee5b75e76d9 (diff)
downloadkolla-13062e23e86b5d86020949754540460cb5b0b4fe.tar.gz
kolla-13062e23e86b5d86020949754540460cb5b0b4fe.zip
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
Diffstat (limited to 'docker/centos/binary/ceilometer/ceilometer-api')
-rw-r--r--docker/centos/binary/ceilometer/ceilometer-api/Dockerfile7
l---------docker/centos/binary/ceilometer/ceilometer-api/build1
-rw-r--r--docker/centos/binary/ceilometer/ceilometer-api/start.sh51
3 files changed, 59 insertions, 0 deletions
diff --git a/docker/centos/binary/ceilometer/ceilometer-api/Dockerfile b/docker/centos/binary/ceilometer/ceilometer-api/Dockerfile
new file mode 100644
index 000000000..7a1337c7b
--- /dev/null
+++ b/docker/centos/binary/ceilometer/ceilometer-api/Dockerfile
@@ -0,0 +1,7 @@
+FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%ceilometer-base:%%KOLLA_TAG%%
+MAINTAINER Kolla Project (https://launchpad.net/kolla)
+
+RUN yum install -y openstack-ceilometer-api && yum clean all
+
+ADD ./start.sh /start.sh
+CMD ["/start.sh"]
diff --git a/docker/centos/binary/ceilometer/ceilometer-api/build b/docker/centos/binary/ceilometer/ceilometer-api/build
new file mode 120000
index 000000000..ec1913803
--- /dev/null
+++ b/docker/centos/binary/ceilometer/ceilometer-api/build
@@ -0,0 +1 @@
+../../../../../tools/build-docker-image \ No newline at end of file
diff --git a/docker/centos/binary/ceilometer/ceilometer-api/start.sh b/docker/centos/binary/ceilometer/ceilometer-api/start.sh
new file mode 100644
index 000000000..f081c9f84
--- /dev/null
+++ b/docker/centos/binary/ceilometer/ceilometer-api/start.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+
+set -e
+
+. /opt/kolla/kolla-common.sh
+. /opt/kolla/config-ceilometer.sh
+
+check_required_vars CEILOMETER_DB_USER CEILOMETER_DB_NAME \
+ CEILOMETER_DB_PASSWORD KEYSTONE_ADMIN_TOKEN \
+ KEYSTONE_AUTH_PROTOCOL KEYSTONE_ADMIN_SERVICE_HOST \
+ KEYSTONE_ADMIN_SERVICE_PORT ADMIN_TENANT_NAME \
+ CEILOMETER_KEYSTONE_USER CEILOMETER_ADMIN_PASSWORD \
+ CEILOMETER_API_SERVICE_HOST PUBLIC_IP
+
+fail_unless_os_service_running keystone
+fail_unless_db
+
+#TODO(pkilambi): Add mongodb support
+
+mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
+CREATE DATABASE IF NOT EXISTS ${CEILOMETER_DB_NAME} DEFAULT CHARACTER SET utf8;
+GRANT ALL PRIVILEGES ON ${CEILOMETER_DB_NAME}.* TO
+ '${CEILOMETER_DB_USER}'@'%' IDENTIFIED BY '${CEILOMETER_DB_PASSWORD}'
+
+EOF
+
+
+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 ${CEILOMETER_KEYSTONE_USER} \
+ -p ${CEILOMETER_ADMIN_PASSWORD} \
+ -t ${ADMIN_TENANT_NAME} \
+ -r admin
+
+crux service-create -n ${CEILOMETER_KEYSTONE_USER} -t metering \
+ -d "Ceilometer Telemetry Service"
+
+crux endpoint-create i--remove-all -n ${CEILOMETER_KEYSTONE_USER} -t metering \
+ -I "${KEYSTONE_AUTH_PROTOCOL}://${CEILOMETER_API_SERVICE_HOST}:8777" \
+ -P "${KEYSTONE_AUTH_PROTOCOL}://${PUBLIC_IP}:8777" \
+ -A "${KEYSTONE_AUTH_PROTOCOL}://${CEILOMETER_API_SERVICE_HOST}:8777"
+
+cfg=/etc/ceilometer/ceilometer.conf
+crudini --set $cfg \
+ DEFAULT connection
+ "mysql://${CEILOMETER_DB_USER}:${CEILOMETER_DB_PASSWORD}@${MARIADB_SERVICE_HOST}/${CEILOMETER_DB_NAME}"
+
+
+exec /usr/bin/ceilometer-api