Message Boards Message Boards

1
|
185 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

What is the best way to combine ExternalEvaluate with RemoteRunProcess?

Posted 16 days ago

session = StartExternalSession["Python"] starts a python session on the local machine.

remote = RemoteConnect["host.example.com"] opens a connection over the network to run shell commands on the remote host.

Is there a way to open an 'external evaluation session' (Python, R, Julia, Octave, ...) on a remote host?

POSTED BY: Mma Usr
2 Replies

I would try it like this:

remote = LaunchKernels["ssh://arnoudb@192.168.1.236/usr/local/bin/wolfram"]
ParallelEvaluate[$ProcessID, remote]
ParallelEvaluate[$MachineName, remote]
ParallelEvaluate[session = StartExternalSession["Python"], remote]
ParallelEvaluate[ExternalEvaluate[session, "
import socket
socket.gethostname()
"], remote]

Note that RemoteEvaluate launches and quits the kernel every time (it's a one-shot kernel evaluation) so that's probably not what you want if you want to execute multiple commands

POSTED BY: Arnoud Buzing
Posted 16 days ago

Thanks for your quick response. I should have provided more details regarding the constraints under which I am operating.

Unfortunately, I cannot figure out a way to install Wolfram engine on the remote host. The remote host is a large cluster of ARM Ampere CPUs that is only accessible through a TUI. The script that Wolfram provides to install the Wolfram engine as a .deb on the Raspberry Pi does not work on Ampere with TUI-only access.

In the alternative, it would suffice for my use case if the FindExternalEvaluators command could find all of the Python environments that are installled, not only on the local machine, but also on the remote hosts that are accessible through ssh by searching through the hosts listed in the user's /.ssh/config file just like VSCode can do.

It would also be sufficient for ResourceFunction["CreatePythonVirtualEnvironment"][spec,"dir"] to accept a remote host as a parameter.

POSTED BY: Mma Usr
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract