[Swift-commit] r5208 - branches/release-0.93/bin

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Thu Oct 6 21:46:55 CDT 2011


Author: davidk
Date: 2011-10-06 21:46:55 -0500 (Thu, 06 Oct 2011)
New Revision: 5208

Modified:
   branches/release-0.93/bin/start-coaster-service
Log:
start-coaster-service can now use a relay host to start	workers	not directly available due to firewall restrictions


Modified: branches/release-0.93/bin/start-coaster-service
===================================================================
--- branches/release-0.93/bin/start-coaster-service	2011-10-06 21:19:33 UTC (rev 5207)
+++ branches/release-0.93/bin/start-coaster-service	2011-10-07 02:46:55 UTC (rev 5208)
@@ -43,7 +43,7 @@
       # Copy and start worker script
       scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_WORK > /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_WORK/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
       echo $! >> $PID_FILE 
    done
 }
@@ -56,6 +56,11 @@
    if [ -z "$PORT" ]; then
       crash "start-workers-ssh: Port number not specified, giving up"
    fi
+
+   if [ -n "$WORKER_RELAY_HOST" ]; then
+      scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$WORKER_RELAY_HOST:/tmp > /dev/null 2>&1
+   fi
+
    for MACHINE in $WORKER_HOSTS
    do
       # Enable ssh tunneling if needed
@@ -64,10 +69,20 @@
          echo $! >> $PID_FILE
       fi
 
-      scp $SWIFT_BIN/$WORKER $MACHINE:$WORKER_WORK > /dev/null 2>&1
-      echo Starting worker on $MACHINE
-      ssh $MACHINE $WORKER_WORK/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR &
-      echo $! >> $PID_FILE
+      # 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
+         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" &
+         echo $! >> $PID_FILE
+      # Connect directly
+      else  
+         scp $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_WORK > /dev/null 2>&1
+         echo Starting worker on $MACHINE
+         ssh $WORKER_USERNAME@$MACHINE "$WORKER_WORK/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
+         echo $! >> $PID_FILE
+      fi
    done
    return 0
 }




More information about the Swift-commit mailing list