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

A JupyterFrontend without polling endpoints by default #15890

Closed
Zsailer opened this issue Feb 29, 2024 · 3 comments
Closed

A JupyterFrontend without polling endpoints by default #15890

Zsailer opened this issue Feb 29, 2024 · 3 comments
Labels
enhancement status:Needs Triage Applied to new issues that need triage

Comments

@Zsailer
Copy link
Member

Zsailer commented Feb 29, 2024

Problem

Summary: ServiceManager requires all Jupyter Server endpoints to be authorized on instantiation.

I've been exploring having a new basic "Notebook application" that only allows real-time collaboration to edit the document (not run cells. etc). In other words, it doesn't have access to the kernel, session, or contents APIs (except the single endpoint that returns the one notebook they are viewing).

Naturally, I started from JupyterFrontend. The issue is JupyterFrontend requires a ServiceManager. The default (and only) implementation of the ServiceManager includes multiple subclasses IManagers for each service. The constructors of many of these managers starts polling (e.g. see sessions manager) their endpoints immediately.

This is problematic for my simple Notebook application, whose access is blocked to most of these endpoints.

Proposed Solution

Offer a ServiceManager that can be configured to not poll all of these endpoints. Because this happens in the constructor, it's difficult to remove this polling without overloading every part of the ServiceManager.

Additional context

I discussed this with @bollwyvl on the Jupyter Server call this morning. He pointed me to JupyterLite—since it suffers from the same issue. Cleverly, JupyterLite stubs out the fetch method to intercept outgoing requests.

@Zsailer Zsailer added enhancement status:Needs Triage Applied to new issues that need triage labels Feb 29, 2024
@jtpio
Copy link
Member

jtpio commented Feb 29, 2024

Thanks @Zsailer.

For reference, a need for a more modular / configurable was also expressed in #15329. So that each service of the service manager could be replaced by another plugin (or disabled), via regular extensions (or something similar).

Not sure if we should keep the conversation in one issue only? Unless the request in this issue is more about providing a way to disable the default polling.

I discussed this with @bollwyvl on the Jupyter Server call this morning. He pointed me to JupyterLite—since it suffers from the same issue. Cleverly, JupyterLite stubs out the fetch method to intercept outgoing requests.

Voila also provides custom managers when instantiating its custom ServiceManager: https://github.com/voila-dashboards/voila/blob/5aa861dc153215c66d8ccdff040f4ac868d7af3a/packages/voila/src/services/servicemanager.ts#L16-L26

@Zsailer
Copy link
Member Author

Zsailer commented Mar 1, 2024

Thanks, @jtpio 👍

Let's move this over to your issue. I'll close this and add comments to yours later today.

@JasonWeill
Copy link
Contributor

Closing in favor of #15329.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement status:Needs Triage Applied to new issues that need triage
Projects
None yet
Development

No branches or pull requests

3 participants