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

[ExtensionApp] "standalone" mode #64

Closed
SylvainCorlay opened this issue Jul 10, 2019 · 12 comments
Closed

[ExtensionApp] "standalone" mode #64

SylvainCorlay opened this issue Jul 10, 2019 · 12 comments

Comments

@SylvainCorlay
Copy link
Contributor

SylvainCorlay commented Jul 10, 2019

I was looking at the extension app mechanism, and I have some thoughts for the voila use case.

  • Ideally, I would like to have the voila command line to become an alias on jupyter voila. A byproduct will be that we should be able to drop the VoilaConfiguration mixin used by both the tornado application and the server extension...

  • Now, one thing about the voila command line that we would lose, is the guarantee that other server extensions are not enabled. The reason is that we generally want voila to be used to produce standalone web app that don't allow arbitrary code execution. Enabling the lab server extension defeats the purpose, because it would provide a means to access and execute code...

  • So an idea would be to have a --standalone option that only enables the selected server extension and not the other ones. Then voila would make use of jupyter voila --standalone...

cc @rolweber @Zsailer @epifanio

@SylvainCorlay
Copy link
Contributor Author

Another option would be to have each extension app decide whether they allow other server extensions or not when they are used as the main extension point.

@rolweber
Copy link
Contributor

I thought that the selected app is responsible for enabling all extensions that should be running, besides the default stuff that comes with Jupyter Server itself. So if the Voila extension doesn't enable Lab, then Lab isn't there. Am I mistaken there?

@vidartf
Copy link
Member

vidartf commented Jul 10, 2019

Ideally, I would like to have the voila command line to become an alias on jupyter voila.

Just for context, what is the motivation for this?

@SylvainCorlay
Copy link
Contributor Author

Just for context, what is the motivation for this?

This would reduce the number of entry points and simplify the codebase (e.g. no need for a VoilaConfiguration object).

@SylvainCorlay
Copy link
Contributor Author

In a way, voila and lab are two perfect examples of extension apps...

@Zsailer
Copy link
Member

Zsailer commented Jul 10, 2019

In the current ExtensionApp class, VoilaConfiguration already goes away (I desperately need to add documentation to demonstrate this).

In PR #59, I added logic to handle the extension-specific config. That way, extensions writers don't need to write their own mixin classes (like VoilaConfiguration).

How does this work?

  • ExtensionApp creates a Configurable object to store the extension's trait
  • It then passes this object to tornado web-servers settings under the '<extension_name>_config' key.
  • If the extensions' handlers inherit the provided ExtensionHandler class, this object is accessible under the handler's self.config attribute.

@Zsailer
Copy link
Member

Zsailer commented Jul 10, 2019

I'm also fine with adding a --standalone mode.

@SylvainCorlay
Copy link
Contributor Author

In the current ExtensionApp class, VoilaConfiguration already goes away (I desperately need to add documentation to demonstrate this).

Yep, but I guess this requires the voila command line to be an alias on jupyter voila.

I'm also fine with adding a --standalone mode.

👍

@Zsailer
Copy link
Member

Zsailer commented Jul 10, 2019

Yep, but I guess this requires the voila command line to be an alias on jupyter voila.

I think you're right.

You could, instead, have a small subclass that inherits the Voila ExtensionApp, changes the standalone trait to True, set this trait's tag config=False, and add a new voila entry-point pointing to this classes launch_instance method.

@Zsailer
Copy link
Member

Zsailer commented Aug 3, 2019

Adding in #70

@Zsailer
Copy link
Member

Zsailer commented Aug 26, 2019

We added the option for ExtensionApps to shut off other extensions in #76

@Zsailer Zsailer added this to the 0.2.0 Release milestone Dec 2, 2019
@Zsailer
Copy link
Member

Zsailer commented Dec 2, 2019

Closing since we added standalone mode in #76.

@Zsailer Zsailer closed this as completed Dec 2, 2019
Zsailer added a commit to Zsailer/jupyter_server that referenced this issue Nov 18, 2022
* port JWT authenticator/handler to this repo

* thread authentication traits throughout app

* add aliases for simple help docs

* use inherited config for comon config

* enable JWT authentication

* working tests

* enable nbclassic/lab
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.

4 participants