Skip to content
Snippets Groups Projects
Commit 07184293 authored by Jenkins's avatar Jenkins Committed by Gerrit Code Review
Browse files

Merge "Add Gnocchi service to kolla"

parents e70e422c 870ec615
No related branches found
No related tags found
No related merge requests found
Showing
with 163 additions and 0 deletions
......@@ -46,6 +46,7 @@ services:
* Horizon
* Zaqar
* Magnum
* Gnocchi
```
$ sudo docker search kollaglue
......
gnocchiapi:
image: kollaglue/centos-rdo-gnocchi-api:latest
name: gnocchiapi
restart: always
env_file:
- openstack.env
net: "host"
gnocchistatsd:
image: kollaglue/centos-rdo-gnocchi-statsd:latest
name: gnocchistatsd
restart: always
env_file:
- openstack.env
net: "host"
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%gnocchi-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum install -y openstack-gnocchi-api \
openstack-gnocchi-carbonara \
openstack-gnocchi-indexer-sqlalchemy \
&& yum clean all
COPY ./start.sh /start.sh
CMD ["/start.sh"]
../../../../../tools/build-docker-image
\ No newline at end of file
../../../../common/gnocchi/gnocchi-api/config-external.sh
\ No newline at end of file
../../../../common/gnocchi/gnocchi-api/config-internal.sh
\ No newline at end of file
../../../../common/gnocchi/gnocchi-api/start.sh
\ No newline at end of file
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
COPY config-gnocchi.sh /opt/kolla/config-gnocchi.sh
../../../../../tools/build-docker-image
\ No newline at end of file
../../../../common/gnocchi/gnocchi-base/config-gnocchi.sh
\ No newline at end of file
FROM %%KOLLA_NAMESPACE%%/%%KOLLA_PREFIX%%gnocchi-base:%%KOLLA_TAG%%
MAINTAINER Kolla Project (https://launchpad.net/kolla)
RUN yum install -y openstack-gnocchi-statsd && yum clean all
COPY ./start.sh /start.sh
CMD ["/start.sh"]
../../../../../tools/build-docker-image
\ No newline at end of file
../../../../common/gnocchi/gnocchi-statsd/config-external.sh
\ No newline at end of file
../../../../common/gnocchi/gnocchi-statsd/config-internal.sh
\ No newline at end of file
../../../../common/gnocchi/gnocchi-statsd/start.sh
\ No newline at end of file
#!/bin/bash
SOURCE="/opt/kolla/gnocchi-api/gnocchi-api.conf"
TARGET="/etc/gnocchi/gnocchi-api.conf"
OWNER="gnocchi"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
. /opt/kolla/config-gnocchi.sh
check_required_vars KEYSTONE_ADMIN_TOKEN \
KEYSTONE_AUTH_PROTOCOL \
KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT \
ADMIN_TENANT_NAME \
GNOCCHI_DB_NAME \
GNOCCHI_DB_USER \
GNOCCHI_DB_PASSWORD \
GNOCCHI_SERVICE_PROTOCOL \
GNOCCHI_SERVICE_PORT \
GNOCCHI_ARCHIVE_POLICY \
GNOCCHI_STORAGE_BACKEND \
GNOCCHI_KEYSTONE_USER \
GNOCCHI_ADMIN_PASSWORD \
GNOCCHI_API_SERVICE_HOST
fail_unless_os_service_running keystone
fail_unless_db
mysql -h ${MARIADB_SERVICE_HOST} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS ${GNOCCHI_DB_NAME} DEFAULT CHARACTER SET utf8;
GRANT ALL PRIVILEGES ON ${GNOCCHI_DB_NAME}.* TO
'${GNOCCHI_DB_USER}'@'%' IDENTIFIED BY '${GNOCCHI_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 ${GNOCCHI_KEYSTONE_USER} \
-p ${GNOCCHI_ADMIN_PASSWORD} \
-t ${ADMIN_TENANT_NAME} \
-r service
crux service-create -n ${GNOCCHI_KEYSTONE_USER} -t "metric" \
-d "OpenStack Metric Service"
crux endpoint-create i--remove-all -n ${GNOCCHI_KEYSTONE_USER} -t metric \
-I "${GNOCCHI_SERVICE_PROTOCOL}://${GNOCCHI_API_SERVICE_HOST}:${GNOCCHI_SERVICE_PORT}" \
-P "${GNOCCHI_SERVICE_PROTOCOL}://${GNOCCHI_API_SERVICE_HOST}:${GNOCCHI_SERVICE_PORT}" \
-A "${GNOCCHI_SERVICE_PROTOCOL}://${GNOCCHI_API_SERVICE_HOST}:${GNOCCHI_SERVICE_PORT}"
exec /usr/bin/gnocchi-api
#!/bin/bash
set -o errexit
CMD="/usr/bin/gnocchi-api"
ARGS=""
# Loading common functions.
source /opt/kolla/kolla-common.sh
# Config-internal script exec out of this function, it does not return here.
set_configs
# 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
su -s /bin/sh -c "gnocchi-manage db_sync" gnocchi
exit 0
fi
exec $CMD $ARGS
#!/bin/bash
set -e
. /opt/kolla/kolla-common.sh
check_required_vars KEYSTONE_ADMIN_TOKEN KEYSTONE_ADMIN_SERVICE_HOST \
KEYSTONE_ADMIN_SERVICE_PORT KEYSTONE_PUBLIC_SERVICE_HOST \
GNOCCHI_STORAGE_BACKEND GNOCCHI_DATA_DIR GNOCCHI_SERVICE_PORT
dump_vars
cat > /openrc <<EOF
export SERVICE_TOKEN="${KEYSTONE_ADMIN_TOKEN}"
export SERVICE_ENDPOINT="${KEYSTONE_AUTH_PROTOCOL}://${KEYSTONE_ADMIN_SERVICE_HOST}:${KEYSTONE_ADMIN_SERVICE_PORT}/v2.0"
EOF
cfg=/etc/gnocchi/gnocchi.conf
crudini --set $cfg \
storage driver "$GNOCCHI_STORAGE_BACKEND"
crudini --set $cfg \
storage file_basepath "$GNOCCHI_DATA_DIR"
crudini --set $cfg \
indexer url "mysql://$GNOCCHI_DB_USER:$GNOCCHI_DB_PASSWORD@$MARIADB_SERVICE_HOST/$GNOCCHI_DB_NAME?charset=utf8"
#!/bin/bash
SOURCE="/opt/kolla/gnocchi-api/gnocchi-api.conf"
TARGET="/etc/gnocchi/gnocchi-api.conf"
OWNER="gnocchi"
if [[ -f "$SOURCE" ]]; then
cp $SOURCE $TARGET
chown ${OWNER}: $TARGET
chmod 0644 $TARGET
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment