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

Configure extensions from server CLI. #55

Closed
Zsailer opened this issue Jun 8, 2019 · 7 comments
Closed

Configure extensions from server CLI. #55

Zsailer opened this issue Jun 8, 2019 · 7 comments

Comments

@Zsailer
Copy link
Member

Zsailer commented Jun 8, 2019

This idea was raised in jupyterlab/jupyterlab#6451.

Problem: the classic notebook can configure both the server and the frontend from the CLI. This is helpful for scenarios where you are deploying jupyter servers from scripts. JupyterHub, for example, launches single-user server using the CLI entry points. Those running notebook or lab as server extensions cannot configure those frontends from the jupyter server CLI.

Soluton: I propose we add functionality to Jupyter Server that enables the jupyter server CLI to configure extensions (assuming they are configurable objects). This would require ServerApp to look for enabled, configurable extensions and dynamically add those classes to the ServerApp's classes trait.

@lresende
Copy link
Member

lresende commented Jun 8, 2019

Could you describe what is the user/consumer experience here? I believe @kevin-bates and I were talking about similar scenario for integrating EG on JupyterServer Phase 2.

@blink1073
Copy link
Contributor

For example, passing a spawner argument for JupyterLab in a JupyterHub deployment. (E.g. static_url if using a cdn).

@blink1073
Copy link
Contributor

@blink1073
Copy link
Contributor

cc @ian-r-rose

@Zsailer
Copy link
Member Author

Zsailer commented Jun 11, 2019

For example, imagine a user launches a jupyter_server with notebook and jupyterlab extensions enabled. They could configure those extensions from the CLI using:

jupyter server \
    --ServerApp.default_url='/lab' \
    --NotebookApp.enable_mathjax=False \
    --LabApp.workspaces_dir='/path/to/workspaces'

Any extension that's configurable and enabled could be configured from the CLI.

@Zsailer Zsailer added this to the Future milestone Dec 2, 2019
@Zsailer
Copy link
Member Author

Zsailer commented Apr 15, 2020

For example, imagine a user launches a jupyter_server with notebook and jupyterlab extensions enabled. They could configure those extensions from the CLI using:

jupyter server \
    --ServerApp.default_url='/lab' \
    --NotebookApp.enable_mathjax=False \
    --LabApp.workspaces_dir='/path/to/workspaces'

Any extension that's configurable and enabled could be configured from the CLI.

This works in #180. All CLI arguments are parsed by the ServerApp and stored in a general traitlets Config object. For example, the above command will create a config object that looks like:

Config({
    "ServerApp": {
        "default_url": "/lab"
    },
    "NotebookApp: {
        "enable_mathjax: False
    },
    "LabApp": {
        "workspaces_dir": "/path/to/workspace"
    }
})

This object is then passed to and shared by all the extensions. Each extension will update it's config with the piece that's relevant to its config.

We should close this issue once that is merged.

@Zsailer
Copy link
Member Author

Zsailer commented Apr 21, 2020

This is added in #180 and documented here.

@Zsailer Zsailer closed this as completed Apr 21, 2020
Zsailer added a commit to Zsailer/jupyter_server that referenced this issue Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants