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

JupyterLab - the default? #776

Closed
consideRatio opened this issue Jul 21, 2018 · 44 comments · Fixed by #2449
Closed

JupyterLab - the default? #776

consideRatio opened this issue Jul 21, 2018 · 44 comments · Fixed by #2449

Comments

@consideRatio
Copy link
Member

What we decide on to be the default matters a great deal. I think we should make it so that the default is to use jupyterlab.

Yay or nay?

@consideRatio consideRatio added this to the 0.7 milestone Jul 21, 2018
@betatim
Copy link
Member

betatim commented Jul 23, 2018

I would wait until there is a none beta release of JupyterLab.

@choldgraf
Copy link
Member

IMO we can also let the JupyterLab community guide us on this.

@ian-r-rose @jasongrout @ellisonbg it'd be great if, over time, y'all could give us ideas for when to start "defaulting" to jupyterlab.

@consideRatio
Copy link
Member Author

Lab Notebook Me
image image image

@choldgraf
Copy link
Member

lol that's amazing

@ellisonbg
Copy link

ellisonbg commented Aug 1, 2018 via email

@consideRatio
Copy link
Member Author

Yaaaaaaaaaaaaaaaaaaay!!!!!

Well the base notebook that we are using as the default image for a z2jh deployment, got bumped YESTERDAY to JupyterLab 0.33!!!

I say let's do it!

@ellisonbg
Copy link

ellisonbg commented Aug 1, 2018 via email

@choldgraf
Copy link
Member

wow I didn't realize that beta would get dropped so soon. hmmm, in this case I am more open to JupyterLab by default.

My main question is: @ellisonbg and others, what's your main experience with "first timers" seeing JupyterLab? Are we at a point where there's enough good documentation out there that it doesn't scare people away w/ the extra complexity?

consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 2, 2018
consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 2, 2018
@ellisonbg
Copy link

ellisonbg commented Aug 2, 2018 via email

@betatim
Copy link
Member

betatim commented Aug 2, 2018

One of the big lessons of the Python 2 -> 3 transition for me was "more carrot, less stick." I want people to switch to lab because there are so many great, cool things that they want to use it - not because we force them to.

Maybe we can start with making "change to using lab by default" a recommended first task/exercise for customising your hub. So either add it to https://zero-to-jupyterhub.readthedocs.io/en/latest/setup-jupyterhub.html or link to "change to lab" as the next step?

@consideRatio
Copy link
Member Author

@betatim I like it! I think it will be a z2jh maintainer experience, setting something up without trouble and things just work (because it is just adding /lab to singleuser.defaultUrl I think).

@ellisonbg thanks for this write up! Getting such experience isn't easy, so I consider being able to pick up on your insights very valuable to me! By the way, regarding the horrible user experience of running out of memory - jupyterhub/kubespawner#223 (and duplicated on JupyterHub: jupyterhub/jupyterhub#2043)

consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 2, 2018
@choldgraf
Copy link
Member

I like the idea of making the documentation for this step more front-and-center. That's a nice compromise!

@gweis
Copy link

gweis commented Aug 3, 2018

I think jupyterhub/kubespawner#149 is related as well.

consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 12, 2018
consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 14, 2018
@minrk minrk removed this from the 0.7 milestone Aug 16, 2018
consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 19, 2018
consideRatio added a commit to consideRatio/zero-to-jupyterhub-k8s that referenced this issue Aug 19, 2018
@manics
Copy link
Member

manics commented Jun 10, 2020

Any more thoughts .... should we handle this alongside jupyterhub/repo2docker#724 ?

@choldgraf
Copy link
Member

I think that we could make the default different in Z2JH before we do it in repo2docker since it affects fewer users. That said, I am not sure what's the criteria that we should use to switch. Perhaps if we get some data saying that a majority of users prefer the JupyterLab interface to the notebook interface?

@ellisonbg
Copy link

ellisonbg commented Jun 12, 2020 via email

@choldgraf
Copy link
Member

@ellisonbg that is both

  1. Very exciting to hear about the single document mode (will it be activate-able via the launch command? then that should be an easier switch for z2jh and binder)
  2. Sounds like a good criteria for switching to me

@ellisonbg
Copy link

ellisonbg commented Jun 12, 2020 via email

@choldgraf
Copy link
Member

