Some bash addendum scripts

38 views
Skip to first unread message

Hamilton Turner

unread,
Nov 25, 2012, 12:33:57 PM11/25/12
to jug-...@googlegroups.com
Here are some shell scripts that I'm using with success to help me manage running jug across a cluster. Luis, if you're interested in using something like this, I can put these on the git and they can be upgraded to be more release-ready, although perhaps they should be renamed if so. I like being able to hit Tab after typing jug and see both plain old jug and all of my commands for managing the slaves

[hamiltont@foo ~]$ jug
jug        jughalt    juglog     jugoutput  jugrun     jugstatus  

__________________________________________
# Using parallel ssh with IP addresses of all slave computers
alias pssh='pssh -i -h workers.iplist '

# Allows me to keep an eye on all workers
alias jugstatus='watch -n 10 -d jug status --cache benchmark_jug.py'

# Rapidly starts a ton of workers, and also starts a screen session that will write to the log file once the entire job is complete. The waitonjug.sh is posted below
alias jugrun='echo "`date`: Start" >> .juglog; screen -d -m -S jugwatcher sh ~/.waitonjug; pssh screen -d -S jug -m sh run_workers.sh'

# Allows me to see the output of all executors
alias jugoutput='pssh cat /mnt/localhd/.jug*'

# Kills all jug workers 
alias jughalt='echo "`date`: Halt ">> .juglog; screen -S jugwatcher -X quit;  pssh pkill jug;'

# Simply outputs my log file
alias juglog='cat ~/.juglog'

_______________

[hamiltont@foo ~]$ cat run_workers.sh 
#!/bin/sh

# Removing output from old runs
rm /mnt/localhd/.jug*

# Starting 10 executors on each slave machine, and forwarding output to some slave-machine specific files in a directory not shared via NFS
for i in {1..10}
do
jug execute benchmark_jug.py > /mnt/localhd/.jug$i.out 2> /mnt/localhd/.jug$i.err &
done
# Waiting for all sub-processes to complete before we terminate
wait

__________________________________
[hamiltont@foo ~]$ juglog 
Wed Nov 14 02:46:39 EST 2012: Start
Wed Nov 14 02:46:39 EST 2012: Completed
Wed Nov 14 02:47:39 EST 2012: Halt 
Wed Nov 14 02:49:10 EST 2012: Start
Wed Nov 14 03:00:00 EST 2012: Completed




Luis Pedro Coelho

unread,
Nov 25, 2012, 1:38:30 PM11/25/12
to jug-...@googlegroups.com
Thanks.

This could be generally useful, I agree. Either as full-blown scripts to
be distributed with jug (they'd need generalizing & proper
documentation, &c) or, less work involved, as examples in the package
documentation.

Luis

Hamilton Turner

unread,
Nov 25, 2012, 2:18:00 PM11/25/12
to jug-...@googlegroups.com

I think the examples might be best for now, as making these general purpose is beyond my shell abilities. Having them as a general setup example might be most useful to others in setting up their own version.

Thanks,
Hamy

Luis Pedro Coelho

unread,
Nov 26, 2012, 8:55:09 AM11/26/12
to jug-...@googlegroups.com
On Sunday, November 25, 2012 02:18:00 PM Hamilton Turner wrote:
> I think the examples might be best for now, as making these general purpose
> is beyond my shell abilities. Having them as a general setup example might
> be most useful to others in setting up their own version.

K.

Do you want to write something up or should I just copy and paste the stuff
from your email?

Thanks,
--
Luis Pedro Coelho | Institute for Molecular Medicine | http://luispedro.org

Hamilton Turner

unread,
Nov 26, 2012, 5:53:47 PM11/26/12
to jug-...@googlegroups.com
I can write something a bit cleaner, is there any specific markup style you prefer? 

Luis Pedro Coelho

unread,
Nov 26, 2012, 6:43:19 PM11/26/12
to jug-...@googlegroups.com
On 11/26/2012 10:53 PM, Hamilton Turner wrote:
> I can write something a bit cleaner, is there any specific markup style
> you prefer?

Awesome!

The docs in jug are in restructured text:

https://github.com/luispedro/jug/tree/master/docs/source

Thanks,
Luis

Hamilton Turner

unread,
Mar 25, 2013, 4:44:30 PM3/25/13
to jug-...@googlegroups.com
Luis, 

It took me forever, but check out the pull request on github. I (clearly) don't have enough time to dedicate here, so 
hopefully someone else can take the time to make them more general if they are useful. 

Best, 
Hamy

Luis Pedro Coelho

unread,
Mar 25, 2013, 4:47:14 PM3/25/13
to jug-...@googlegroups.com
Thank you!

I have merged.

This is very complete, excellent documentation work!

--
Luis Pedro Coelho

LxMLS 2013: http://lxmls.it.pt/2013/
> --
> You received this message because you are subscribed to the Google Groups "jug-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jug-users+...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Hamilton Turner

unread,
Mar 25, 2013, 5:03:02 PM3/25/13
to jug-...@googlegroups.com
Glad you like them. Do be sure to check my rst syntax - I've never used it and I didn't compile the docs (*ducks head in shame*)

Luis Pedro Coelho

unread,
Mar 25, 2013, 5:57:59 PM3/25/13
to jug-...@googlegroups.com
Just a tiny error, which I have just fixed.

Tx again,
--
Luis Pedro Coelho

LxMLS 2013: http://lxmls.it.pt/2013/

Reply all
Reply to author
Forward
0 new messages