[Swift-commit] r5325 - in branches/release-0.93: bin etc

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Wed Nov 30 14:32:25 CST 2011


Author: wozniak
Date: 2011-11-30 14:32:25 -0600 (Wed, 30 Nov 2011)
New Revision: 5325

Modified:
   branches/release-0.93/bin/start-coaster-service
   branches/release-0.93/etc/coaster-service.conf
Log:
Multiple minor fixes to start-coaster-service for EC2


Modified: branches/release-0.93/bin/start-coaster-service
===================================================================
--- branches/release-0.93/bin/start-coaster-service	2011-11-29 21:20:57 UTC (rev 5324)
+++ branches/release-0.93/bin/start-coaster-service	2011-11-30 20:32:25 UTC (rev 5325)
@@ -41,16 +41,16 @@
       fi
 
       # Copy and start worker script
-      scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_WORK > /dev/null 2>&1
+      scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_LOCATION > /dev/null 2>&1
       echo "Starting worker on $MACHINE"
-      ssh $WORKER_USERNAME@$MACHINE "$WORKER_WORK/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
-      echo $! >> $PID_FILE 
+      ssh $WORKER_USERNAME@$MACHINE "$WORKER_LOCATION/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
+      echo $! >> $PID_FILE
    done
 }
 
 # Start SSH workers
 start-workers-ssh()
-{ 
+{
    PORT=$1
    EXECUTION_URL=http://$IPADDR:$PORT
    if [ -z "$PORT" ]; then
@@ -71,17 +71,17 @@
 
       # Use a relay host
       if [ -n "$WORKER_RELAY_HOST" ]; then
-         ssh $WORKER_USERNAME@$WORKER_RELAY_HOST ssh $MACHINE mkdir -p $WORKER_WORK > /dev/null 2>&1
-         ssh $WORKER_USERNAME@$WORKER_RELAY_HOST "scp /tmp/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_WORK" > /dev/null 2>&1
+         ssh $WORKER_USERNAME@$WORKER_RELAY_HOST ssh $MACHINE mkdir -p $WORKER_LOCATION > /dev/null 2>&1
+         ssh $WORKER_USERNAME@$WORKER_RELAY_HOST "scp /tmp/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_LOCATION" > /dev/null 2>&1
          echo Starting worker on $MACHINE
-         ssh $WORKER_USERNAME@$WORKER_RELAY_HOST ssh $WORKER_USERNAME@$MACHINE "WORKER_LOGGING_LEVEL=$WORKER_LOGGING_LEVEL $WORKER_WORK/$WORKER $EXECUTION_URL $MACHINE $WORKER_LOG_DIR" &
+         ssh $WORKER_USERNAME@$WORKER_RELAY_HOST ssh $WORKER_USERNAME@$MACHINE "WORKER_LOGGING_LEVEL=$WORKER_LOGGING_LEVEL $WORKER_LOCATION/$WORKER $EXECUTION_URL $MACHINE $WORKER_LOG_DIR" &
          echo $! >> $PID_FILE
       # Connect directly
-      else  
-         ssh $WORKER_USERNAME@$MACHINE mkdir -p $WORKER_WORK > /dev/null 2>&1
-         scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_WORK > /dev/null 2>&1
+      else
+         ssh $WORKER_USERNAME@$MACHINE mkdir -p $WORKER_LOCATION > /dev/null 2>&1
+         scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_LOCATION > /dev/null 2>&1
          echo Starting worker on $MACHINE
-         ssh $WORKER_USERNAME@$MACHINE "$WORKER_WORK/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
+         ssh $WORKER_USERNAME@$MACHINE "$WORKER_LOCATION/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
          echo $! >> $PID_FILE
       fi
    done
@@ -89,7 +89,7 @@
 }
 
 # Start local workers
-start-workers-local() 
+start-workers-local()
 {
    PORT=$1
    EXECUTION_URL=http://$IPADDR:$PORT
@@ -145,16 +145,22 @@
    crash "Cannot find coaster-service.conf!"
 fi
 
+echo "start-coaster-service..."
+echo "configuration: $CONFIG_FILE"
+
 source $CONFIG_FILE
 
-# Determine information needed about this machine
+# Determine IP address to which workers should connect
 if [ -z "$IPADDR" ]; then
-   if [ -x "/sbin/ifconfig" ]; then
+   if [ "$SSH_TUNNELING" == "yes" ]; then
+      IPADDR=localhost
+   elif [ -x "/sbin/ifconfig" ]; then
       IPADDR=$( /sbin/ifconfig | grep 'inet addr' | grep -v 127.0.0.1 | cut -d ':' -f 2 | awk '{print $1}' |head -1)
    else
       crash "Unable to determine IP address of system. Please add to coaster-service.conf"
    fi
 fi
+echo Service address: $IPADDR
 
 # Find swift
 if [ ! -x "$SWIFT" ]; then
@@ -208,7 +214,7 @@
    $SWIFT_BIN/coaster-service -nosec -portfile $SERVICE_PORT_FILE --localport $LOCAL_PORT -passive > $COASTER_LOG 2>&1 &
 elif [ -n  "$SERVICE_PORT" ] && [ -n "$LOCAL_PORT" ]; then
    $SWIFT_BIN/coaster-service -nosec -port $SERVICE_PORT -localport $LOCAL_PORT -passive > $COASTER_LOG 2>&1 &
-else 
+else
    crash "Unknown SERVICE_PORT type specified!"
 fi
 
@@ -250,7 +256,7 @@
    futuregrid)
       start-workers-futuregrid $LOCAL_PORT
       ;;
-   *) 
+   *)
       crash "Unknown WORKER_MODE. Please modify coaster-service.conf"
       ;;
 esac
@@ -261,7 +267,7 @@
 if [ -f "gensites.template" ]; then
    gensites `cat gensites.template` -p $CONFIG_FILE > $RUN_DIR/sites.xml
 else
-   gensites persistent-coasters -p $CONFIG_FILE > $RUN_DIR/sites.xml 
+   gensites persistent-coasters -p $CONFIG_FILE > $RUN_DIR/sites.xml
 fi
 
 # Generate config file
@@ -272,6 +278,11 @@
 wrapperlog.always.transfer=false
 execution.retries=0
 provider.staging.pin.swiftfiles=false
+sitedir.keep=true
 EOF
 fi
 
+# Local Variables:
+# tab-width: 3
+# sh-basic-offset: 3
+# End:

Modified: branches/release-0.93/etc/coaster-service.conf
===================================================================
--- branches/release-0.93/etc/coaster-service.conf	2011-11-29 21:20:57 UTC (rev 5324)
+++ branches/release-0.93/etc/coaster-service.conf	2011-11-30 20:32:25 UTC (rev 5325)
@@ -5,7 +5,7 @@
 export SWIFT=
 
 # Where to copy worker.pl on the remote machine for sites.xml
-export WORKER_WORK=$HOME/swiftwork
+export WORKER_LOCATION=$HOME/swiftwork
 
 # How to launch workers: local, ssh, cobalt, or futuregrid
 export WORKER_MODE=ssh
@@ -29,7 +29,10 @@
 export LOCAL_PORT=
 export SERVICE_PORT=
 
-# start-coaster-service tries to automatically detect the IP address of this system. Specify here if you have multiple network interfaces
+# This is the IP address to which the workers will connect
+# If not given, start-coaster-service tries to automatically detect
+#   the IP address of this system via ifconfig
+# Specify this if you have multiple network interfaces
 export IPADDR=
 
 # Location of the swift-vm-boot scripts




More information about the Swift-commit mailing list