my understanding is that this issue is just about the default, not dropping support (which IMO would be a more drastic change than just changing the default)

@manics
Copy link
Member

manics commented Feb 22, 2021

Definitely keeping both, and only changing the default.

Though I'm wondering if there's a nicer way to do this than

set singleuser.defaultUrl to /lab instead of / (and change the singleuser.cmd to jupyter-labhub ?).

Is there a way we can set the default in the singleuser image only, and have JupyterHub agnostic to the default?

@consideRatio
Copy link
Member Author

consideRatio commented Feb 22, 2021

Is there a way we can set the default in the singleuser image only, and have JupyterHub agnostic to the default?

I'm not sure, but I think the answer depends on various parts to consider.

  • ServerApp / NotebookApp? Docker image dependent, as long as one is present any combination is viable I think.
  • JupyterLab 2 or JupyterLab 3? Docker image dependent, but our sample image should come with JupyterLab 3 rather than 2.
  • Startup script within Docker image:
    By installing JupyterHub, there are a few entrypoints installed by default.

One example of a working configuration is to have:

# jupyter_server / ServerApp will be used i think
singleuser:
  cmd: start-singleuser.sh # z2jh default!
  defaultUrl: /lab
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp

I think another is...

# notebook / NotebookApp will be used will be used i think
singleuser:
  cmd: jupyter-labhub
  defaultUrl: /lab

@yuvipanda
Copy link
Collaborator

https://discourse.jupyter.org/t/poll-should-zero-to-jupyterhub-switch-to-jupyterlab-as-the-default-user-interface/8001 had 40 participants, and a 90% approval. I now suggest we:

  • Write docs on how to switch back to classic notebook, and why you might do so
  • Write bold bold letters in the changelog that this will change default behavior! And how you can get back the old one
  • Figure out story for images that don't have JupyterLab installed
  • Figure out story for images that only have JupyterLab 2.0 installed (it needs a different command)
  • Make the switch

Thanks everyone for working on this :)

I don't think we should switch to jupyter-server yet though. One at a time?

@meeseeksmachine
Copy link

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/poll-should-zero-to-jupyterhub-switch-to-jupyterlab-as-the-default-user-interface/8001/3

@manics
Copy link
Member

manics commented Mar 12, 2021

JupyterLab 3 already requires jupyter-server. How would changing to JupyterLab but not jupyter-server differ from changing to both?

@yuvipanda
Copy link
Collaborator

I'm very confused about it too :) I think it's the process you start that makes a difference. Primarily, I don't know what effect running jupyter-server has on serverextensions, since those heavily import from the notebook package. And I'm guessing the nbclassic package has differences from what's offered in the notebook package.

@Zsailer
Copy link
Member

Zsailer commented Mar 12, 2021

@yuvipanda I don't know what effect running jupyter-server has on serverextensions,

