Permalink
Browse files

Formatting cleanups, doc updates and whatnot

Change-Id: Ica8298353be22f947c8e8a03d8dc29ded9cb26dd
  • Loading branch information...
1 parent 2e75ff1 commit cc6b4435458b5db6aed17631e4789c43d21ee8e5 @dtroyer dtroyer committed Apr 8, 2013
Showing with 145 additions and 75 deletions.
  1. +15 −6 HACKING.rst
  2. +4 −2 README.md
  3. +4 −4 exercise.sh
  4. +7 −6 exercises/client-args.sh
  5. +7 −6 exercises/client-env.sh
  6. +3 −3 functions
  7. +1 −0 lib/baremetal
  8. +7 −2 lib/ceilometer
  9. +5 −0 lib/cinder
  10. +9 −1 lib/database
  11. +6 −0 lib/databases/mysql
  12. +6 −0 lib/databases/postgresql
  13. +3 −2 lib/glance
  14. +7 −1 lib/heat
  15. +4 −0 lib/horizon
  16. +2 −2 lib/keystone
  17. +7 −3 lib/ldap
  18. +5 −4 lib/nova
  19. +5 −4 lib/quantum
  20. +4 −2 lib/rpc_backend
  21. +2 −2 lib/swift
  22. +3 −2 lib/tempest
  23. +4 −0 lib/tls
  24. +24 −22 stack.sh
  25. +1 −1 stackrc
