Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 10:52
    blink1073 demilestoned #504
  • 10:52
    blink1073 milestoned #504
  • 10:52
    blink1073 milestoned #513
  • 10:52
    blink1073 demilestoned #513
  • 10:52
    codecov-commenter commented #516
  • 10:52
    codecov-commenter commented #516
  • 10:51
    codecov-commenter commented #516
  • 10:49
    codecov-commenter commented #516
  • 10:49
    codecov-commenter commented #516
  • 10:46
    blink1073 labeled #516
  • 10:46
    blink1073 milestoned #516
  • 10:46
    codecov-commenter commented #516
  • 10:46
    blink1073 synchronize #516
  • 10:46

    blink1073 on changelog-2bc0d316b17c11ebb700536d61952f8d

    Combine changelog entries (compare)

  • 10:44
    codecov-commenter commented #516
  • 10:43
    codecov-commenter commented #516
  • 10:43
    codecov-commenter commented #516
  • 10:43
    codecov-commenter commented #516
  • 10:40
    blink1073 opened #516
  • 10:40

    blink1073 on changelog-2bc0d316b17c11ebb700536d61952f8d

    Automated Changelog Entry for 1… (compare)

Erik Sundell
@consideRatio

Hi :D Thanks for your work on jupyter-server :heart:

I have recently installed JupyterLab 3 and made a JupyterHub i manage start the user servers with a ServerApp.

When I was using NotebookApp visiting /user/erik/rstudio/ would work fine, but now when using ServerApp and JupyterHub 1.3.0, it seems that visiting /user/erik/rstudio/ redirects to /auth-sign-in?appUri=%2F which bounce to /hub/auth-sign-in?appUri=%2F which jupyterhub doesn't recognize and responds with 404.

Could it be that the base_url isn't considered when this redirect is made? This may relate to how jupyterhub/server-proxy and jupyterhub/jupyter-rsession-proxy rather, or jupyterhub itself, or something else...

Anyone with ideas on what goes wrong?

