This seems the first solid working version of Distributed PPSS.

This commit is contained in:
Louwrentius 2009-02-28 16:39:32 +00:00
parent ea071bf827
commit a1ffaa5333
1 changed files with 15 additions and 9 deletions

View File

@ -356,6 +356,7 @@ do
-t ) -t )
TRANSFER_TO_SLAVE="1" TRANSFER_TO_SLAVE="1"
add_var_to_config TRANSFER_TO_SLAVE "$TRANSFER_TO_SLAVE" add_var_to_config TRANSFER_TO_SLAVE "$TRANSFER_TO_SLAVE"
shift 1
;; ;;
-u ) -u )
USER="$2" USER="$2"
@ -549,10 +550,8 @@ start_ppss_on_node () {
NODE="$1" NODE="$1"
#ssh $USER@$NODE cd $PPSS_HOME_DIR ; screen -S PPSS ./$0 node log INFO "Starting PPSS on node $NODE."
ssh $USER@$NODE "cd $PPSS_HOME_DIR ; screen -d -m -S PPSS ./ppss.sh node -config $CONFIG"
#ssh $USER@$NODE "cd $PPSS_HOME_DIR ; pwd ; screen -d -m -S PPSS ./ppss.sh node "$CMD" ; exit"
ssh $USER@$NODE "cd $PPSS_HOME_DIR ; hostname ; screen -d -m -S PPSS ./ppss.sh node -config $CONFIG"
} }
@ -717,9 +716,11 @@ download_item () {
log DEBUG "Transfering item $ITEM to local disk." log DEBUG "Transfering item $ITEM to local disk."
if [ "$SECURE_COPY" == "1" ] if [ "$SECURE_COPY" == "1" ]
then then
scp -q $SSH_OPTS $SSH_KEY $USER@$SSH_SERVER:$ITEM_WITH_PATH $PPSS_LOCAL_WORKDIR scp -q $SSH_OPTS $SSH_KEY $USER@$SSH_SERVER:"$ITEM_WITH_PATH" $PPSS_LOCAL_WORKDIR
log DEBUG "Exit code of transfer is $?"
else else
cp $ITEM_WITH_PATH $PPSS_LOCAL_WORKDIR cp "$ITEM_WITH_PATH" $PPSS_LOCAL_WORKDIR
log DEBUG "Exit code of transfer is $?"
fi fi
fi fi
} }
@ -766,7 +767,7 @@ lock_item () {
ITEM="$1" ITEM="$1"
LOCK_FILE_NAME=`echo $ITEM | sed s/^\\\.//g |sed s/^\\\.\\\.//g | sed s/\\\///g` LOCK_FILE_NAME=`echo $ITEM | sed s/^\\\.//g |sed s/^\\\.\\\.//g | sed s/\\\///g`
ITEM_LOCK_FILE="$ITEM_LOCK_DIR/$LOCK_FILE_NAME" ITEM_LOCK_FILE="$ITEM_LOCK_DIR/$LOCK_FILE_NAME"
log DEBUG "Trying to lock item $ITEM."
exec_cmd "mkdir $ITEM_LOCK_FILE >> /dev/null 2>&1" exec_cmd "mkdir $ITEM_LOCK_FILE >> /dev/null 2>&1"
ERROR="$?" ERROR="$?"
return "$ERROR" return "$ERROR"
@ -887,6 +888,7 @@ get_item () {
release_global_lock release_global_lock
get_item get_item
else else
log DEBUG "Got lock on $ITEM, processing."
release_global_lock release_global_lock
download_item "$ITEM" download_item "$ITEM"
return 0 return 0
@ -974,12 +976,16 @@ listen_for_job () {
# This starts an number of parallel workers based on the # of parallel jobs allowed. # This starts an number of parallel workers based on the # of parallel jobs allowed.
start_all_workers () { start_all_workers () {
if [ "$MAX_NO_OF_RUNNING_JOBS" == "1" ]
then
log INFO "Starting $MAX_NO_OF_RUNNING_JOBS worker."
else
log INFO "Starting $MAX_NO_OF_RUNNING_JOBS workers." log INFO "Starting $MAX_NO_OF_RUNNING_JOBS workers."
fi
i=0 i=0
while [ "$i" -lt "$MAX_NO_OF_RUNNING_JOBS" ] while [ "$i" -lt "$MAX_NO_OF_RUNNING_JOBS" ]
do do
log DEBUG "$FUNCNAME - NO OF WORKERS is $i"
start_single_worker start_single_worker
((i++)) ((i++))
done done