-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on Connecting to Remote Servers for External R Processing #14
Comments
For a starter, what is your operating system and your |
My OS is Windows 10, server OS is Linux Ubuntu server 18.04 (Bionic Beaver) sessionInfo():
|
Ok, your on Windows. I don't see session info on the future package - please make sure your show that after loading future. Can you SSH into the remote machine and launch Rscript? That is a minimum requirement. See |
I do have the ability to make those connections. I am testing the code on a virtual linux server to see how Future package works. It more HOW to establish those connections is where I am getting confused on. But I will follow your suggestion on
|
Should I read this as you can indeed connect to your remote machine using If so, then just use: plan(remote, workers = cl) or, equivalently, plan(cluster, workers = cl, persistent = TRUE) Validate that future expressions are evaluated remotely by: info %<-% Sys.info()
print(info) |
Sorry I should have clarified, I have made the connection by using the putty application outside of Rstudio. Where I am having the trouble, is establishing the same connection in R with Also, I am trying to following the examples in IP: 192.168.1.53 |
It's hard to give much more suggestions without knowing exactly what you've tried. See my suggestion on how to troubleshoot a similar problem over at futureverse/future#242 (comment) - that setup more complex that yours, but the gist of how to troubleshoot is them same. Using
Yes, FYI, Windows 10 version 1803 (April 2018) and newer has an |
So here is the code i ran and the message associated with it. Not entirely sure whether this was correct or not.
So I am brand new to SSH, private /public keys, moving them to servers etc etc. So I try to follow some examples but get lost in the meaning of how the PATHs are established or when dummy data is used as opposed to real data (i.e. fake ips, fake paths) If it is possible, I would be more then happy to speak online via skype where I can share my screen or even a phone call to discuss further. I think my lack of experience in this, makes troubleshooting difficult since I can't explain well the problems I am experiencing. email: danielra0091@gmail.com |
Note that argument If that doesn't solve it, make sure to try HenrikBengtsson/future#242 (comment) |
Will do, also I added a paragraph to my last comment about reaching out directly with my email. If you have the time or are willing. It will be much appreciated. |
…SSH port + explain how to specify the latter [#244] [ci skip]
So here is the new error I have now. I am unsure how to complete this code correctly to get it working.
|
It looks like it cannot reach 192.168.43.94. Verify by simplifying: $ system('"C:/Program Files/PuTTY/plink.exe" -ssh 192.168.43.94') If that doesn't work, try the same at the Windows Command line ("DOS"): "C:/Program Files/PuTTY/plink.exe" -ssh 192.168.43.94 If that doesn't work either, you've got the incorrect IP number or don't have access. |
@danielra0091, any progress on your end? Can I close this issue? |
Still working to resolve it, had to switch gears to another issue but I will be coming back to this soon. Was having issues logging in to the server now. But will try a few more attempts before reaching out again. |
Here is the latest progress I have had on getting the connection to work. I seem to be having trouble with the RSA file.
Result:
|
Please see Otherwise, to troubleshoot this, I suggest that you try to figure out what it should look like without using R, i.e. use the Windows Command line ("DOS"):
Look at the PuTTY docs or query at the PuTTY forums for a solution to using SSH keys. When you've got that working, then it should work from within R. |
Hello, So I am getting an notification to manually start my worker.
Not sure where to go from here in terms of establishing my connection. "proxy21.rt3.io" is a proxy to connect to a raspberry pi running R that has future packaged installed and ssh installed as well. |
Ok. Let's forget about R on your local Windows machine for now. What happens if you call the following from the Windows Console/Terminal:
and if that works, what about:
(Before anything else, I want to confirm that you can ssh into your remote machine and that the Rscript executable is available. When that has been established, we can retry from within R.) |
Here are the results: I was able to establish my connection
|
Awesome, that confirms that you can connect to R on the remote machine over SSH. Go back and try the below from within R, which should do the same thing in the background, launch R on the remote machine which will try to connect back to your local R session: > library(future)
> workers <- "proxy21.rt3.io"
> cl <- makeClusterPSOCK(workers, user = "pi", verbose = TRUE)
> print(cl) What do you get/see? BTW, what version of R do you run locally? I see you run R 3.3.3 on the remote machine. |
Here are the specs of my remote Pi and my computer:
Results from your code:
When I added the port: ( 34383)
|
Hmm... first another quick confirmation. Does it even work to set up a localhost worker? > library(future)
> cl <- makeClusterPSOCK("localhost", verbose = TRUE)
> print(cl) I assume so, but want to make sure. Also, can you update your remote R version, to rule out that you're hitting some bug in the parallel package of R 3.3.3? |
Oh, and using argument > cl <- makeClusterPSOCK(workers, user = "pi", out = NULL, verbose = TRUE) |
Here is what I get running the code. Also: I am trying to install the latest R, but its been a bit tricky. Running into some issues.
|
Good, so it works when you use localhost workers. It's a much simpler use case (avoids SSH and most firewall issues), but at least we have a baseline. For your remote use case, what is the output when you use |
Here are the results: It failed to connect.
|
Interesting, with
after What happens if you log into the remote machine and call: $ Rscript --default-packages=datasets,utils,grDevices,graphics,stats,methods -e "parallel:::.slaveRSOCK()" MASTER=localhost PORT=11492 OUT= TIMEOUT=2592000 XDR=TRUE
starting worker pid=631 on localhost:11492 at 11:48:19.096 Do you get an error or do you see that |
Here is the result I get for running the Rscript on my raspberry Pi:
|
I've updated the develop version of the future package such that you will get a much more informative error message when it fails to connect. First, in a fresh R session, install it using (enough on your local machine): > remotes::install_github("HenrikBengtsson/future@develop") Then, retry, now by adding the new > library(future)
> workers <- "proxy13.remot3.it"
> cl <- makeClusterPSOCK(workers, user = "pi", logfile = TRUE, verbose = TRUE) You will get a very detailed error message - please show all of the output. PS. I learned that on Windows when running Rgui or RStudio Console, using PS2. Could it be that you log in to the remote machine using a password? Only SSH-key logins are supported. If so, the new error message should reveal that is what's going on. |
After testing on Windows 10 (version 1803, build 17134.523, 2018-07-10 with OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4), I believe there is a bug in "C:\WINDOWS\System32\OpenSSH\ssh.exe". It works with PuTTY and with the SSH client that comes with RStudio. See ?makeClusterPSOCK in the develop version for how to use these instead. UPDATE 2019-01-14: According to PowerShell/Win32-OpenSSH#1265, there have been some fixes in Windows 10 version 1809 (build 17763.253, 2018-11-13 with OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5) for reverse tunneling and some of the examples that didn't work before now work. However, one user PowerShell/Win32-OpenSSH#1265 (comment) still reports (2018-11-16) that it doesn't work. When I test under Windows 10 version 1809, I can confirm that although it no longer stalls, there is something else going on causing failures, e.g. > cl <- future::makeClusterPSOCK("remote.server.org", outfile=NULL, verbose=TRUE)
Workers: [n = 1] 'remote.server.org'
Base port: 11780
Creating node 1 of 1 ...
- setting up node
Starting worker HenrikBengtsson/future#1 on 'remote.server.org': "C:\Windows\System32\OpenSSH\ssh.exe" -R 11780:localhost:11780 remote.server.org "\"Rscript\" --default-packages=datasets,utils,grDevices,graphics,stats,methods -e \"parallel:::.slaveRSOCK()\" MASTER=localhost PORT=11780 OUT= TIMEOUT=2592000 XDR=TRUE"
Waiting for worker HenrikBengtsson/future#1 on 'remote.server.org' to connect back
starting worker pid=29014 on localhost:11780 at 22:00:56.665
Error in unserialize(node$con) : error reading from connection
Calls: <Anonymous> ... doTryCatch -> recvData -> recvData.SOCK0node -> unserialize
[ ... stalls ...] Maybe it works with text but not binary streaming?!? UPDATE 2019-05-26: This error is still there with Windows 10 version 1903 (build 18362.116, 2019-05-23 with OpenSSH_for_Windows_7.7p1, LibreSSL 2.6.5), which is probably because SSH hasn't been updated since last time. |
Windows 10 version 1809 (= build 17763.253, 2018-11-13) still does not properly handle reverse tunneling over SSH, cf. https://github.com/HenrikBengtsson/future/issues/244#issuecomment-437568082 Issue #244
Hmm... not sure what happened here; this issue is still reported as being transferred (for two days now) and it's content looks very much Issue #20 but incomplete and different timestamps. Closing. |
So I am having trouble wrapping my head around using the future package to connect to a remote linux server. Couldn't find much documentation to help me troubleshoot this error I am getting.
The text was updated successfully, but these errors were encountered: