GameOfLife / Unit-Lib

The Unit Library is a system that provides high level abstractions on top of the SuperCollider language.
25 stars 6 forks source link

load big synthdefs to remote servers via ssh #15

Open miguel-negrao opened 11 years ago

miguel-negrao commented 11 years ago

When using remote servers it's not possible to send big synthdefs across. A solution which I have already tested in the sonic lab is to mount the disk of the remote server via ssh, then write the file to the remote server and send an osc command to load the file:

mkdir ~/remoteserv
sshfs mnegrao@192.168.2.1:/ ~/remoteserv

To integrate this into UnitLib we would need to able to configure the folder where the file should be written. Perhaps the ssh part could be left to the user to deal with, since this will differ from system to system and os to os. Also, for multiple remote computers we need to mount one folder per remote machine. Does the WFS system already deal with this ?

woutersnoei commented 11 years ago

on the GOL system we don't have such a mechanism at current. All large defs are created on the servers themselves instead of sending from the client. In the past we had a mechanism for storing WFSPath data via rsync on both servers. This could work for synthdefs as well; specify a folder on the client machine, and after writing rsync it to all servers. It would be kind of slow though..

miguel-negrao commented 11 years ago

Creating large synthdefs before hand is fine for WFS panners, but when working on a new Udef for a specific score, one needs to experiment and keep sending new versions. On my synthdefs folder the biggest synthdef is about 150Kb (1200bits) at 100Mb/s that should take 0.012 seconds, which is quite fast. Using rsync, specially if a whole directory is being sent, could be slowing down things because rsync needs to first detect what is new to send, create a file list, check what are the contents of the directory on the other side, that is probably what makes it quite slow. On the other hand just writing a file to the already mounted remote directory is much faster. In the sonic lab, connected with an ethernet cable directly to the mac pro, writing a synthdef file feels like instantaneous. On osx I think you can mount a filesystem with ssh using osxfuse. If mounting is not desired the file could just be directly copied with an scp.

woutersnoei commented 11 years ago

In that case I would say scp is the best option. The file system mounting is yet another step that would need to be taken, depends on wether the servers are online or not and may cause the Finder to start nagging about volumes being connected etc. Also it would probably show up at the desktop, where there is so much clutter already. The scp command could copy the def directly to the defs folder on the remote machine, which ha

woutersnoei commented 11 years ago

oops hit the close button accidentally, typing on iPhone.. Anyway, ... which happens to be at the same path as the local defs folder.

miguel-negrao commented 11 years ago

I guess if the ssh keys are well configured it should be possible to use scp without password, so that the command can just be wrapped in a string and issued with .unixCmd from sclang.

miguel-negrao commented 11 years ago

I can have a look at implementing this when I'm back from holydays. I will think I will need this for my library too.

Indeed scp is quite fast:

miguel@miguel-MacBookPro:/tmp$ time scp /home/miguel/.local/share/SuperCollider/synthdefs/wfsa_fdl_72.scsyndef  mnegrao@192.168.2.1:Documents

wfsa_fdl_72.scsyndef                          100%  105KB 105.2KB/s   00:00    

real    0m0.221s
user    0m0.015s
sys 0m0.012s