# HG changeset patch # User Henry S. Thompson # Date 1549648009 0 # Node ID 1099246f22b60b33a1925b1a3909d9e273099154 # Parent 9df880d45440c5496d6f2a89ab23e6d74f9523f3 new scripts diff -r 9df880d45440 -r 1099246f22b6 master/bin/bindWorkerVars.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/master/bin/bindWorkerVars.sh Fri Feb 08 17:46:49 2019 +0000 @@ -0,0 +1,16 @@ +# Usage . bindWorkerVars.sh name +# (Re)init worker environment vars +name=$1 +f=$HOME/.parallel/$name +rm -f $f +az vmss list-instance-connection-info -g cc -n $name | tr -s ',": ' '\t' | \ + tail -n +2 | fgrep instance |cut -f 4,5 | \ + while read ip port + do + echo ssh -p $port $ip >> $f + done +ip=$(head -1 $f | cut -f 4 -d ' ') +export $name=$ip +export WORKERS=$name +sed '/export WORKERS/s/=.*$/='$name'/;/WORKERS names/s/ .*=[^ ]* / '$name'='$ip' /' -i $HOME/.bashrc +echo $name=$ip diff -r 9df880d45440 -r 1099246f22b6 master/bin/pbash.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/master/bin/pbash.sh Fri Feb 08 17:46:49 2019 +0000 @@ -0,0 +1,41 @@ +#!/bin/bash +if [ $# -lt 1 ] +then + cat 1>&2 < xargs $0 W4 echo +hello +world +^D +hello world +hello world +... + +Do + > echo 'will cite' | parallel --citation 2>/dev/null +to turn off citation prompt +EOF + exit 1 +fi +if [ $1 = -h ] +then + shift + shf="$1" + shift +else + shf=$WORKERS +fi +parallel --sshloginfile $shf --nonall "$@" + + + diff -r 9df880d45440 -r 1099246f22b6 master/bin/wakeWorker.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/master/bin/wakeWorker.sh Fri Feb 08 17:46:49 2019 +0000 @@ -0,0 +1,7 @@ +# Usage . wakeWorker.sh name +# Resurrect a worker cluster that was deallocated +set -e -o pipefail +name=$1 +echo restarting... +az vmss restart -g cc -n $name +. bindWorkerVars.sh $name