A lot of work was done to make sure jupyter-server is backwards compatible with old extensions, i.e. that all old server extensions are automatically discovered by jupyter-server via nbclassic (jupyter/nbclassic#12). NBClassic must be installed/enabled for this to work; fortunately, JupyterLab depends on nbclassic. In theory, old server extensions should just work (famous last words).

nbclassic mirrors the classic notebook package. It actually depends on notebook and uses its JS assets for rendering the notebook. It forks the tornado handlers, but they are essentially the same at this point in time.

There is a list of PRs that still need porting between notebook and jupyter-server, so jupyter-server differs slightly from the classic notebook server in this way.

since those heavily import from the notebook package

Old server extensions do import from the notebook package—mostly just IPythonHandler—but they still work seamlessly with jupyter-server.

@manics How would changing to JupyterLab but not jupyter-server differ from changing to both?

JupyterLab 3.0's entrypoint uses jupyter-server's tornado server; it is possible to use the classic notebook server and add JupyterLab 3.0 to notebook's nbserver_extension list.

With JupyterLab 3.0 + jupyter-server, jupyterhub users would get:

  1. JupyterLab 3.0 and it's sweet new federated extension mechanism
  2. Notebook's UI (via nbclassic)
  3. nbserver_extensions (via nbclassic) and jpserver_extensions (via jupyter_server)

@manics
Copy link
Member

manics commented Mar 16, 2021

@yuvipanda Does the above comment deal with your concerns around switching to jupyter-server? If so we could default to jupyterlab and jupyter-server, release an RC with a big announcement on discourse asking people to test, and if there are no major issues after a month release Z2JH?

@yuvipanda
Copy link
Collaborator

I trust @Zsailer :D

@manics
Copy link
Member

manics commented Mar 22, 2021

Do you think we could achieve this by working with the docker-stacks maintainers instead of overriding it in Z2JH?
https://discourse.jupyter.org/t/pyspark-library-is-missing-from-jupyter-pyspark-notebook-when-running-with-jupyterhub-zero-to-jupyterhub-k8s/8450
was caused by singleuser.cmd overriding the default start-notebook.sh. Setting singleuser.cmd = None (i.e. revert to the Docker image default) works with JupyterHub since start-notebook.sh detects when it's running under JupyterHub:
https://github.com/jupyter/docker-stacks/blob/3395de4db93ada5e8eb0fd7da70a1a32ce4b8381/base-notebook/start-notebook.sh#L12-L14

If for example the default in docker-stacks was jupyterlab then we could remove the singleuser.cmd override and everyting would just work ™

@parente
Copy link
Member

parente commented Mar 22, 2021

👋 @manics jupyter/docker-stacks#1217 is a good place to chime in about changing the default in docker-stacks.

@meeseeksmachine
Copy link

This issue has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/how-to-define-spawner-args-with-a-dict-using-new-traitlets-format/8714/1

@consideRatio consideRatio removed this from the 1.0.0 milestone May 15, 2021
@manics
Copy link
Member

manics commented Sep 15, 2021

JupyterHub 2 will be out soon, which means it might be time for Z2JH 2 😃. Shall we try and figure out something that works? If we can pass all the relevant options as environment variables that minimises breakage of other singleuser implementations.

@minrk
Copy link
Member

minrk commented Sep 23, 2021

I've realized that jupyterhub 2.0 is probably a good time to switch the default for jupyterhub itself as well jupyterhub/jupyterhub#3615

That means the default with jupyterhub 2.0 will be lab if z2jh does nothing. z2jh deployments can opt-in to the classic server with

singleuser:
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: notebook.notebookapp.NotebookApp

Then zj2h doesn't need to do anything, and can rely on the defaults of the underlying implementation.

@minrk
Copy link
Member

minrk commented Sep 23, 2021

other valid configs:

lab default UI, but keep legacy server (this is what BinderHub does, but I think it's maybe not the right choice when it's easier for a deployment to specify its choice. Behavior should be less surprising if when you see jupyterlab, you get the behavior as similar as possible to a local jupyter lab):

singleuser:
  defaultUrl: '/lab'
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: notebook.notebookapp.NotebookApp

server app, legacy UI default:

singleuser:
  defaultUrl: '/tree'
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp

@minrk
Copy link
Member

minrk commented Sep 23, 2021

or retrolab:

singleuser:
  defaultUrl: '/retro/'

  # below only required for jupyterhub 1.x, after https://github.com/jupyterhub/jupyterhub/pull/3615
  extraEnv:
    JUPYTERHUB_SINGLEUSER_APP: jupyter_server.serverapp.ServerApp

@minrk
Copy link
Member

minrk commented Sep 23, 2021

In general, most extension-based apps are simpler with ServerApp because you only need to:

  1. install the extension in the image
  2. enable the extension (usually installation does this already, so nothing to do here)
  3. set the default URL to the extension prefix (/lab = jupyterlab, /retro = retrolab, /tree = nbclassic)

This works today if you set JUPYTERHUB_SINGLEUSER_APP=jupyter_server.serverapp.ServerApp in 1.3+ and 2.0b1, but that step is unnecessary after jupyterhub/jupyterhub#3615 .

Using extension apps as JUPYTERHUB_SINGLEUSER_APP should also work, but jupyterhub/jupyterhub#3617 makes it a little complicated. ExtensionApps also usually only do a couple of things:

  1. set default url (can be done separately)
  2. ensure the extension is enabled (avoids possible config issues where it could be disabled somehow, but usually not an issue)
  3. expose different cli flags, which shouldn't usually be relevant to jupyterhub entrypoints

@minrk
Copy link
Member

minrk commented Sep 23, 2021

#2398 adds the above examples, and some explanation (too much?) about choices between servers and UIs. All the examples should work the same on JupyterHub 1.x and 2.x, regardless of the defaults.

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