View
@@ -7,8 +7,8 @@ General
DevStack is written in POSIX shell script. This choice was made because
it best illustrates the configuration steps that this implementation takes
-on setting up and interacting with OpenStack components. DevStack specifies
-BASH and is compatible with Bash 3.
+on setting up and interacting with OpenStack components. DevStack specifically
+uses Bash and is compatible with Bash 3.
DevStack's official repository is located on GitHub at
https://github.com/openstack-dev/devstack.git. Besides the master branch that
@@ -30,9 +30,17 @@ work for DevStack's use cases. There is a subscript ``functions`` that contains
generally useful shell functions and is used by a number of the scripts in
DevStack.
+The ``lib`` directory contains sub-scripts for projects or packages that ``stack.sh``
+sources to perform much of the work related to those projects. These sub-scripts
+contain configuration defaults and functions to configure, start and stop the project
+or package. These variables and functions are also used by related projects,
+such as Grenade, to manage a DevStack installation.
+
A number of additional scripts can be found in the ``tools`` directory that may
-be useful in setting up special-case uses of DevStack. These include: bare metal
-deployment, ramdisk deployment and Jenkins integration.
+be useful in supporting DevStack installations. Of particular note are ``info.sh``
+to collect and report information about the installed system, and ``instal_prereqs.sh``
+that handles installation of the prerequisite packages for DevStack. It is
+suitable, for example, to pre-load a system for making a snapshot.
Scripts
@@ -63,8 +71,8 @@ configuration of the user environment::
source $TOP_DIR/openrc
``stack.sh`` is a rather large monolithic script that flows through from beginning
-to end. The process of breaking it down into project-level sub-scripts is nearly
-complete and should make ``stack.sh`` easier to read and manage.
+to end. It has been broken down into project-specific subscripts (as noted above)
+located in ``lib`` to make ``stack.sh`` more manageable and to promote code reuse.
These library sub-scripts have a number of fixed entry points, some of which may
just be stubs. These entry points will be called by ``stack.sh`` in the
@@ -112,6 +120,7 @@ Also, variable declarations in ``stackrc`` do NOT allow overriding (the form
``FOO=${FOO:-baz}``); if they did then they can already be changed in ``localrc``
and can stay in the project file.
+
Documentation
-------------
View
@@ -120,14 +120,16 @@ In order to enable Quantum a single node setup, you'll need the following settin
# Optional, to enable tempest configuration as part of devstack
enable_service tempest
-Then run stack.sh as normal.
+Then run `stack.sh` as normal.
+
+# Tempest
If tempest has been successfully configured, a basic set of smoke tests can be run as follows:
$ cd /opt/stack/tempest
$ nosetests tempest/tests/network/test_network_basic_ops.py
-Multi-Node Setup
+# Multi-Node Setup
A more interesting setup involves running multiple compute nodes, with Quantum networks connecting VMs on different compute nodes.
You should run at least one "controller node", which should have a `stackrc` that includes at least:
View
@@ -23,7 +23,7 @@ basenames=${RUN_EXERCISES:-""}
EXERCISE_DIR=$TOP_DIR/exercises
-if [ -z "${basenames}" ] ; then
+if [[ -z "${basenames}" ]]; then
# Locate the scripts we should run
basenames=$(for b in `ls $EXERCISE_DIR/*.sh`; do basename $b .sh; done)
else
@@ -38,7 +38,7 @@ skips=""
# Loop over each possible script (by basename)
for script in $basenames; do
- if [[ ,$SKIP_EXERCISES, =~ ,$script, ]] ; then
+ if [[ ,$SKIP_EXERCISES, =~ ,$script, ]]; then
skips="$skips $script"
else
echo "====================================================================="
@@ -48,7 +48,7 @@ for script in $basenames; do
exitcode=$?
if [[ $exitcode == 55 ]]; then
skips="$skips $script"
- elif [[ $exitcode -ne 0 ]] ; then
+ elif [[ $exitcode -ne 0 ]]; then
failures="$failures $script"
else
passes="$passes $script"
@@ -69,6 +69,6 @@ for script in $failures; do
done
echo "====================================================================="
-if [ -n "$failures" ] ; then
+if [[ -n "$failures" ]]; then
exit 1
fi
@@ -67,7 +67,7 @@ RETURN=0
# Keystone client
# ---------------
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "key" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "key" ]]; then
STATUS_KEYSTONE="Skipped"
else
echo -e "\nTest Keystone"
@@ -84,7 +84,7 @@ fi
# -----------
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "n-api" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "n-api" ]]; then
STATUS_NOVA="Skipped"
STATUS_EC2="Skipped"
else
@@ -103,7 +103,7 @@ fi
# -------------
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "c-api" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "c-api" ]]; then
STATUS_CINDER="Skipped"
else
echo -e "\nTest Cinder"
@@ -120,7 +120,7 @@ fi
# -------------
if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "g-api" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "g-api" ]]; then
STATUS_GLANCE="Skipped"
else
echo -e "\nTest Glance"
@@ -137,7 +137,7 @@ fi
# ------------
if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "swift" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "swift" ]]; then
STATUS_SWIFT="Skipped"
else
echo -e "\nTest Swift"
@@ -152,8 +152,9 @@ fi
set +o xtrace
+
# Results
-# -------
+# =======
function report() {
if [[ -n "$2" ]]; then
@@ -60,7 +60,7 @@ RETURN=0
# Keystone client
# ---------------
if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "key" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "key" ]]; then
STATUS_KEYSTONE="Skipped"
else
echo -e "\nTest Keystone"
@@ -77,7 +77,7 @@ fi
# -----------
if [[ "$ENABLED_SERVICES" =~ "n-api" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "n-api" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "n-api" ]]; then
STATUS_NOVA="Skipped"
STATUS_EC2="Skipped"
else
@@ -111,7 +111,7 @@ fi
# -------------
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "c-api" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "c-api" ]]; then
STATUS_CINDER="Skipped"
else
echo -e "\nTest Cinder"
@@ -128,7 +128,7 @@ fi
# -------------
if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "g-api" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "g-api" ]]; then
STATUS_GLANCE="Skipped"
else
echo -e "\nTest Glance"
@@ -146,7 +146,7 @@ fi
if [[ "$ENABLED_SERVICES" =~ "swift" || "$ENABLED_SERVICES" =~ "s-proxy" ]]; then
- if [[ "$SKIP_EXERCISES" =~ "swift" ]] ; then
+ if [[ "$SKIP_EXERCISES" =~ "swift" ]]; then
STATUS_SWIFT="Skipped"
else
echo -e "\nTest Swift"
@@ -161,8 +161,9 @@ fi
set +o xtrace
+
# Results
-# -------
+# =======
function report() {
if [[ -n "$2" ]]; then
View
@@ -830,7 +830,7 @@ function pip_install {
if [[ -z "$os_PACKAGE" ]]; then
GetOSVersion
fi
- if [[ $TRACK_DEPENDS = True ]] ; then
+ if [[ $TRACK_DEPENDS = True ]]; then
source $DEST/.venv/bin/activate
CMD_PIP=$DEST/.venv/bin/pip
SUDO_PIP="env"
@@ -1005,7 +1005,7 @@ function service_check() {
# Uses globals ``TRACK_DEPENDES``, ``*_proxy`
# setup_develop directory
function setup_develop() {
- if [[ $TRACK_DEPENDS = True ]] ; then
+ if [[ $TRACK_DEPENDS = True ]]; then
SUDO_CMD="env"
else
SUDO_CMD="sudo"
@@ -1288,7 +1288,7 @@ function _ssh_check_novanet() {
local DEFAULT_INSTANCE_USER=$4
local ACTIVE_TIMEOUT=$5
local probe_cmd=""
- if ! timeout $ACTIVE_TIMEOUT sh -c "while ! ssh -o StrictHostKeyChecking=no -i $KEY_FILE ${DEFAULT_INSTANCE_USER}@$FLOATING_IP echo success ; do sleep 1; done"; then
+ if ! timeout $ACTIVE_TIMEOUT sh -c "while ! ssh -o StrictHostKeyChecking=no -i $KEY_FILE ${DEFAULT_INSTANCE_USER}@$FLOATING_IP echo success; do sleep 1; done"; then
die $LINENO "server didn't become ssh-able!"
fi
}
View
@@ -53,6 +53,7 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
# Sub-driver settings
# -------------------
View
@@ -37,12 +37,16 @@ CEILOMETER_API_LOG_DIR=/var/log/ceilometer-api
CEILOMETER_AUTH_CACHE_DIR=${CEILOMETER_AUTH_CACHE_DIR:-/var/cache/ceilometer}
# Support potential entry-points console scripts
-if [ -d $CEILOMETER_DIR/bin ] ; then
+if [[ -d $CEILOMETER_DIR/bin ]]; then
CEILOMETER_BIN_DIR=$CEILOMETER_DIR/bin
else
CEILOMETER_BIN_DIR=$(get_python_exec_prefix)
fi
+
+# Functions
+# ---------
+
# cleanup_ceilometer() - Remove residual data files, anything left over from previous
# runs that a clean run would need to clean up
function cleanup_ceilometer() {
@@ -93,7 +97,7 @@ function configure_ceilometer() {
}
function configure_mongodb() {
- if is_fedora ; then
+ if is_fedora; then
# ensure smallfiles selected to minimize freespace requirements
sudo sed -i '/--smallfiles/!s/OPTIONS=\"/OPTIONS=\"--smallfiles /' /etc/sysconfig/mongod
@@ -135,6 +139,7 @@ function stop_ceilometer() {
done
}
+
# Restore xtrace
$XTRACE
View
@@ -64,6 +64,10 @@ VOLUME_GROUP=${VOLUME_GROUP:-stack-volumes}
VOLUME_GROUP2=${VOLUME_GROUP2:-stack-volumes2}
VOLUME_NAME_PREFIX=${VOLUME_NAME_PREFIX:-volume-}
+
+# Functions
+# ---------
+
# _clean_volume_group removes all cinder volumes from the specified volume group
# _clean_volume_group $VOLUME_GROUP $VOLUME_NAME_PREFIX
function _clean_volume_group() {
@@ -432,6 +436,7 @@ function stop_cinder() {
fi
}
+
# Restore xtrace
$XTRACE
View
@@ -20,14 +20,18 @@
XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
# Register a database backend
# $1 The name of the database backend
+# This is required to be defined before the specific database scripts are sourced
function register_database {
[ -z "$DATABASE_BACKENDS" ] && DATABASE_BACKENDS=$1 || DATABASE_BACKENDS+=" $1"
}
# Sourcing the database libs sets DATABASE_BACKENDS with the available list
-for f in $TOP_DIR/lib/databases/*; do source $f; done
+for f in $TOP_DIR/lib/databases/*; do
+ source $f;
+done
# ``DATABASE_BACKENDS`` now contains a list of the supported databases
# Look in ``ENABLED_SERVICES`` to see if one has been selected
@@ -42,6 +46,9 @@ done
# This is not an error as multi-node installs will do this on the compute nodes
+# Functions
+# ---------
+
# Get rid of everything enough to cleanly change database backends
function cleanup_database {
cleanup_database_$DATABASE_TYPE
@@ -112,6 +119,7 @@ function database_connection_url {
database_connection_url_$DATABASE_TYPE $var $db
}
+
# Restore xtrace
$XTRACE
View
@@ -8,8 +8,13 @@
MY_XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
register_database mysql
+
+# Functions
+# ---------
+
# Get rid of everything enough to cleanly change database backends
function cleanup_database_mysql {
if is_ubuntu; then
@@ -137,6 +142,7 @@ function database_connection_url_mysql {
echo "$BASE_SQL_CONN/$db?charset=utf8"
}
+
# Restore xtrace
$MY_XTRACE
@@ -8,8 +8,13 @@
PG_XTRACE=$(set +o | grep xtrace)
set +o xtrace
+
register_database postgresql
+
+# Functions
+# ---------
+
# Get rid of everything enough to cleanly change database backends
function cleanup_database_postgresql {
stop_service postgresql
@@ -88,6 +93,7 @@ function database_connection_url_postgresql {
echo "$BASE_SQL_CONN/$db?client_encoding=utf8"
}
+
# Restore xtrace
$PG_XTRACE
Oops, something went wrong.

0 comments on commit cc6b443

Please sign in to comment.