LibreTexts / metalc

LibreTexts/UCDavis bare-metal Kubernetes cluster running JupyterHub and Binder
http://jupyter.libretexts.org
MIT License
14 stars 2 forks source link

Investigate and Migrate to JupyterLab 3 #197

Closed sandertyu closed 3 years ago

sandertyu commented 4 years ago

Currently JupyterLab 3 is only available as a release candidate, and some of the major changes which affect us are to the way that extensions work. I'll post a bunch of links here which are tracking some of the JupyterLab issues for this transition so that we can keep up to date and figure out how to migrate when it comes out (probably over winter break?).

https://discourse.jupyter.org/t/jupyterlab-3-0-release-candidate-available/6248/6 https://github.com/jupyterlab/jupyterlab/issues/9118 (now closed by full 2.x -> 3.x migration guide, PR here) https://github.com/jupyterlab/extension-examples/tree/3.0 https://github.com/jupyterlab/jupyterlab/issues/8038

moorepants commented 4 years ago

In general, we should wait some months after its release so that it's bugs get ironed out. But maybe it is something we could launch Jan 2021 if it is ready.

sandertyu commented 3 years ago

JupyterLab3 is officially released; https://blog.jupyter.org/jupyterlab-3-0-is-out-4f58385e25bb

Issue on repo2docker about migrating; https://github.com/jupyterhub/repo2docker/issues/935

moorepants commented 3 years ago

We'll probably have to wait till various things that depend on jupyterlab are updated, so we should check this in a couple months again.

sandertyu commented 3 years ago

it looks like repo2docker is now using jupyterlab3. We can probably more actively try and migrate our default-env to jupyterlab 3. We should verify that all of the current widgets in the widget-testing repo have been updated for jlab v3. For now, I will pin our default-env to jlab 2 so that future builds will not get unexpectedly caught on jlab3. Hopefully this will override the one pinned in repo2docker.

moorepants commented 3 years ago

Interesting that build times for images will reduce because the extensions no longer have to be built: https://twitter.com/jtpio/status/1362409396022689811

sandertyu commented 3 years ago

All widgets that we support are compatible with jupyterlab3. We can build a new default-env with jupyterlab=3 soon for our default-env. There may be edge-cases where stuff is broken, but Jason seems pretty confident that very few things depend on jupyterlab (which is true, at least from a dependency standpoint).

sandertyu commented 3 years ago

Alright, I've built a default-env image with JupyterLab3 and it requires some testing on staging.jupyter.libretexts.org. I've removed the postBuild extension for the following packages and we'll want to test to verify that they all still work. According to their documentation, they should all be fine;

sandertyu commented 3 years ago

It also looks like our jupyterlab extension to add our faq to the help tab doesnt work with jupyterlab3. Will have to look for a fix or try to examine the debug file. The build failed and the pod quit before I was able to take a look;

first-console second-console

I should also note that i dont have a working image of jupyterlab3 on staging at the moment.

sandertyu commented 3 years ago

I've managed to make a new default-env which builds successfully with the extension, but the extension does not work ie the libretexts logo button in the 'help' tab is not there. jupyter labextension list says that it is properly enabled, so maybe some code needs to be changed.

The migration script outlined in the docs gives you a prompt to overwrite certain things within the directory. I answered yes to most/all of them, maybe using different overwrite settings would make it work?

moorepants commented 3 years ago

The best thing would be ask for help in the jupyter discourse or their ?gitter? chat channel.

sandertyu commented 3 years ago

I've built a default-env where the JupyterHub FAQ extension works properly, but none of the other extensions work properly. Tracing the errors in the console, I came across this jupyter thread (my console errors were the same as the thread creator's). However, jupyter labextension list shows that they are all installed and enabled, but when I try to run code which uses the widgets I get "widget not displaying" errors. I'll probably make a thread about this new issue.

moorepants commented 3 years ago

I'll probably make a thread about this new issue.

Definitely ask asap.

sandertyu commented 3 years ago

Okay, so it turns out that ipyvolume is specifically broken in JupyterLab3 (the interface), but not on jupyterlab=3 in general (such as in a notebook through Binder, or in Thebe). Once it is removed, the rest of default-env functions properly and it can be seen on staging. We can move forward to jupyterlab=3 and temporarily drop ipyvolume until they fix it in JupyterLab3, or we can remain on jupyterlab=2 until the maintainers fix it. I've sent them on brief message already with a possible suggestion for fixing the package.

I don't believe that any people are using ipyvolume on our platforms, and moving to jupyterlab=3 would allow us to fix ipycytoscape again (which doesnt work on Thebe/Libretexts but does on JupyterLab currently). It's up to @moorepants I think.

moorepants commented 3 years ago

I don't believe that any people are using ipyvolume on our platforms

This may be true on libretexts, but what about on the hub? It's best not to remove features unless we are sure that noone is using it. There are open PRs on ipyvolume about jlab3: https://github.com/maartenbreddels/ipyvolume/pulls

sandertyu commented 3 years ago

we've migrated everywhere, but dropped ipyvolume for now until it works properly in jlab3