diff --git a/.gitignore b/.gitignore index 99e70ac..6e7e085 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ var sdist develop-eggs .installed.cfg -lib lib64 # Installer logs diff --git a/devstack/README.rst b/devstack/README.rst new file mode 100644 index 0000000..1a35e06 --- /dev/null +++ b/devstack/README.rst @@ -0,0 +1,18 @@ +================================== +Enabling OSprofiler using DevStack +================================== + +This directory contains the files necessary to run OpenStack with enabled +OSprofiler in DevStack. + +To configure DevStack to enable OSprofiler edit +``${DEVSTACK_DIR}/local.conf`` file and add:: + + enable_plugin ceilometer https://github.com/openstack/ceilometer master + enable_plugin osprofiler https://github.com/openstack/osprofiler master + +to the ``[[local|localrc]]`` section. + +Run DevStack as normal:: + + $ ./stack.sh diff --git a/devstack/lib/osprofiler b/devstack/lib/osprofiler new file mode 100644 index 0000000..850aa53 --- /dev/null +++ b/devstack/lib/osprofiler @@ -0,0 +1,82 @@ +# lib/rally +# Functions to control the configuration and operation of the **Rally** + +# Dependencies: +# +# - ``functions`` file +# - ``DEST``, ``DATA_DIR``, ``STACK_USER`` must be defined + +# ``stack.sh`` calls the entry points in this order: +# +# - install_osprofiler +# - configure_osprofiler +# - init_osprofiler + +# Save trace setting +XTRACE=$(set +o | grep xtrace) +set +o xtrace + + +# Defaults +# -------- + +OLD_STYLE_CONF_FILES=( + /etc/cinder/cinder.conf + /etc/heat/heat.conf +) + +NEW_STYLE_CONF_FILES=( + /etc/keystone/keystone.conf + /etc/nova/nova.conf + /etc/neutron/neutron.conf + /etc/glance/glance-api.conf + /etc/glance/glance-registry.conf + /etc/trove/trove.conf + /etc/trove/trove-conductor.conf + /etc/trove/trove-guestagent.conf + /etc/trove/trove-taskmanager.conf +) + +# This will update CEILOMETER_NOTIFICATION_TOPICS in ceilometer.conf file +export CEILOMETER_NOTIFICATION_TOPICS=notifications,profiler + + +# Functions +# --------- + +# configure_osprofiler() - Nothing for now +function configure_osprofiler() { + + for conf in ${OLD_STYLE_CONF_FILES[@]}; do + if [ -f $conf ] + then + iniset $conf profiler profiler_enabled True + iniset $conf profiler trace_sqlalchemy True + iniset $conf profiler hmac_keys SECRET_KEY + fi + done + + for conf in ${NEW_STYLE_CONF_FILES[@]}; do + if [ -f $conf ] + then + iniset $conf profiler enabled True + iniset $conf profiler trace_sqlalchemy True + iniset $conf profiler hmac_keys SECRET_KEY + fi + done +} + + +# init_rally() - Initialize databases, etc. +function init_osprofiler() { + + echo "Do nothing here for now" +} + +# Restore xtrace +$XTRACE + +# Tell emacs to use shell-script-mode +## Local variables: +## mode: shell-script +## End: diff --git a/devstack/plugin.sh b/devstack/plugin.sh new file mode 100644 index 0000000..303b605 --- /dev/null +++ b/devstack/plugin.sh @@ -0,0 +1,24 @@ +# DevStack extras script to install Rally + +# Save trace setting +XTRACE=$(set +o | grep xtrace) +set -o xtrace + +source $DEST/osprofiler/devstack/lib/osprofiler + +if [[ "$1" == "source" ]]; then + # Initial source + source $TOP_DIR/lib/rally +# elif [[ "$1" == "stack" && "$2" == "install" ]]; then +# echo_summary "Installing OSprofiler" +# install_rally +elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then + echo_summary "Configuring OSprofiler" + configure_osprofiler +elif [[ "$1" == "stack" && "$2" == "extra" ]]; then + echo_summary "Initializing OSprofiler" + init_osprofiler +fi + +# Restore xtrace +$XTRACE diff --git a/devstack/settings b/devstack/settings new file mode 100644 index 0000000..dc01705 --- /dev/null +++ b/devstack/settings @@ -0,0 +1,3 @@ +# Devstack settings + +enable_service osprofiler diff --git a/doc/specs/in-progress/better_devstack_integration.rst b/doc/specs/in-progress/better_devstack_integration.rst index 7e4e264..199436d 100644 --- a/doc/specs/in-progress/better_devstack_integration.rst +++ b/doc/specs/in-progress/better_devstack_integration.rst @@ -44,13 +44,17 @@ Assignee(s) ----------- Primary assignee: - + boris-42 Work Items ---------- -- Make patch in DevStack +- Make DevStack plugin for OSprofiler + +- Configure Celiometer + +- Configure services that support OSprofiler Dependencies