Skip to content
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

Make the default filebrowser drive configurable #16099

Open
martinRenou opened this issue Apr 3, 2024 · 5 comments · May be fixed by #16141
Open

Make the default filebrowser drive configurable #16099

martinRenou opened this issue Apr 3, 2024 · 5 comments · May be fixed by #16141

Comments

@martinRenou
Copy link
Member

martinRenou commented Apr 3, 2024

cc. @davidbrochart @ellisonbg @Zsailer @SylvainCorlay @jtpio

Problem

Currently, the default file browser does not allow overwriting the default drive.

This makes it difficult to overwrite the behavior of the default filebrowser:

  • JupyterLite has to implement routers to reroute the REST API calls
  • jupyter-collaboration used to also reroute the REST API calls, but it was apparently difficult to maintain. Instead, they now implement a custom drive prefixed with RTC: and overwrite the default filebrowser to use it, this has its load of issues. Being able to overwrite the default drive would probably be less problematic.
  • jupyterlab-unfold is incompatible with jupyter-collaboration, because they both overwrite the default filebrowser.

Proposed Solution

I would like to suggest that JupyterLab allow overwriting the default drive.

@martinRenou martinRenou added enhancement status:Needs Triage Applied to new issues that need triage labels Apr 3, 2024
@martinRenou martinRenou changed the title Make the default filebrowser a real drive, and make it configurable Make the default filebrowser drive configurable Apr 3, 2024
@Zsailer
Copy link
Member

Zsailer commented Apr 3, 2024

Thanks @martinRenou, I can work on this early next week and aim to get a draft PR by the next JupyterLab meeting.

@Zsailer
Copy link
Member

Zsailer commented Apr 8, 2024

I thinking making the core file browser drive configurable is not enough here.

If we only make the file browser plugin configurable here, the e.g. Running Tab plugin will point to different paths than the file browser. Ideally, for the core application to feel self-consistent, we want all references to contents to be consistent unless explicitly asked to fetch from another drive. Alll plugins should be able to assume that they are pulling from the same drive by default.

Instead of just changing the file browser, I would propose that we make the defaultDrive in the ContentsManager API configurable by outside plugins.

I also think we should give the Jupyter Server REST API drive a fixed name, e.g. contents://? Right now, it is implicitly set to default://, which would be a moving target if we let this value become configurable.

@Zsailer
Copy link
Member

Zsailer commented Apr 8, 2024

Really, this is a question about implicit versus explicit reference of the drive. How do we build a self-consistent core application where we can allow folks to build off of the core contents provider without fear that things will break when say RTC is enabled?

What I found tricky when thinking about all the implications here is that Jupyter collaboration is kind of a special case.

The rtc:// and contents:// drive are (in principle) referencing the same file on disk using different server APIs; so in this case, you actually want to implicitly replace the contents:// drive with the rtc:// drive in all core plugins, unless a plugin explicitly fetches from contents://.

This differs from, say, jupyterlab-github's drive, github:// where most other plugins would never use an implicit path to fetch a file.

@Zsailer
Copy link
Member

Zsailer commented Apr 8, 2024

Really, this is a question about implicit versus explicit reference of the drive. How do we build a self-consistent core application where we can allow folks to build off of the core contents provider without fear that things will break when say RTC is enabled?

The root issue here is that the Jupyter Server REST APIs do not understand drive prefixes.

So the implicit versus explicit problem is really about what path the Jupyter Server can speak. Jupyter collaboration breaks things because it uses path prefixes that cause weird things to happen on the server.

For example, the Jupyter session database will have references to notebook paths that the server doesn't understand, thus, jumbling the "Running" tab in JupyterLab.

Another example of an issue is that Jupyter collaboration uses the file ID extension to store unique IDs for all notebook paths. When RTC is enabled, you'll begin to see two UUIDs for each notebook, one for the rtc:// prefixed path and non-prefixed path.

@martinRenou
Copy link
Member Author

martinRenou commented Apr 9, 2024

Instead of just changing the file browser, I would propose that we make the defaultDrive in the ContentsManager API configurable by outside plugins.

Indeed 👍🏽 totally agree with this, I found out later there was a defaultDrive for the contents manager and I also believe we should allow overwrite it.

Concerning the drive prefix, I assumed the default one was not using a prefix? So if we are able to overwrite the default drive in the case of collaboration, we can probably get rid of the rtc: prefix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants