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

davidk at ci.uchicago.edu davidk at ci.uchicago.edu
Tue Dec 13 14:40:15 CST 2011


Author: davidk
Date: 2011-12-13 14:40:15 -0600 (Tue, 13 Dec 2011)
New Revision: 5412

Modified:
   branches/release-0.93/bin/gensites
   branches/release-0.93/bin/start-coaster-service
   branches/release-0.93/bin/stop-coaster-service
   branches/release-0.93/etc/sites/persistent-coasters
Log:
Add a few parameters to gensites
Start and stop coasters improvements for ec2
Updated pcoaster template


Modified: branches/release-0.93/bin/gensites
===================================================================
--- branches/release-0.93/bin/gensites	2011-12-13 17:42:00 UTC (rev 5411)
+++ branches/release-0.93/bin/gensites	2011-12-13 20:40:15 UTC (rev 5412)
@@ -251,7 +251,7 @@
   echo "s at _EXECUTION_URL_@${EXECUTION_URL}@"
   echo "s at _SERVICE_COASTERS_@${SERVICE_COASTERS:-NO_URL_GIVEN}@"
   echo "s at _SERVICE_PORT_@${SERVICE_PORT:-NO_PORT_GIVEN}@"
-  echo "s at _WORKERS_PER_NODE_@${WORKERS_PER_NODE}@"
+  echo "s at _JOBS_PER_NODE_@${JOBS_PER_NODE}@"
   echo "s at _JOB_THROTTLE_@${JOB_THROTTLE}@"
 } > $SEDFILE
 

Modified: branches/release-0.93/bin/start-coaster-service
===================================================================
--- branches/release-0.93/bin/start-coaster-service	2011-12-13 17:42:00 UTC (rev 5411)
+++ branches/release-0.93/bin/start-coaster-service	2011-12-13 20:40:15 UTC (rev 5412)
@@ -119,9 +119,10 @@
    echo Creating instance..
    $SWIFTVMBOOT_DIR/bin/ec2-run-instances "$EC2_AMI" -t "$EC2_INSTANCE_TYPE" -n "$EC2_NODES" -k "$EC2_KEYPAIR"
    SWIFTVM_INSTANCES=$( $SWIFTVMBOOT_DIR/bin/ec2-describe-instances | grep INSTANCE | grep -v terminated |awk '{print $2}' )
-   echo $SWIFTVM_INSTANCES >> $HOME/.swift/.swiftvm_instance
+   echo $SWIFTVM_INSTANCES >> $HOME/.swift/.swiftvm_instances
    echo Waiting for nodes to boot..
 
+   # Wait until all instances are listed as running
    while /bin/true
    do
       SWIFTVM_INSTANCES_AS_STRING=$( echo $SWIFTVM_INSTANCES | tr "\\n" " ")
@@ -137,8 +138,12 @@
 
    WORKER_HOSTS=$( ec2-describe-instances $SWIFTVM_INSTANCES_AS_STRING | grep INSTANCE | grep -v terminated | awk '{print $4}' )
 
+   if [ -f "$HOME/.swift/.machines" ]; then
+      rm $HOME/.swift/.machines
+   fi
+
    # Start worker script
-   rm $HOME/.swift/.machines
+   SSH_OPTS="-i $EC2_KEYFILE -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
    for MACHINE in $WORKER_HOSTS
    do
 
@@ -147,18 +152,18 @@
 
       # Enable ssh tunneling if needed
       if [ "$SSH_TUNNELING" == "yes" ]; then
-         ssh -i $EC2_KEYFILE -q -o StrictHostKeyChecking=no -R *:$PORT:localhost:$PORT $WORKER_USERNAME@$MACHINE sleep 999 &
+         ssh $SSH_OPTS -R *:$PORT:localhost:$PORT $WORKER_USERNAME@$MACHINE sleep 999 > /dev/null 2>&1 &
          echo $! >> $PID_FILE
       fi
 
       # Copy and start worker script
-      scp -i $EC2_KEYFILE -q -o StrictHostKeyChecking=no $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_LOCATION > /dev/null 2>&1
+      scp $SSH_OPTS $SWIFT_BIN/$WORKER $WORKER_USERNAME@$MACHINE:$WORKER_LOCATION > /dev/null 2>&1
       echo "Starting worker on $MACHINE"
