working with locally-mounted remote filesystems and remote CPUs
sshfs (SSH filesystem) is really really handy! By mounting a remote directory locally, I can view / edit / attach / copy remote files as if they were local, bypassing awkward commands and password prompts (not to mention the junk that is left behind after running scp).
The only thing that bothers me a bit is that when I run things while in a locally-mounted remote directory, I have the illusion that they are running remotely. But in fact, it is my own CPU that is running and heating up... and it's probably slow for reading and writing to file. (In an ideal world, it would be the other way around: a remote process would be accessing the files in my HD, but that's beside the point.)
I'm wondering if there's a nice way to start remote processes from locally-mounted remote drives... a way that (a) understands where I am running the process from (i.e. which directory I'm in), (b) that can resolve references to locally-mounted remote files into actual remote files, and (c) has a simple syntax, like e.g. a "*" after the command name to indicate "run remotely", so that
The only thing that bothers me a bit is that when I run things while in a locally-mounted remote directory, I have the illusion that they are running remotely. But in fact, it is my own CPU that is running and heating up... and it's probably slow for reading and writing to file. (In an ideal world, it would be the other way around: a remote process would be accessing the files in my HD, but that's beside the point.)
I'm wondering if there's a nice way to start remote processes from locally-mounted remote drives... a way that (a) understands where I am running the process from (i.e. which directory I'm in), (b) that can resolve references to locally-mounted remote files into actual remote files, and (c) has a simple syntax, like e.g. a "*" after the command name to indicate "run remotely", so that
Rscript* run.R | grep pattern
would run Rscript on the remote CPU, and grep with the local CPU.
no subject
I guess, if you think about it, FTP executes some pretty basic commands like that.
no subject
How would you make RPCs from a bash shell? Anything that approximately satisfies (a-c) above?
no subject
no subject
no subject
no subject
no subject
http://www.contrib.andrew.cmu.edu/~edanaher/rem
Basically, "rem command" checks if it's in an sshfs-mount, and if it is, grabs the user, host, and directories from both sides, ssh's over, moves into the directory your in, and runs the command. It's probably pretty brittle - I don't use it for much beyond moving and md5summing files.
Also, note that it depends on the sshfs being named something in the form sshfs#user@host:dir (either via fstab or -ofsname), which seems to be required anyway for non-root unmounting. Of course, it's about 30 lines long so it shouldn't be too hard to tweak.
no subject
That grep however really should be on the remote side.