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.88k stars 382 forks source link

Unable to install extension from .VSIX in environment without internet connectivity #2601

Open BobPusateri opened 1 year ago

BobPusateri commented 1 year ago

Describe the bug

I am trying to utilize Polyglot Notebooks in an environment which does not have internet access - so I'm trying to do an offline install. I've downloaded the latest Polyglot Notebooks .VSIX file and am trying to install it in VS Code Insiders. The initial error is that the Jupyter extension is not installed, but after adding that (which seems to complete without issue) the Polyglot Notebooks extension seems to hang while installing and never completes. It appears that it's trying to connect to the outside internet at pkgs.dev.azure.com even though this environment has no internet connectivity.

I searched for similar issues, but would like to point out that this is a different problem than issue #1458 because that seems to concern versions of VS Code, whereas I'm already using the insiders build.

Please complete the following:

Which version of .NET Interactive are you using? (In a notebook, run the #!about magic command. ): 1.0.3627021

Screenshots

I'm including the console output while trying to install this extension, as well as a screenshot of what shows in VS Code while it's installing.

PolyglotInstallConsole.txt

PolyglotInstallStatus

jonsequitur commented 1 year ago

This happens because the extension is trying to install the dotnet-interactive tool. @brettfo, do you know if we support short-circuiting that pointing to an existing installation of dotnet-interactive?

BobPusateri commented 1 year ago

This happens because the extension is trying to install the dotnet-interactive tool. @brettfo, do you know if we support short-circuiting that pointing to an existing installation of dotnet-interactive?

@jonsequitur So just for my own clarification so I can understand, the "dotnet-interactive tool" is something separate from this, the (formerly-known-as) dotnet interactive extension?

brettfo commented 1 year ago

@BobPusateri when the extension first launches it looks for a local dotnet-interactive tool that serves as the backing process. For size reasons, this isn't included in the bare VSIX, but what you should be able to do is install the VSIX where you do have internet access and launch/activate one time. On that first launch it'll look for the appropriate version of the backing tool, it won't find it, then it'll do the download/install. On subsequent launches, the extension will look for the appropriate version, see that it's installed, then do nothing because it's already there.

As for doing a complete setup/install in an offline environment, that's not something we currently support, but is interesting, nonetheless, and I'll do some thinking on exactly how to do that.

jonsequitur commented 1 year ago

@jonsequitur So just for my own clarification so I can understand, the "dotnet-interactive tool" is something separate from this, the (formerly-known-as) dotnet interactive extension?

You can read a bit more about this here:

https://github.com/dotnet/interactive/blob/main/docs/FAQ.md

BobPusateri commented 1 year ago

@brettfo @jonsequitur Thank you very much for the helpful explanation! I didn't realize that tool existed or was the root of the issue. I will try to figure out a workaround, but as you plan future work I think there would be value in the ability to do a fully-offline install.

jonsequitur commented 1 year ago

One possible workaround (which I haven't tried) is to use a user-level nuget.config pointing to an internally-accessible NuGet feed, which can be just a folder on the local machine or on a network volume. The Polyglot Notebooks extension should then be able to transparently resolve the package if it's present there. The package it needs is this one: https://www.nuget.org/packages/Microsoft.dotnet-interactive