-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
First class Jupyter notebook integration #13016
Comments
Roadmap to creating a kernel:
Sorry, I realize that's a lot... hopefully it's helpful. |
A bit of a hurdle in the integration is the fact that the only crate that provides async integration with ZeroMQ is currently marked as unstable and not recommended to use in production: https://github.com/zeromq/zmq.rs This crate builds on top of: https://github.com/erickt/rust-zmq which provides sync bindings (which might not be a big deal), but it seems its built process might be quite involved. I will do some more research on this topic before proceeding. @apowers313 thank you for providing the roadmap, this is very helpful! |
If you get painted into a corner, Jupyter appears to require a very small subset of ZMQ: it appears to only use NULL security, send ~4 packets to negotiate the session, and then has a |
@apowers313 perfect! |
I'd like some feedback on where / how to implement the user-facing Jupyter API for the Deno Jupyter kernel. This would be the API for users to display charts / images, displaying object specific documentation, add new magics, etc. I think regardless we will want a Requested Feedback 1: I'd be interested if anyone objects to The part where design decisions are needed is an interface / protocol for Objects to automatically convert them to structured data types. For example, if a user returns an object implementing Requested Feedback 2: Three options for how to do this:
Thanks! |
I just checked in a proposed API for Jupyter display:
I'm trying to decide if it would be more convenient to overload |
Sounds good to me, but it should be
In this case I think we should use something like
I believe the "overload" approach would be better in this case - we already use this approach in numerous Deno.jupyter.display(mimeType: string, buf: Uint8Array, opts); Deno.jupyter.displayPng(pathOrBuf: string | Uint8Array, opts); Deno.jupyter.displayFile(path: string); Seem preferable, what are the |
Is this, and Ideno still being worked on? |
Nope, I stopped working on IDeno in favor of the built-in Jupyter kernel. The built-in kernel stalled out because the ZMQ library we were using had some bugs. IDeno was mostly functional, happy to pass the baton if anyone wants to pick it up. |
Hey @tif-calin, @apowers313! We did the kernel mostly working but that ZMQ library bug was quite serious and it was happening very often (it manifested itself every 3-4 connections). If there was a different library that we could use, then we should be able to revive that PR without much trouble and that still seems like a great feature for many people. |
I would be very interested in seeing this happening. Any way I can help? |
Fix the Rust ZMQ library? :) |
Do you have a specific bug that needs to be fixed? Is it filed somewhere? |
|
Also, for a mostly working non-Rust version of a kernel: https://github.com/apowers313/ideno |
Love this. Where has the work coalesced? Background: I'm a longtime Jupyter, IPython, and ZeroMQ maintainer. I'd love to help steward this work. |
@rgbkrk still stuck on this bug as far as I can tell: zeromq/zmq.rs#153 |
Hey @rgbkrk, thanks for stopping by. So @apowers313 and I had a PR that was quite close to landing (#13122) unfortunately the bug above caused it to be very flaky (2/3 times you opened a notebook it resulted in We recently discussed this feature with @crowlKats and @dsherret and we'd like to resurrect the PR, we were thinking of maybe rewriting parts of |
Looks like I'm going to have to learn Rust. While it might not be the best, you might get more reliability more quickly by building on top of libzmq even though it would pale in comparison to native rust bindings. As far as I can tell, there's a lot to be tested within zmq.rs. I'm curious if this jupyter rust kernel ran into the same issues. Have you all checked that out too? |
I did not know about that project. I can certainly check it. Let me get my PR rebased and reopened so we can discuss over code. |
Opened #20337 that is rebased against |
FYI, it looks like the PR above works quite nicely with notebook integration in VSCode, but all hell breaks loose when I try it with |
This commit adds "deno jupyter" subcommand which provides a Deno kernel for Jupyter notebooks. The implementation is mostly based on Deno's REPL and reuses large parts of it (though there's some clean up that needs to happen in follow up PRs). Not all functionality of Jupyter kernel is implemented and some message type are still not implemented (eg. "inspect_request") but the kernel is fully working and provides all the capatibilities that the Deno REPL has; including TypeScript transpilation and npm packages support. Closes #13016 --------- Co-authored-by: Adam Powers <apowers@ato.ms> Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
Jupyter notebooks are very popular. They provide rich, interactive environment for development.
There are numerous kernels that support JavaScript and TypeScript:
Prompted by discussion with @apowers313 who's working on a kernel for Deno (https://github.com/apowers313/ideno) I propose we add first-class support for Jupyter in Deno (with
deno jupyter
subcommand).I'd argue that providing first class support for Jupyter will open Deno to a whole community of people using Jupyter notebooks, additionally providing the community with new powerful tools (after all Deno supports WebGPU out-of-the-box) and could help significantly Machine Learning applications of Deno.
This proposal is motivated by several things; firstly Deno originated from a similar idea to Jupyter called PropelML that never fully materialized. Secondly, @apowers313 will have to integrate with V8 inspector protocol to provide kernel functionality. Currently Deno doesn't have a programatic API to interact with the inspector so it will require quite an effort to integrate over Websocket. Additionally most of the functionality that has to be provided for kernel is already working in the REPL. In fact most of REPL functionality could be reused in the kernel, we would have to add communication protocol APIs to integrate with the kernel.
@kitsonk was eyeballing implementation of the kernel in Q2/Q3 but that never materialized due to other more pressing work. I'll be happy to spearhead the effort as it seems like a very fun project to work on.
The text was updated successfully, but these errors were encountered: