I want to do a livebook that has connections to 2 different BEAM nodes.
One is my desktop (running the livebook) , and the other is a remote node,
that we wish to debug.
Today I do this with 2 unix terminals, some shell functions, and
remsh support obviously.
Is it possible to have an iex shell embedded in the livebook, that’s actually the
remsh connected remote node, as well as the current node?
@dch you can connect to the remote node using
Node.connect, then invoke code on the remote node using
:erpc.call. The notebook itself will run in its own node (“Elixir standalone” runtime), which is local to your machine. This way you can fetch data from the remote node and still do anything you want in the notebook, for example bring in some packages. If that doesn’t match your use case, please elaborate a bit further : )
thanks @jonatanklosko yeah I have already experimented with
I’m putting some notes together on advanced debugging, and what I’m trying to show is being able to use
:c.nl(:module) to remote-load a missing library into a running BEAM instance, from another node that already has this, to assist in debugging a live issue, without needing restarting or re-deploying.
This is possible with
:erpc already, I can load the local .beam file, and send it
over to be loaded at the other end, but it starts to obscure what’s going on.
What’s important is to be able to see the 2 nodes separately. I have done this presently just by showing 2 separate remsh terminals, rather than have a livebook, where I can intersperse documentation and some images as well.
I see. The code cells always use the runtime node, there is no way to have a cell that itself would run on the other node. We plan to have a smart cell for remote execution (Add a remote execution smart cell · Issue #295 · livebook-dev/kino · GitHub), perhaps that would help to make the distinction more clear.
I think that will be helpful in the future - sounds pretty nice!