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 195 lines (155 sloc) 5.346 kB
#!/bin/bash
echo "home directory in use is $HOME"
bkdate=`date +%s`
work_dir=$1
if [ "X$work_dir" == "X" ]; then
echo "You must provide a base install directory"
exit 1
fi
if [ -e $HOME/.ssh ]; then
echo "this will destroy your .ssh dir! please back it up first"
exit 1
fi
if [ -e $HOME/.globus ]; then
echo "this will destroy your .globus dir! please back it up first"
exit 1
fi
if [ -e $HOME/.nimbus ]; then
echo "this will destroy your .nimbus dir! please back it up first"
exit 1
fi
if [ -e $HOME/.s3cfg ]; then
echo "this will destroy your .s3cfg file! please back it up first"
exit 1
fi
mkdir $HOME/.ssh
mkdir $HOME/.globus
mkdir $HOME/.nimbus
chmod 700 $HOME/.ssh
chmod 700 $HOME/.globus
chmod 700 $HOME/.nimbus
bd=`dirname $0`
cd $bd
src_dir=`pwd`
repo_dir="$work_dir/src"
mkdir $repo_dir
cd $repo_dir
repo="git://github.com/nimbusproject/nimbus.git"
if [ "X$NIMBUS_REPO" != "X" ]; then
repo=$NIMBUS_REPO
fi
echo "Checking out nimbus from $repo"
git clone --depth 1 $repo
install_dir=$work_dir/NIMBUSINSTALL
cd nimbus/
echo "========================================="
echo "Installing nimbus"
echo "========================================="
python $src_dir/install-nim.py ./install $install_dir "$work_dir/install.log"
rc=$?
if [ $rc -ne 0 ]; then
ls -l $src_dir/install-nim.py
ls -l
echo "nimbus install failed"
exit 1
fi
echo "========================================="
echo "Configuring propagation only mode"
echo "========================================="
ls -l $HOME/.ssh/
new_key=$HOME/.ssh/id_rsa
python $src_dir/ssh.py $new_key
rc=$?
ls -l $HOME/.ssh/
if [ $rc -ne 0 ]; then
echo "failed to make the ssh key"
exit 1
fi
user=`whoami`
echo "Attempting to ssh"
ssh localhost hostname
rc=$?
echo "ssh return code $rc"
export NIMBUS_WORKSPACE_CONTROL_HOME="$work_dir/control"
cp -r $repo_dir/nimbus/control/ $work_dir
sed -e "s^@NIMBUS_WORKSPACE_CONTROL_HOME@^$NIMBUS_WORKSPACE_CONTROL_HOME^" -e "s^@KEY@^$new_key^" -e "s/@WHO@/$user/" $src_dir/autoconfig-decisions.sh.in > $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh
cat $install_dir/services/share/nimbus-autoconfig/autoconfig-decisions.sh
$install_dir/services/share/nimbus-autoconfig/autoconfig-adjustments.sh
cd $work_dir/control
bash ./src/propagate-only-mode.sh
echo "========================================="
echo "Making cloud client"
echo "========================================="
cd $repo_dir/nimbus/cloud-client
bash ./builder/get-wscore.sh
bash ./builder/dist.sh
cd $work_dir
tar -zxvf $repo_dir/nimbus/cloud-client/nimbus-cloud-client*.tar.gz
cd nimbus-cloud-client*
./bin/cloud-client.sh --help
export CLOUD_CLIENT_HOME=`pwd`
echo "========================================="
echo "Making a common user"
echo "========================================="
user_name="nimbus@$RANDOM"
user_stuff=`$install_dir/bin/nimbus-new-user --group 04 --batch -r cloud_properties,cert,key,access_id,access_secret $user_name`
aid=`echo $user_stuff | awk -F , '{ print $4 }'`
apw=`echo $user_stuff | awk -F , '{ print $5 }'`
sed -e "s^@ID@^$aid^" -e "s/@KEY@/$apw/" $src_dir/s3cfg.in > $HOME/.s3cfg
echo "========================================="
echo "Making a new user"
echo "========================================="
user_name="nimbus@$RANDOM"
user_stuff=`$install_dir/bin/nimbus-new-user --group 04 --batch -r cloud_properties,cert,key,access_id,access_secret $user_name`
echo $user_stuff
cp=`echo $user_stuff | awk -F , '{ print $1 }'`
cert=`echo $user_stuff | awk -F , '{ print $2 }'`
key=`echo $user_stuff | awk -F , '{ print $3 }'`
aid=`echo $user_stuff | awk -F , '{ print $4 }'`
apw=`echo $user_stuff | awk -F , '{ print $5 }'`
cat $HOME/.s3cfg
echo $cp
echo $cert
echo $key
cp $install_dir/var/ca/ca-certs/* lib/certs/
cp $cp conf/
mkdir $HOME/.nimbus
cp $cert $HOME/.nimbus/
cp $key $HOME/.nimbus/
cp -r $HOME/.nimbus $HOME/.globus
echo "reporitng contents of dot nimbus and globus"
ls -l $HOME/.nimbus/
ls -l $HOME/.globus/
./bin/grid-proxy-init.sh
echo "========================================="
echo "Setting up VMM and network pools"
echo "========================================="
$install_dir/bin/nimbusctl services start
if [ $? -ne 0 ]; then
echo "Starting Nimbus services failed"
exit 1
fi
sleep 3 # make sure it is really started, uhhhhh
$install_dir/bin/nimbus-nodes --add localhost --memory 10240
if [ $? -ne 0 ]; then
echo "Adding VMM node failed"
exit 1
fi
$install_dir/bin/nimbusctl services stop
if [ $? -ne 0 ]; then
echo "Stopping Nimbus services failed"
exit 1
fi
cp $src_dir/public $install_dir/services/etc/nimbus/workspace-service/network-pools/public
echo $work_dir
export NIMBUS_HOME=$install_dir
export NIMBUS_TEST_USER=$user_name
echo "Your test environment is:"
echo "NIMBUS_HOME: $NIMBUS_HOME"
echo "NIMBUS_TEST_USER: $NIMBUS_TEST_USER"
echo "CLOUD_CLIENT_HOME: $CLOUD_CLIENT_HOME"
echo "NIMBUS_WORKSPACE_CONTROL_HOME: $NIMBUS_WORKSPACE_CONTROL_HOME"
echo "export NIMBUS_HOME=$NIMBUS_HOME" > $src_dir/env.sh
echo "export NIMBUS_TEST_USER=$NIMBUS_TEST_USER" >> $src_dir/env.sh
echo "export CLOUD_CLIENT_HOME=$CLOUD_CLIENT_HOME" >> $src_dir/env.sh
echo "export NIMBUS_WORKSPACE_CONTROL_HOME=$NIMBUS_WORKSPACE_CONTROL_HOME" >> $src_dir/env.sh
Jump to Line
Something went wrong with that request. Please try again.