dotnet / interactive

.NET Interactive combines the power of .NET with many other languages to create notebooks, REPLs, and embedded coding experiences. Share code, explore data, write, and learn across your apps in ways you couldn't before.
MIT License
2.8k stars 374 forks source link

Documentation on remote Dotnet Interactive? #3440

Open mikoskinen opened 5 months ago

mikoskinen commented 5 months ago

The documentation contains an image where there is couple Dotnet Interactive remote instances:

240719688-f4468f10-288f-47e1-810c-83ef0caf9c25

I've been trying to understand how this could be accomplished but... I'm not able to find any guidance on this subject.

My use case is that I would like to start the dotnet interactive on a server and then use my local VS Code to connect to that remote instance. I can accomplish that if I start Jupyter on the server and then use VS Code to connect to the remote Jupyter host but I'm trying to understand how this could be accomplished with just the Dotnet Interactive.

I think I can start the SignalR Hub on the server using the cli:

dotnet interactive stdio --kernel-host mylocal --preview --http-port 8765 --default-kernel csharp

Things seem to start OK.

Now in VS Code when I use:

#!connect signalr --kernel-name myweb --hub-url=http://localhost:8765/kernelhub

I get:

Kernel added: #!myweb

So in theory things are looking good.

But, there's no "myweb" available in the kernel selector and when I try to use #!myweb before some C# code, the cell kind of hangs:

image

Any tips where I'm going wrong? Or if the SignalR is the wrong way to go and there is actually some other way to start/connect to a remote Dotnet Interactive.

Any guidance on this subject is appreciated.

jonsequitur commented 4 months ago

This looks like the right approach but it seems the SignalR connector has a bug. Very few people have used it and we've discussed removing it or at the very least moving it to an extension package.

We'd be interested to know your thoughts on what makes this approach preferable to connecting via Jupyter.