Have devstack plugin install Trove client

Using the Trove devstack plugin was dependent on having the
python-troveclient also enabled.  This change modifies the plugin.sh
file to install the client correctly, thus removing the need of
separately enabling a plugin for it.

Variables were set up in the devstack settings file, which can be
overridden as desired.

A README.rst file was added with instructions on how to set up the
plugin in devstack.

Change-Id: If5a76360249827c19759a5c90dc00f70c59c32cc
This commit is contained in:
Peter Stachowski 2015-07-30 20:12:26 +00:00
parent de608f2c94
commit 3557e2b181
3 changed files with 81 additions and 31 deletions

45
devstack/README.rst Normal file
View File

@ -0,0 +1,45 @@
===========================
Enabling Trove in DevStack
===========================
To enable Trove in DevStack, perform the following steps:
::
Note: The python-troveclient is automatically installed. If you need to
control how the client gets installed, set the TROVECLIENT_REPO,
TROVECLIENT_DIR and TROVECLIENT_BRANCH environment variables appropriately.
Download DevStack
=================
.. sourcecode:: bash
export DEVSTACK_DIR=~/devstack
git clone git://git.openstack.org/openstack-dev/devstack.git $DEVSTACK_DIR
Enable the Trove plugin
=======================
Enable the plugin by adding the following section to ``$DEVSTACK_DIR/local.conf``
.. sourcecode:: bash
[[local|localrc]]
enable_plugin trove git://git.openstack.org/openstack/trove
Optionally, a git refspec (branch or tag or commit) may be provided as follows:
.. sourcecode:: bash
[[local|localrc]]
enable_plugin trove git://git.openstack.org/openstack/trove <refspec>
Run the DevStack utility
========================
.. sourcecode:: bash
cd $DEVSTACK_DIR
./stack.sh

View File

@ -11,6 +11,7 @@
# ``stack.sh`` calls the entry points in this order:
#
# install_trove
# install_python_troveclient
# configure_trove
# init_trove
# start_trove
@ -145,19 +146,17 @@ function configure_trove {
setup_trove_logging $TROVE_GUESTAGENT_CONF
}
# install_troveclient() - Collect source and prepare
function install_troveclient {
# NOTE(sdague): this probably doesn't work correctly as a devstack
# plugin, and needs to be moved to the troveclient project instead
if use_library_from_git "python-troveclient"; then
git_clone_by_name "python-troveclient"
setup_dev_lib "python-troveclient"
fi
}
# install_trove() - Collect source and prepare
function install_trove {
:
setup_develop $TROVE_DIR
}
# install_python_troveclient() - Collect source and prepare
function install_python_troveclient {
if use_library_from_git "python-troveclient"; then
git_clone $TROVECLIENT_REPO $TROVECLIENT_DIR $TROVECLIENT_BRANCH
setup_develop $TROVECLIENT_DIR
fi
}
# init_trove() - Initializes Trove Database as a Service
@ -228,7 +227,7 @@ if is_service_enabled trove; then
if [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Trove"
install_trove
install_troveclient
install_python_troveclient
cleanup_trove
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Trove"

View File

@ -1,29 +1,35 @@
# settings needed for trove plugin
# Settings needed for Trove plugin
# --------------------------------
# Set up default directories
TROVE_DIR=${TROVE_DIR:-${DEST}/trove}
TROVECLIENT_DIR=${TROVECLIENT_DIR:-${DEST}/python-troveclient}
TROVECLIENT_REPO=${TROVECLIENT_REPO:-${GIT_BASE}/openstack/python-troveclient.git}
TROVECLIENT_BRANCH=${TROVECLIENT_BRANCH:-master}
# Set up configuration directory and files
TROVE_CONF_DIR=${TROVE_CONF_DIR:-/etc/trove}
TROVE_CONF=${TROVE_CONF:-${TROVE_CONF_DIR}/trove.conf}
TROVE_TASKMANAGER_CONF=${TROVE_TASKMANAGER_CONF:-${TROVE_CONF_DIR}/trove-taskmanager.conf}
TROVE_CONDUCTOR_CONF=${TROVE_CONDUCTOR_CONF:-${TROVE_CONF_DIR}/trove-conductor.conf}
TROVE_GUESTAGENT_CONF=${TROVE_GUESTAGENT_CONF:-${TROVE_CONF_DIR}/trove-guestagent.conf}
TROVE_API_PASTE_INI=${TROVE_API_PASTE_INI:-${TROVE_CONF_DIR}/api-paste.ini}
TROVE_LOCAL_CONF_DIR=${TROVE_LOCAL_CONF_DIR:-${TROVE_DIR}/etc/trove}
TROVE_LOCAL_API_PASTE_INI=${TROVE_LOCAL_API_PASTE_INI:-${TROVE_LOCAL_CONF_DIR}/api-paste.ini}
TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
TROVE_DATASTORE_TYPE=${TROVE_DATASTORE_TYPE:-"mysql"}
TROVE_DATASTORE_VERSION=${TROVE_DATASTORE_VERSION:-"5.6"}
TROVE_DATASTORE_PACKAGE=${TROVE_DATASTORE_PACKAGE:-"mysql-server-5.6"}
# Setup the host gateway
if is_service_enabled neutron; then
TROVE_HOST_GATEWAY=${PUBLIC_NETWORK_GATEWAY:-172.24.4.1}
else
TROVE_HOST_GATEWAY=${NETWORK_GATEWAY:-10.0.0.1}
fi
# Set up default configuration
GITDIR["python-troveclient"]=$DEST/python-troveclient
TROVE_DIR=$DEST/trove
TROVE_CONF_DIR=${TROVE_CONF_DIR:-/etc/trove}
TROVE_CONF=${TROVE_CONF:-$TROVE_CONF_DIR/trove.conf}
TROVE_TASKMANAGER_CONF=${TROVE_TASKMANAGER_CONF:-$TROVE_CONF_DIR/trove-taskmanager.conf}
TROVE_CONDUCTOR_CONF=${TROVE_CONDUCTOR_CONF:-$TROVE_CONF_DIR/trove-conductor.conf}
TROVE_GUESTAGENT_CONF=${TROVE_GUESTAGENT_CONF:-$TROVE_CONF_DIR/trove-guestagent.conf}
TROVE_API_PASTE_INI=${TROVE_API_PASTE_INI:-$TROVE_CONF_DIR/api-paste.ini}
TROVE_LOCAL_CONF_DIR=$TROVE_DIR/etc/trove
TROVE_LOCAL_API_PASTE_INI=$TROVE_LOCAL_CONF_DIR/api-paste.ini
TROVE_AUTH_CACHE_DIR=${TROVE_AUTH_CACHE_DIR:-/var/cache/trove}
TROVE_DATASTORE_TYPE=${TROVE_DATASTORE_TYPE:-"mysql"}
TROVE_DATASTORE_VERSION=${TROVE_DATASTORE_VERSION:-"5.6"}
TROVE_DATASTORE_PACKAGE=${TROVE_DATASTORE_PACKAGE:-"mysql-server-5.6"}
# Support entry points installation of console scripts
if [[ -d $TROVE_DIR/bin ]]; then
TROVE_BIN_DIR=$TROVE_DIR/bin