convert devstack support to external plugin

This uses the defined external plugin interface for devstack to run
the ec2-api service.

Change-Id: I1d7507c904dc0df452049433ceac34793595176f
This commit is contained in:
Sean Dague 2015-02-05 07:24:47 -05:00
parent 1cfaea6bed
commit 91fb27b217
5 changed files with 36 additions and 50 deletions

View File

@ -1,20 +0,0 @@
1. Follow Devstack documentation to setup a host for Devstack. Then clone
Devstack source code.
2. Copy ec2-api integration scripts to Devstack::
$ cp lib/ec2-api ${DEVSTACK_DIR}/lib
$ cp extras.d/70-ec2-api.sh ${DEVSTACK_DIR}/extras.d
3. Create a ``localrc`` file as input to devstack.
4. The ec2-api services are not enabled by default, so they must be
enabled in ``localrc`` before running ``stack.sh``. This example ``localrc``
file shows all of the settings required for ec2-api::
# Enable ec2-api
enable_service ec2-api
5. Deploy your OpenStack Cloud with ec2-api::
$ ./stack.sh

View File

@ -1,24 +0,0 @@
# ec2-api.sh - DevStack extras script to install ec2-api
if is_service_enabled ec2-api; then
if [[ "$1" == "source" ]]; then
# Initial source
source $TOP_DIR/lib/ec2-api
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing ec2-api"
install_ec2api
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring ec2-api"
configure_ec2api
create_ec2api_accounts
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing ec2-api"
init_ec2api
start_ec2api
fi
if [[ "$1" == "unstack" ]]; then
stop_ec2api
cleanup_ec2api
fi
fi

13
devstack/README.rst Normal file
View File

@ -0,0 +1,13 @@
======================
Enabling in Devstack
======================
1. Download DevStack
2. Add this repo as an external repository::
> cat local.conf
[[local|localrc]]
enable_plugin ec2-api https://github.com/stackforge/ec2-api
3. run ``stack.sh``

25
contrib/devstack/lib/ec2-api → devstack/plugin.sh Normal file → Executable file
View File

@ -20,10 +20,6 @@ set -o xtrace
# Defaults
# --------
# Set up default repos
EC2API_REPO=${EC2API_REPO:-${GIT_BASE}/stackforge/ec2-api.git}
EC2API_BRANCH=${EC2API_BRANCH:-master}
# Set up default directories
EC2API_DIR=$DEST/ec2-api
EC2API_CONF_DIR=${EC2API_CONF_DIR:-/etc/ec2api}
@ -211,8 +207,6 @@ function init_ec2api() {
# install_ec2api() - Collect source and prepare
function install_ec2api() {
git_clone $EC2API_REPO $EC2API_DIR $EC2API_BRANCH
# TODO(ruhe): use setup_develop once ec2api requirements match with global-requirement.txt
# both functions (setup_develop and setup_package) are defined at:
# http://git.openstack.org/cgit/openstack-dev/devstack/tree/functions-common
@ -238,6 +232,25 @@ function cleanup_ec2api() {
sudo rm -rf $EC2API_KEYSTONE_SIGNING_DIR
}
# main dispatcher
if [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing ec2-api"
install_ec2api
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring ec2-api"
configure_ec2api
create_ec2api_accounts
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing ec2-api"
init_ec2api
start_ec2api
fi
if [[ "$1" == "unstack" ]]; then
stop_ec2api
cleanup_ec2api
fi
# Restore xtrace
$XTRACE

4
devstack/settings Normal file
View File

@ -0,0 +1,4 @@
# Devstack settings
# we have to add ec2-api to enabled services for screen_it to work
enable_service ec2-api