(note that /user/erik/lab works just fine)
Steven Silvester
@blink1073
hi @consideRatio! It looks like jupyter-server-proxy needs a new release with jupyterhub/jupyter-server-proxy#235.
Erik Sundell
@consideRatio
@blink1073 :heart: thanks for your help! I can arrange that release to happen!
Vidar Tonaas Fauske
@vidartf
This is probably going to relevant for the discussion about how to organize pytest plugins etc: https://docs.pytest.org/en/stable/deprecations.html#pytest-plugins-in-non-top-level-conftest-files
especially since the top-level directory will change depending on whether you are running from a dev install, or with --pyargs package_name
Zachary Sailer
@Zsailer
Just released jupyter_server 1.4.0 :tada:
Carl Cochran
@CarlCochran
Hello, I have found that I have a good use case to modify jupyter_server, probably the contents API, and nbformat in order to add a UUID metadata value that can be targeted by query string (something like, .../api/contents?notebook_uuid=<random uuid>) and thus open a matching notebook no matter what its path is. Therefore, if a user changes the notebook's path it can still be found with the same uuid. Any idea what the chances are that such a pull request would be accepted? Or is there already a way that this can be done?
Zachary Sailer
@Zsailer
Hi @CarlCochran, good question. Generally, changes to nbformat and the Jupyter server’s REST API require a Jupyter Enhancement Proposal (JEP). You can always submit a PR as a proof-of-concept before a JEP, but it likely won’t get merged without JEP-level approval. The reason is that nbformat and REST API changes affect multiple projects.
So we need the broader community to review and comment on the idea
The “Cell ID” JEP (jupyter/enhancement-proposals#62) is a good example to check out.
Cell ID added to the nbformat and requires Jupyter frontends to adjust.
The proposal’s PR (in the link above) demonstrates the level of review and discussion that happens
Carl Cochran
@CarlCochran
Fantastic, thank you.
Mariko Wakabayashi
@mwakaba2
Hi there! I'm trying to enable an extension called tensorflow_model_analysis. This extension tries to load a javascript file when executing a function in a notebook cell. It tries to load by requesting this path: https://localhost:8888/nbextensions/tensorflow_model_analysis/vulcanized_tfma.js, but returns a 404 not found error. The extension readme suggests I only need to install the python package and the extension via jupyter labextension, but I was wondering if I need to also specify this package in jpserver_extensions to access the path. The javascript files are added in the python package's shared/jupyter directory. Has anyone run into a similar issue?
Zachary Sailer
@Zsailer
Hi Mariko! Are you using the classic notebook UI?
this looks like a classic notebook extension (based on the /nbextension prefix in the URL)
If you're using JupyterLab 3.0 + Jupyter Server, you'll want to make sure that nbclassic is installed and enabled.
Looking at tensorflow_model_analysis now—it looks like it only supports JupyterLab 2.0
which means it uses the classic notebook server.
What happens when you call
jupyter nbextension list
?
Mariko Wakabayashi
@mwakaba2
No that's been disabled. I'm using Jupyterlab 2.2.9.
The nbextension list command returns
Known nbextensions:
It 's enabled as a labextension
$ jupyter labextension list
tensorflow_model_analysis v0.26.0  enabled  OK
Zachary Sailer
@Zsailer
You may need to enable its notebook extension as well?
  jupyter nbextension enable --py widgetsnbextension
  jupyter nbextension enable --py tensorflow_model_analysis
The URL above with the 404 is a classic notebook extension URL
Mariko Wakabayashi
@mwakaba2
mh I see, I'll try that. This works locally in the jupyterlab interface, but I'm having issues getting it to work in a hosted environment with jupyter_server in the backend.
Zachary Sailer
@Zsailer
well, jupyterlab 2.2.9 doesn’t use the jupyter_server backend… It uses the tornado server provided in jupyter/notebook
jupyterlab 3.0 made the switch to jupyter_server
although, you could be running jupyter_server and attaching jupyterlab 2.2.9 as an old classic extension on top of jupyter_server… is that what you’re doing on your hosted environment?
Mariko Wakabayashi
@mwakaba2
yep, I think my local environment is using the jupyter/notebook backend, but the hosted is setup to use 2.2.9 with jupyter_server as the backend.
Zachary Sailer
@Zsailer
i see. you probably need to install NBClassic on your remote system then…
the /nbextension handler doesn’t come with jupyter_server. nbclassic provides it separately.
Mariko Wakabayashi
@mwakaba2
ok that makes sense. I'll try that. thanks Zach!
Zachary Sailer
@Zsailer
no problem! let me know if that works. this is a corner case I never considered, so I’m really glad you asked.
Mariko Wakabayashi
@mwakaba2
yeah it works after enabling nbclassic and the nbextensions!
Frédéric Collonval
@fcollonval
Hey I got a question on a server extension running long actions (mamba-org/gator#132) that delay shutting down the server. Is there a way to be notified the server wants to shutdown? Cheers
Kevin Bates
@kevin-bates
There are no “event hooks” like this currently, but it makes sense and seems generally useful. I don’t know if this has been brought up in terms of the notebook server (so I’m not sure if there’s something obvious preventing this), but seems like a nice “server thing” to offer extension authors.
Steven Silvester
@blink1073
@fcollonval mind opening an issue for this?
Frédéric Collonval
@fcollonval
Hey thanks for the feedback. I created an issue: jupyter-server/jupyter_server#466
Carl Cochran
@CarlCochran

Hello! I have been trying to create a custom extension in Jupyter Server, and I do not understand the error message happening when I attempt to enable it. What is it saying is the problem?

Enabling notebook extension /home/ubuntu/.local/share/jupyter/nbextensions/remote_execution_extension.py...
      - Validating: problems found:
        - require?  X /home/ubuntu/.local/share/jupyter/nbextensions/remote_execution_extension.py

I used these guides to create my modules and integrate:
https://jupyter-notebook.readthedocs.io/en/stable/extending/handlers.html
https://jupyter-contrib-nbextensions.readthedocs.io/en/latest/install.html

Kevin Bates
@kevin-bates

Hi Carl - I'm not very well-versed in server extensions, but based on the links you provided and the error message, it looks like you might be using jupyter nbextension to register a server extension as this error is coming from notebook/nbextensions.py when a required java script file is not present. (I agree, the messaging could be more helpful.)

Since you'd like to author a Jupyter Server extension, please have a look at https://jupyter-server.readthedocs.io/en/stable/developers/extensions.html as server extension authoring has slightly changed in jupyter_server. Also note that jupyter serverextension ... is used for managing Notebook server extensions, while jupyter server extension ... is used for managing Jupyter Server server extensions.

Carl Cochran
@CarlCochran
@kevin-bates Thank you for your response! I tried changing to jupyter server extension and I still get the same error. But I also do not see on the link you provided any reference to a required JavaScript file that might be missing.
Kevin Bates
@kevin-bates

@CarlCochran - the link I provided was for how to author a server extension for use in jupyter server. If your extension is more front-end related, then I suspect you’d need to look into the authoring of lab extensions.

For tracking down the error, a grep in the notebook repo yields this area of code to validate an nbextension (which, I believe, is more of a front-end thing) and led me to think you might just be using the wrong application to register your extension: https://github.com/jupyter/notebook/blob/8ca28879202296176d8d9b6ba76704462d1dcd1b/notebook/nbextensions.py#L501-L540

I tried changing to jupyter server extension and I still get the same error

Could you please list the command you’re running along with the error output. The jupyter_server repo has no such require? string in it. (I really hope I’m not leading you down the wrong path. )

I now realize that server extensions are discovered and not registered. As I said, I’m not well-versed in these things. :smile:
Carl Cochran
@CarlCochran

@kevin-bates My extension is to add a custom API endpoint to Jupyter Server, so it should not be a Lab extension I believe.

Using jupyter --paths I found that /home/ubuntu/.local/share/jupyter/ is listed as a data directory. So I created /nbextensions/ in it, added that to PYTHONPATH, and placed __init__.py and myModule.py which contains MyHandler class as well as _load_jupyter_server_extension from the setup guide. The init contains the _jupyter_server_extension_points() function from the setup guide (with a module key in its return value as described, but it's not clear the format of the value to be used for it - I currently have the full disk path of myModule.py).

With these in place, I try to use the command line to enable it:

ubuntu@8e5731a06719:~$ jupyter server extension enable myModule
Enabling: myModule
- Writing config: /usr/etc/jupyter
    - Validating myModule...
      X Validation failed: The submodule 'MyHandler' could not be found. Are you sure the extension is installed?

Alternatively, I try to launch the Jupyter Server with those things in place and these in the jupyter_server_config.py:

c.ServerApp.setdefault('jpserver_extensions', {})['jupyter_nbextensions_configurator'] = True
c.ServerApp.jpserver_extensions = {
  'myModule.MyHandler': True,
}

But the server startup logging has these lines:

jupyter_1  | [W 2021-05-05 14:37:53.849 ServerApp] The module 'myModule.MyHandler' could not be found. Are you sure the extension is installed?
jupyter_1  | [W 2021-05-05 14:37:54.160 ServerApp] jupyter_nbextensions_configurator | extension failed loading with message: 'nbextensions_path'
Kevin Bates
@kevin-bates
cc: @echarles and @Zsailer since they have much deeper knowledge of JS server extensions.
Eric Charles
@echarles

@CarlCochran A few background.

  • Jupyterlab3 runs on the jupyter server, whereas juptyer2 runs on the claissic notebook sever.
  • There are 2 types of “server" extensions: 1) the classic notebook extensions (nbextensions) 2) the server extensions
  • Jupyter server has a shim to recognize automatically the classic notebook extensions that are installed

If you are looking to develop a server extension for e.g. jupyterlab 3, you should not try to develop a nbclassic one, but the server one (see simple examples on https://github.com/jupyter-server/jupyter_server/tree/master/examples/simple)

David Brochart
@davidbrochart
Hi, I'm working on a Jupyter Server extension, which has an enpoint decorated with @tornado.web.authenticated, and when I enter a URL for that endpoint in a different browser than the one that was launched by jupyter lab, I get a valid response, with just a warning in the terminal:
[W 2021-05-06 15:29:07.611 ServerApp] Content security violation: {...}
is it the normal behavior?