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

Depend on jupyter-server only, compatibility with jupyter server >= 2, notebook < 7 #240

Merged
merged 6 commits into from
Jul 31, 2023

Conversation

manics
Copy link
Member

@manics manics commented Jan 3, 2022

Looks like notebook is still hanging around and affecting some paths

Closes #235

Copy link
Member

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I'm on mobile, assuming circleci failure is unrelated.

@yuvipanda
Copy link
Contributor

@yuvipanda
Copy link
Contributor

Will this still work in cases where jupyterhub-singleuser is the process being run?

@akhmerov
Copy link

I have this PR deployed in production (small scale production), and it seems to work—thanks for the fix!

@consideRatio
Copy link
Member

@akhmerov do you run a jupyterhub, if so, what version, and also if possible: with what commands are jupyter servers started?

@yuvipanda i feel a bit inactionable to help nudge this PR to address your review question about jupyterhub-singleuser because i dont understand the connection there may be. Are you looking for an empirical test or is there something specific we should watch out for that can make a setup involving jupyterhubb-singleuser break?

@yuvipanda
Copy link
Contributor

Are you looking for an empirical test or is there something specific we should watch out for that can make a setup involving jupyterhubb-singleuser break?

Thank you for the specific question! So in general I'm super confused about jupyter_server and how it interacts with either jupyterhub-singleuser or jupyter-labhub. I am also not entirely sure wether jupyterhub 2.0 requires that the user run jupyter-labhub inside the user container, or if the existing jupyterhub-singleuser is enough.

So the test for me is - on an installation that's just running jupyterhub-singleuser inside the container (that is the process started by the spawner), will this PR break nbgitpuller?

@akhmerov
Copy link

akhmerov commented Jan 18, 2022

I run jupyterhub==2.0.2 and in the container I see /opt/conda/bin/python /opt/conda/bin/jupyterhub-singleuser --ip=0.0.0.0 (our container is derived from docker-stacks but with customizations.

I didn't mean to influence the discussion, but FWIW jupyterhub-singleuser seems to play nicely with jupyterlab: I see the hub control panel menu option, and lab is opened as the default interface.

@consideRatio
Copy link
Member

I lean towards thinking this is fine and good, but i dont understand it is or isnt with confidence. I think that holds back both me and yuvi from merging atm.

One action point to help me dare merge this pr is to provide some discussion if this is a breaking change or not.

@minrk
Copy link
Member

minrk commented May 23, 2023

This is breaking, and indeed drops support for the notebook server entirely because auth will fail with Jupyter Server 2 when notebook is the launch application, as seen in this failure:

FAILED tests/test_api.py::test_clone_default[jupyter-notebook] - assert 302 == 200
 +  where 302 = <http.client.HTTPResponse object at 0x7f1661993040>.code
FAILED tests/test_api.py::test_clone_targetpath[jupyter-notebook] - assert 302 == 200
 +  where 302 = <http.client.HTTPResponse object at 0x7f1661916880>.code

This is supposed to work (jupyter-server/jupyter_server#1221), but doesn't right now. Even with that fix, it will likely stop working eventually as Jupyter Server moves further away from the classic notebook server setup.

If we want to keep support for both applications, we should use a shim to always use the right base handler class, as I do in ipyparallel, here.

@minrk minrk added the bug label May 23, 2023
@minrk minrk changed the title Depend on jupyter-server only Depend on jupyter-server only, compatibility with jupyter server >= 2, notebook < 7 May 23, 2023
@minrk
Copy link
Member

minrk commented May 23, 2023

I added the compatibility shim and a test, so this should work correctly on any version or implementation of notebook or jupyter server. It's no longer breaking, purely a compatibility fix.

Change:

  • jupyter-server is the only install-time dependency (and therefore assumed present at runtime)

Fix:

  • correct jupyter-server base JupyterHandler class will be used when jupyter-server is launched (no change when notebook server is launched)

@jtpio
Copy link

jtpio commented Jul 31, 2023

FYI Notebook 7 final is now released: https://github.com/jupyter/notebook/releases/tag/v7.0.0

And this PR would help have a version of nbgitpuller working with Notebook 7.

@manics manics closed this Jul 31, 2023
@manics manics reopened this Jul 31, 2023
@yuvipanda
Copy link
Contributor

Thanks a lot for getting this set up, @minrk!

@yuvipanda yuvipanda merged commit 4f4fa76 into jupyterhub:main Jul 31, 2023
@manics manics deleted the jupyter-server branch July 31, 2023 17:47
@consideRatio
Copy link
Member

Argh so I'm really not sure how to label this PR.

It can be seen as a bug not supporting jupyter_server 2, which was released before nbgitpuller got support for functioning against it, but I also think this kind of in the maintenance / enhancement / new category as well, and I think maybe we should provide a minor release for this PR rather than a patch release?

@consideRatio
Copy link
Member

I went for enhancement and will open a changelog PR for 1.2.0

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

Successfully merging this pull request may close these issues.

Incompatible with jupyter-labhub
6 participants