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

Update lite build in documentation #83

Merged
merged 7 commits into from
Feb 20, 2024

Conversation

martinRenou
Copy link
Member

@martinRenou martinRenou commented Feb 14, 2024

  • Switch to using jupyterlite-xeus
  • Install dev version of jupyterlab-blocky in documentation Does not work actually

Copy link
Contributor

Binder 👈 Launch a Binder on branch martinRenou/jupyterlab-blockly/update_lite_build

@martinRenou
Copy link
Member Author

martinRenou commented Feb 14, 2024

This seems to be working now:

Screenshot from 2024-02-14 14-42-06

I see two issues though:

  • the blockly UI is not in english?
  • the kernel UI does not show up

Screenshot from 2024-02-14 15-02-48

@DenisaCG
Copy link
Member

Thank you for working on this @martinRenou!

I'm not sure what the issue with the language or the UI is, but it might be coming from the version of the blockly library we are using. I will look into it.

@martinRenou
Copy link
Member Author

Thanks!

@DenisaCG
Copy link
Member

the blockly UI is not in english?

Did you use the development install aspip install -e . ".[dev]"?
And was your JupyterLab originally set in English? Did you have other language packages installed? @martinRenou

@martinRenou
Copy link
Member Author

Sorry I did not clarify, the screenshot was taken from the readthedocs deployment for this PR:

https://jupyterlab-blockly--83.org.readthedocs.build/en/83

This build uses the environment https://github.com/QuantStack/jupyterlab-blockly/pull/83/files#diff-4c1832e89e371aa749c45d5942a4b294b068f05c43e1ffc2e16457331c3d020eR1

@DenisaCG
Copy link
Member

After some debugging, the error with the JupyterLite deployment of jupyterlab-blockly seems to come from the version of JupyterLab it's using, as the function from the kernel UI seems to have changed in the later versions. In our extension we currently set up the kernel commands like this:

if (mainMenu) {
mainMenu.kernelMenu.kernelUsers.add({
tracker,
interruptKernel: current => {
const kernel = current.context.sessionContext.session?.kernel;
if (kernel) {
return kernel.interrupt();
}
return Promise.resolve(void 0);
},
reconnectToKernel: current => {
const kernel = current.context.sessionContext.session?.kernel;
if (kernel) {
return kernel.reconnect();
}
return Promise.resolve(void 0);
},
restartKernel: current => {
const kernel = current.context.sessionContext.session?.kernel;
if (kernel) {
return kernel.restart();
}
return Promise.resolve(void 0);
},
shutdownKernel: current => current.context.sessionContext.shutdown()
} as IKernelMenu.IKernelUser<BlocklyEditor>);
}

but in JupyterLab since v4.0.0 they are set up like this:

https://github.com/jupyterlab/jupyterlab/blob/bb8a4edbe6fdfcd8abb763b414adf37e84aa2f08/packages/console-extension/src/index.ts#L836-L856

As a temporary fix, so the JupyterLite deployment works, we can pin the version of JupyterLab to be the latest compatible one, which would mean adding the following lines to docs/build-enviroment.yml:

- python=3.9
- jupyterlab=3.6.7

I have tried this locally and it should fix the kernel UI error.

Is there another way you recommend we deal with this for now?

In any case, I think migrating jupyterlab-blockly to v4 of JupyterLab should be done soon and would be the best solution in the long run :)

martinRenou and others added 2 commits February 20, 2024 09:10
Co-authored-by: Denisa Checiu <91504950+DenisaCG@users.noreply.github.com>
@martinRenou
Copy link
Member Author

Thanks for investigating this!

Unfortunately using the latest jupyterlite we're stuck with jupyterlab v4, so we need to downgrade jupyterlite for now. Let's see if that works.

@martinRenou
Copy link
Member Author

We need a release of jupyterlite-xeus with jupyterlite/xeus#73 and I believe we should be good to go

@martinRenou martinRenou reopened this Feb 20, 2024
@martinRenou
Copy link
Member Author

It's working again! https://jupyterlab-blockly--83.org.readthedocs.build/en/83

Screenshot from 2024-02-20 10-14-21

@martinRenou martinRenou requested a review from DenisaCG February 20, 2024 09:15
@martinRenou
Copy link
Member Author

martinRenou commented Feb 20, 2024

@DenisaCG let's get this merged and we can fix the check-release workflow separately

@martinRenou martinRenou merged commit 4cee142 into QuantStack:main Feb 20, 2024
3 of 4 checks passed
@martinRenou martinRenou deleted the update_lite_build branch February 20, 2024 09:44
@DenisaCG
Copy link
Member

Great, thanks Martin!

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

Successfully merging this pull request may close these issues.

2 participants