consolidate all target setup into prep-target

There were a remarkable number of scripts that we ran during the
target setup phase, that all boiled down to very small
activities.

 - upgrade-devstack - copied 1 file
 - upgrade-infra - cloned gr
 - upgrade-oslo - actually *did nothing* (now that we install
   libraries from pypi)

Consolidating them all into a unified prep-target makes understanding
what's happening on the target setup simpler.

Change-Id: I0a1a41714fd9749857ccfc0825414f331f44ec2a
This commit is contained in:
Sean Dague 2015-04-11 07:27:16 -04:00
parent 3e50570ebb
commit 0e9e26834c
6 changed files with 43 additions and 169 deletions

View File

@ -273,30 +273,11 @@ fi
# ========
if [[ "$RUN_TARGET" == "True" ]]; then
# Get target bits ready
echo_summary "Running prep-target"
# Get target devstack tree ready for services to be run from it,
# including trying to reuse any existing files we pulled during
# the base run.
echo_summary "Preparing the target devstack environment"
$GRENADE_DIR/prep-target
stop $STOP prep-target 210
# Upgrade DevStack
echo_summary "Running upgrade-devstack"
#$GRENADE_DIR/upgrade-devstack
stop $STOP upgrade-devstack 230
# Upgrade Infra
echo_summary "Running upgrade-infra"
$GRENADE_DIR/upgrade-infra || die $LINENO "Failure in upgrade-infra"
stop $STOP upgrade-infra 232
# Upgrade Oslo
echo_summary "Running upgrade-oslo"
$GRENADE_DIR/upgrade-oslo || die $LINENO "Failure in upgrade-oslo"
stop $STOP upgrade-oslo 235
# Start dstat
echo_summary "Running start-dstat"
$GRENADE_DIR/start-dstat
stop $STOP start-dstat 238
# upgrade all the projects in order
echo "Upgrade projects: $UPGRADE_PROJECTS"

View File

@ -7,6 +7,9 @@
# Keep track of the devstack directory
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
# Source params
source $GRENADE_DIR/grenaderc
# Import common functions
source $GRENADE_DIR/functions
@ -15,13 +18,9 @@ source $GRENADE_DIR/functions
# and ``DISTRO``
GetDistro
# Source params
source $GRENADE_DIR/grenaderc
# For debugging
set -o xtrace
# System Preparation
# ==================
@ -43,11 +42,16 @@ fi
source $TARGET_DEVSTACK_DIR/functions
source $TARGET_DEVSTACK_DIR/stackrc
# Set a reasonable statusbar
# Set a reasonable screen statusbar
SCREEN_HARDSTATUS=${SCREEN_HARDSTATUS:-'%{= .} %-Lw%{= .}%> %n%f %t*%{= .}%+Lw%< %-=%{g}(%{d}%H/%l%{g})'}
screen -r $SCREEN_NAME -X hardstatus alwayslastline "$SCREEN_HARDSTATUS"
# Prep the service check bits
# Set up needed directories
# =========================
#
# This ensures that we have a clean service status directory so that
# we know for sure if services are coming up / down when we expect
# them.
init_service_check
@ -79,3 +83,32 @@ fi
if [[ -n "$SCREEN_LOGDIR" ]]; then
mkdir -p $SCREEN_LOGDIR
fi
# Retain credentials
# ==================
# Preserve accrc files for future usage
cp -a $BASE_DEVSTACK_DIR/accrc $TARGET_DEVSTACK_DIR/accrc
# Set up requirements
# ===================
# Pull down the new global requirements repository
#
# FIXME: this also pulls in new pbr which is not really needed, we
# should separate that in the future.
source $TARGET_DEVSTACK_DIR/lib/infra
install_infra
# Start helper services
# =====================
# Start dstat if it's in the ENABLED_SERVICES list. We really want
# this running before any services start to see what's going on when
# they start up, especialy if there are failures.
source $TARGET_DEVSTACK_DIR/lib/dstat
start_dstat

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
# ``start-dstat``
# Keep track of the grenade directory
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $GRENADE_DIR/functions
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
# and ``DISTRO``
GetDistro
# Source params
source $GRENADE_DIR/grenaderc
# For debugging
set -o xtrace
# start dstat
# ============
cd $TARGET_DEVSTACK_DIR
source $TARGET_DEVSTACK_DIR/functions
source $TARGET_DEVSTACK_DIR/stackrc
source $TARGET_DEVSTACK_DIR/lib/dstat
start_dstat

View File

@ -1,47 +0,0 @@
#!/usr/bin/env bash
# ``upgrade-devstack``
# Keep track of the grenade directory
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $GRENADE_DIR/functions
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
# and ``DISTRO``
GetDistro
# Source params
source $GRENADE_DIR/grenaderc
# For debugging
set -o xtrace
# Upgrade DevStack
# ================
# calls upgrade-devstack for specific release
upgrade_project devstack $GRENADE_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
# Preserve accrc files for future usage
cp -a $BASE_DEVSTACK_DIR/accrc $TARGET_DEVSTACK_DIR/accrc
# Translate Services
# ------------------
#BASE_ENABLED_SERVICES=$(source $BASE_DEVSTACK_DIR/stackrc; echo $ENABLED_SERVICES)
#ENABLED_SERVICES=""
# NOOP for now!
# Write new config to target DevStack
#echo -e "\nENABLED_SERVICES=$ENABLED_SERVICES" >>$TARGET_DEVSTACK_DIR/localrc
# Handle Defaults Changes
# -----------------------
# NOOP for now!

View File

@ -1,30 +0,0 @@
#!/usr/bin/env bash
# ``upgrade-infra``
# Keep track of the grenade directory
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $GRENADE_DIR/functions
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
# and ``DISTRO``
GetDistro
# Source params
source $GRENADE_DIR/grenaderc
# For debugging
set -o xtrace
# Upgrade Infra
# ================
cd $TARGET_DEVSTACK_DIR
source $TARGET_DEVSTACK_DIR/functions
source $TARGET_DEVSTACK_DIR/stackrc
source $TARGET_DEVSTACK_DIR/lib/infra
install_infra

View File

@ -1,33 +0,0 @@
#!/usr/bin/env bash
# ``upgrade-oslo``
# Keep track of the grenade directory
GRENADE_DIR=$(cd $(dirname "$0") && pwd)
# Import common functions
source $GRENADE_DIR/functions
# Determine what system we are running on. This provides ``os_VENDOR``,
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
# and ``DISTRO``
GetDistro
# Source params
source $GRENADE_DIR/grenaderc
# For debugging
set -o xtrace
# Upgrade Oslo
# ================
cd $TARGET_DEVSTACK_DIR
source $TARGET_DEVSTACK_DIR/functions
source $TARGET_DEVSTACK_DIR/stackrc
source $TARGET_DEVSTACK_DIR/lib/oslo
# calls upgrade-oslo for specific release
upgrade_project oslo $GRENADE_DIR $BASE_DEVSTACK_BRANCH $TARGET_DEVSTACK_BRANCH
install_oslo