[gates] Convert Rally to the new Devstack plugin model

Switch Rally integration with Devstack to the new plugin model [1].
This allows to install Rally by one line in localrc, without
copying any files by hand. It also may make setting CI jobs easier.

[1] http://docs.openstack.org/developer/devstack/plugins.html

* Remove Sahara pluging from Rally gate job

Sahara was removed from default services that run DevStack in gates
We need to remove these scenarios from rally.yaml and add separate job
for Sahara

Depends-on: I845178bd51f2623fa56bb97f8bd5f2e4e7553613
Change-Id: Ia4e211dbf50d13068502c27c26cf5e3199542ce7
This commit is contained in:
Michal Rostecki 2015-06-09 17:45:44 +02:00 committed by Boris Pavlovic
parent 6cd18abe6a
commit edfd580b9e
7 changed files with 149 additions and 65 deletions

1
.gitignore vendored
View File

@ -17,6 +17,7 @@ sdist
develop-eggs
.installed.cfg
lib
!devstack/lib
lib64
# Installer logs

14
devstack/README.rst Normal file
View File

@ -0,0 +1,14 @@
===============================
Installing Rally using devstack
===============================
This directory contains the files necessary to integrate Rally with devstack.
To configure devstack to run rally::
$ cd ${DEVSTACK_DIR}
$ echo "enable_plugin rally https://github.com/openstack/rally master" >> localrc
Run devstack as normal::
$ ./stack.sh

103
devstack/lib/rally Normal file
View File

@ -0,0 +1,103 @@
# 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_rally
# - configure_rally
# - init_rally
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set +o xtrace
# Defaults
# --------
# Set up default directories
RALLY_DIR=$DEST/rally
RALLY_CONF_DIR=${RALLY_CONF_DIR:-/etc/rally}
RALLY_CONF_FILE=rally.conf
# Debug mode
RALLY_DEBUG=${RALLY_DEBUG:-False}
# Create deployment
RALLY_ADD_DEPLOYMENT=${RALLY_ADD_DEPLOYMENT:-"True"}
RALLY_ADD_DEPLOYMENT=$(trueorfalse True $RALLY_ADD_DEPLOYMENT)
# Functions
# ---------
# Creates a configuration file for the current deployment
# Uses the following variables:
#
# - ``ADMIN_PASSWORD``, ``KEYSTONE_SERVICE_PROTOCOL``,
# ``KEYSTONE_SERVICE_HOST``, ``KEYSTONE_SERVICE_PORT``,
# ``IDENTITY_API_VERSION`` - must be defined
#
# _create_deployment_config filename
function _create_deployment_config() {
cat >$1 <<EOF
{
"type": "ExistingCloud",
"auth_url": "$KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v$IDENTITY_API_VERSION",
"admin": {
"username": "admin",
"password": "$ADMIN_PASSWORD",
"tenant_name": "admin"
}
}
EOF
}
# install_rally() - Collect source and prepare
function install_rally() {
setup_develop $RALLY_DIR
}
# configure_rally() - Set config files, create data dirs, etc
function configure_rally() {
if [[ ! -d $RALLY_CONF_DIR ]]; then
sudo mkdir -p $RALLY_CONF_DIR
fi
sudo chown $STACK_USER $RALLY_CONF_DIR
# Copy over rally configuration file and configure common parameters.
cp $RALLY_DIR/etc/rally/rally.conf.sample $RALLY_CONF_DIR/$RALLY_CONF_FILE
iniset $RALLY_CONF_DIR/$RALLY_CONF_FILE DEFAULT debug $RALLY_DEBUG
iniset $RALLY_CONF_DIR/$RALLY_CONF_FILE database connection `database_connection_url rally`
iniset $RALLY_CONF_DIR/$RALLY_CONF_FILE DEFAULT use_syslog $SYSLOG
}
# init_rally() - Initialize databases, etc.
function init_rally() {
recreate_database rally utf8
# Recreate rally database
rally-manage --config-file $RALLY_CONF_DIR/$RALLY_CONF_FILE db recreate
# Add current DevStack deployment to Rally
if [ "$RALLY_ADD_DEPLOYMENT" = "True" ]; then
local tmpfile=$(mktemp)
_create_deployment_config $tmpfile
rally --config-file $RALLY_CONF_DIR/$RALLY_CONF_FILE deployment create --name devstack --filename $tmpfile
fi
}
# Restore xtrace
$XTRACE
# Tell emacs to use shell-script-mode
## Local variables:
## mode: shell-script
## End:

24
devstack/plugin.sh Normal file
View File

@ -0,0 +1,24 @@
# DevStack extras script to install Rally
# Save trace setting
XTRACE=$(set +o | grep xtrace)
set -o xtrace
source $DEST/rally/devstack/lib/rally
if [[ "$1" == "source" ]]; then
# Initial source
source $TOP_DIR/lib/rally
elif [[ "$1" == "stack" && "$2" == "install" ]]; then
echo_summary "Installing Rally"
install_rally
elif [[ "$1" == "stack" && "$2" == "post-config" ]]; then
echo_summary "Configuring Rally"
configure_rally
elif [[ "$1" == "stack" && "$2" == "extra" ]]; then
echo_summary "Initializing Rally"
init_rally
fi
# Restore xtrace
$XTRACE

3
devstack/settings Normal file
View File

@ -0,0 +1,3 @@
# Devstack settings
enable_service rally

View File

@ -590,37 +590,6 @@
sla:
failure_rate:
max: 0
-
args:
sleep: 0.01
runner:
type: "constant"
times: 1
concurrency: 1
context:
quotas:
nova:
instances: 200
cores: 200
ram: -1
floating_ips: 200
fixed_ips: 200
metadata_items: -1
injected_files: -1
injected_file_content_bytes: -1
injected_file_path_bytes: -1
key_pairs: 500
security_groups: 400
security_group_rules: 600
cinder:
gigabytes: -1
snapshots: -1
volumes: -1
sla:
failure_rate:
max: 0
-
args:
sleep: 0.01
@ -809,40 +778,6 @@
failure_rate:
max: 0
SaharaNodeGroupTemplates.create_and_list_node_group_templates:
-
args:
flavor:
name: "m1.small"
runner:
type: "constant"
times: 20
concurrency: 20
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
SaharaNodeGroupTemplates.create_delete_node_group_templates:
-
args:
flavor:
name: "m1.small"
runner:
type: "constant"
times: 20
concurrency: 20
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
Authenticate.validate_glance:
-
args:

View File

@ -21,6 +21,10 @@ if [ ! -d $RALLY_JOB_DIR ]; then
RALLY_JOB_DIR=$BASE/new/$PROJECT/rally-jobs
fi
echo $RALLY_JOB_DIR
echo $RALLY_DIR
ls $BASE/new/$PROJECT
BASE_FOR_TASK=${RALLY_JOB_DIR}/${RALLY_SCENARIO}
TASK=${BASE_FOR_TASK}.yaml