-      ssh -i $EC2_KEYFILE -q -o StrictHostKeyChecking=no $WORKER_USERNAME@$MACHINE "$WORKER_LOCATION/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" &
+      ssh $SSH_OPTS $WORKER_USERNAME@$MACHINE "$WORKER_LOCATION/$WORKER $EXECUTION_URL $MACHINE $LOG_DIR" > /dev/null 2>&1 &
       echo $! >> $PID_FILE
 
       # Copy SSH key for easier access
-      cat $HOME/.ssh/*.pub | ssh -i $EC2_KEYFILE $WORKER_USERNAME@$MACHINE 'umask 077; cat >> $HOME/.ssh/authorized_keys'
+      cat $HOME/.ssh/*.pub | ssh $SSH_OPTS $WORKER_USERNAME@$MACHINE 'umask 077; cat >> $HOME/.ssh/authorized_keys' > /dev/null 2>&1
    done
 }
 

Modified: branches/release-0.93/bin/stop-coaster-service
===================================================================
--- branches/release-0.93/bin/stop-coaster-service	2011-12-13 17:42:00 UTC (rev 5411)
+++ branches/release-0.93/bin/stop-coaster-service	2011-12-13 20:40:15 UTC (rev 5412)
@@ -10,7 +10,7 @@
 
 # Location of required files
 PID_FILE="$HOME/.swift/.coaster-service-pids"
-SWIFTVM_INSTANCES="$HOME/.swift/.swiftvm_instance"
+SWIFTVM_INSTANCES="$HOME/.swift/.swiftvm_instances"
 
 # Import settings
 CONFIG_FILE=$HOME/.swift/.config
@@ -39,7 +39,7 @@
    rm $SWIFTVM_INSTANCES > /dev/null 2>&1
 fi
 
-if [ "$WORKER_MODE" == "ec2" ] && [ -f "$SWIFTVM_INSTANCES" ]; then
+if [ "$WORKER_MODE" == "gp" ] && [ -f "$SWIFTVM_INSTANCES" ]; then
    for INSTANCE in `cat $SWIFTVM_INSTANCES`
    do
       echo Stopping ec2 instance $INSTANCE...
@@ -49,6 +49,17 @@
   rm $SWIFTVM_INSTANCES > /dev/null 2>&1
 fi
 
+if [ "$WORKER_MODE" == "ec2" ] && [ -f "$SWIFTVM_INSTANCES" ]; then
+   export EC2_HOME="$SWIFTVMBOOT_DIR"
+   export EC2_PRIVATE_KEY="$EC2_KEYFILE"
+   export EC2_CERT="$EC2_CERTFILE"
+   INSTANCES_AS_STRING=$( cat $SWIFTVM_INSTANCES | tr "\\n" " ")
+   $SWIFTVMBOOT_DIR/bin/ec2-terminate-instances $INSTANCES_AS_STRING
+   if [ -f "$HOME/.swift/.swiftvm_instances" ]; then
+      rm $HOME/.swift/.swiftvm_instances
+   fi
+fi
+
 if [ -f "$HOME/.swift/.machines" ]; then
    rm "$HOME/.swift/.machines"
 fi

Modified: branches/release-0.93/etc/sites/persistent-coasters
===================================================================
--- branches/release-0.93/etc/sites/persistent-coasters	2011-12-13 17:42:00 UTC (rev 5411)
+++ branches/release-0.93/etc/sites/persistent-coasters	2011-12-13 20:40:15 UTC (rev 5412)
@@ -4,7 +4,7 @@
                url="_EXECUTION_URL_"
                jobmanager="local:local"/>
     <profile namespace="globus" key="workerManager">passive</profile>
-    <profile namespace="globus" key="workersPerNode">4</profile>
+    <profile namespace="globus" key="jobsPerNode">_JOBS_PER_NODE_</profile>
     <profile key="jobThrottle" namespace="karajan">_JOB_THROTTLE_</profile>
     <profile namespace="karajan" key="initialScore">10000</profile>
     <filesystem provider="local" url="none" />




More information about the Swift-commit mailing list