Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 245 lines (205 sloc) 7.755 kb
#!/bin/bash
FORCE_FRESH_INSTALL="yes"
START_DIR=`pwd`
NIMBUS_SRC_REL="`dirname $0`"
NIMBUS_SRC=`cd $NIMBUS_SRC_REL; pwd`
if [ "X$1" = "X" ]; then
echo ""
echo "Usage: $0 destination_dir"
echo " You must specify the destination directory."
echo ""
exit 1
fi
NIMBUS_REL_BASE_HOME="`dirname $1`"
NIMBUS_BASE_HOME=`cd $NIMBUS_REL_BASE_HOME; pwd`
if [ ! -e $NIMBUS_REL_BASE_HOME ]; then
echo "The parent directory for the installation path $1 must exist"
exit 1
fi
NIMBUS_INST_DIR=`basename $1`
NIMBUS_HOME="$NIMBUS_BASE_HOME/$NIMBUS_INST_DIR"
echo "NIMBUS_HOME $NIMBUS_HOME"
if [ "X$NIMBUS_ALLOW_ROOT_INSTALL" != "Xyes" ] && [ $EUID -eq 0 ]; then
echo ""
echo "It is not recommended to install or run Nimbus as root."
echo "If you insist, set the NIMBUS_ALLOW_ROOT_INSTALL environment variable to \"yes\""
echo ""
exit 1
fi
if [ -d $NIMBUS_HOME ] && [ "$(ls -A $NIMBUS_HOME)" ]; then
if [ $FORCE_FRESH_INSTALL = "yes" ]; then
echo ""
echo "The destination directory '$NIMBUS_HOME' exists and is not empty."
echo "It is not recommended to reinstall Nimbus into an existing install."
echo ""
echo "If you are making changes to the services, you can build and install those directly:"
echo " export GLOBUS_LOCATION=$NIMBUS_HOME/services"
echo " scripts/all-build-and-install.sh"
echo ""
echo "If you know what you are doing and want to reinstall, edit this script:"
echo " $0"
echo "and change FORCE_FRESH_INSTALL to \"no\""
echo ""
exit 1
fi
fi
if [ ! -d $NIMBUS_HOME ]; then
mkdir $NIMBUS_HOME
fi
# If the dir exists but is not writable, this will also trip that situation early/gracefully.
touch $NIMBUS_HOME/install.log
if [ $? -ne 0 ]; then
echo "ERROR: cannot write install log file: $NIMBUS_HOME/install.log"
exit 1
fi
# The install log contains the initial cumulus admin secrets
chmod 600 $NIMBUS_HOME/install.log
if [ $? -ne 0 ]; then
echo "ERROR: cannot chmod install log file: $NIMBUS_HOME/install.log"
exit 1
fi
if [ "X$PYTHON" = "X" ]; then
PYTHON_EXE=`which python`
else
PYTHON_EXE="$PYTHON"
fi
# returns 0 if Python 2.5+
$PYTHON_EXE -c "import sys; sys.exit(sys.version_info < (2,5))"
if [ $? -ne 0 ]; then
echo "ERROR: The central Nimbus node must have Python version 2.5 or later (VMM nodes can have 2.4+)."
exit 1
fi
echo ""
echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
echo "Making the Python virtual environment" | tee -a $NIMBUS_HOME/install.log
echo "-----------------------------------------------------------------" | tee -a $NIMBUS_HOME/install.log
echo ""
pyve_path=$NIMBUS_HOME/ve
echo "Installing from $NIMBUS_SRC"
cp $NIMBUS_SRC/cumulus/*.egg .
$PYTHON_EXE $NIMBUS_SRC/cumulus/virtualenv.py -p $PYTHON_EXE $pyve_path | tee -a $NIMBUS_HOME/install.log
if [ $PIPESTATUS -ne 0 ]; then
echo "ERROR: python virtualenv installation failed."
exit 1
fi
$NIMBUS_SRC/libexec/create-nimbus-home $NIMBUS_HOME 2>&1 | tee -a $NIMBUS_HOME/install.log
# need PIPESTATUS because tee is not the exit code this needs to check
if [ $PIPESTATUS -ne 0 ]; then
echo ""
exit 1
fi
CUMULUS_ENV="$NIMBUS_HOME/cumulus/env.sh"
if [ ! -f $CUMULUS_ENV ]; then
echo "Expected file to be created: $CUMULUS_ENV"
exit 1
fi
export NIMBUS_HOME
$NIMBUS_SRC/lantorrent/install.sh $NIMBUS_HOME/lantorrent | tee -a $NIMBUS_HOME/install.log
rc=$PIPESTATUS
if [ $rc -ne 0 ]; then
echo "lantorrent install failed"
exit $rc
fi
echo ""
echo "-----------------------------------------------------------------"
echo " Configuring installed services"
echo "-----------------------------------------------------------------"
CONFIG_SCRIPT="$NIMBUS_HOME/bin/nimbus-configure"
if [ ! -f $CONFIG_SCRIPT ]; then
echo "Configuration script could not be found: $CONFIG_SCRIPT"
exit 1
fi
vmm_cmd="Programmer. Error."
EXTRA_CONFIG_SCRIPT_ARGS=""
if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
echo ""
echo "Beginning the configuration with values from the old Nimbus installation: $PREVIOUS_NIMBUS_HOME_VALIDATED"
echo ""
oldnimbusconf=$PREVIOUS_NIMBUS_HOME_VALIDATED/nimbus-setup.conf
if [ ! -f $oldnimbusconf ]; then
echo "The old Nimbus installation does not have a configuration file, expecting to find: $oldnimbusconf"
exit 1
fi
cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf
if [ $? -ne 0 ]; then
echo "Could not copy the old configuration file: cp $oldnimbusconf $NIMBUS_HOME/nimbus-setup.conf"
exit 1
fi
EXTRA_CONFIG_SCRIPT_ARGS="--conf $NIMBUS_HOME/nimbus-setup.conf"
# We know that a fresh installation will have missing things specified in
# that conf file. Any relative path configuratoin in that previous conf
# file will be copied over here. Any absolute path will be noted but not
# touched.
$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-prev
if [ $? -ne 0 ]; then
echo ""
echo "Could not import something specified in the old configuration file: $oldnimbusconf"
exit 1
fi
old_vmmdir="$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus/workspace-service/vmm-pools"
vmm_cmd="$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-vmms $old_vmmdir"
fi
$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS
if [ $? -ne 0 ]; then
echo "Nimbus configuration script failed! You may try running it manually:"
echo " $CONFIG_SCRIPT"
echo "You can also run the script with debugging output:"
echo " $CONFIG_SCRIPT --debug"
exit 1
fi
$NIMBUS_SRC/libexec/configure-cumulus.sh "${@}" 2>&1 | tee -a $NIMBUS_HOME/install.log
# need PIPESTATUS because tee is not the exit code of interest
rc=$PIPESTATUS
if [ $rc -ne 0 ]; then
exit $rc
fi
if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
echo ""
$CONFIG_SCRIPT $EXTRA_CONFIG_SCRIPT_ARGS --import-cumulusdb
if [ $? -ne 0 ]; then
echo ""
echo "Could not import Cumulus DB from the old configuration file: $oldnimbusconf"
exit 1
fi
fi
echo ""
GUIDEURL=`$NIMBUS_HOME/bin/nimbus-version --guide`
if [ $? -ne 0 ]; then
GUIDEURL="Development mode: no guide url"
fi
echo ""
echo "-----------------------------------------------------------------"
echo " Nimbus installation succeeded!"
echo "-----------------------------------------------------------------"
echo ""
echo "Additional configuration may be necessary, refer to this URL for information:"
echo ""
echo " $GUIDEURL"
echo ""
echo "You can start/stop Nimbus services with the nimbusctl command. e.g:"
echo ""
echo " $NIMBUS_HOME/bin/nimbusctl start"
echo ""
if [ "X" != "X$PREVIOUS_NIMBUS_HOME_VALIDATED" ]; then
old_etc_dir=$PREVIOUS_NIMBUS_HOME_VALIDATED/services/etc/nimbus
new_etc_dir=$NIMBUS_HOME/services/etc/nimbus
echo "-----------------------------------------------------------------"
echo " ** Upgrade work still needed **"
echo "-----------------------------------------------------------------"
echo ""
echo "While key settings have been transferred from your old install,"
echo "you still need to do a manual confirmation and transfer of"
echo "customizations."
echo ""
echo "Run the following command to look for customizations:"
echo ""
echo " diff -u -r $old_etc_dir $new_etc_dir"
echo ""
echo "After using nimbusctl to start the services, use the following"
echo "command to import VMM configurations. This can only be done "
echo "with a running service:"
echo ""
echo " $vmm_cmd"
echo ""
fi
exit 0
Jump to Line
Something went wrong with that request. Please try again.