Comments (3)
Thanks for opening this. I love to see ideas for new clients of Jupyter kernels!
I'm not familiar with h, but based on your description, I think the setup would be something more like the following:
- User of h is on a site
- User writes code in the h sidebar (e.g., in a fenced code block)
- User selects the code and hits an execute button
- When user executes the code for the first time, the h extension contacts a kernel gateway to request a kernel in the desired language (for simplicity, let's pretend the kernel gateway and kernel live somewhere in the cloud, say, as a service the h authors provide)
- The h sidebar sends the code (not a notebook ipynb file) to the provisioned kernel / kernel gateway for evaluation following the jupyter protocol
- Kernel responds and h renders the result inline.
- h saves the code in one of its annotations however it wants.
The key difference between your proposal and this is that the kernel gateway, when operating in its normal jupyter-websocket mode, doesn't know anything about ipynb files. It takes jupyter protocol messages on a websocket, sends them to a jupyter kernel on 0mq (which is what all kernels talk), and does the reverse for messages that come from kernels.
The jupyter-js-services npm package provides a nice library for requesting kernels from a kernel gateway and sending them code. Here's an example:
https://github.com/jupyter-incubator/kernel_gateway_demos/blob/master/node_client_example/client.js
Since the kernel gateway uses HTTP and Websockets, you can use pretty much any language to communicate with it. Here's another example in Python which doesn't have a nice library like nodejs (yet?)
https://github.com/jupyter-incubator/kernel_gateway_demos/tree/master/python_client_example
from kernel_gateway.
Thanks for answering with details!
The process will likely be simple like this, and can be developed with a local h server. I only need to know more about the jupyter protocols to do it, and your description shows it is rather simple too.
I will try something in the next weeks (but don't expect it too quickly) and I may come back with further questions.
from kernel_gateway.
@jibe-b I'm going to close this issue. If you did attempt the h experiment, feel free to let us know the outcome in new issues or in the Jupyter Google group.
from kernel_gateway.
Related Issues (20)
- Move CI from Travis to Github Actions HOT 1
- Issues with jinja2_env HOT 1
- CORS preflight OPTIONS request fails for kernel interruptions HOT 1
- Can't access environment variables with remote kernel HOT 3
- kernel_gateway incompatible with Jupyter API? HOT 9
- Parallel API calls
- JWT Auth Mixin
- block kwarg removed in jupyter-client 7 HOT 2
- jupyter websocket messages not updating UI HOT 5
- How do I run some bootstrap code in the kernels before the startup files? HOT 2
- Support for integrating external contents managers HOT 2
- Moving repo to jupyter-server org HOT 2
- jupyter-kernel-gateway hanging/slow HOT 18
- Update JKG to more recent packages
- Decoding message response in NodeJS WS demo HOT 1
- Decoding message data in nodeJS demo. HOT 1
- Using bash kernel in notebook-http mode HOT 5
- Returning the message associated with the error code HOT 1
- Gateway seems to be stuck when deploying on cloud HOT 3
- 3.x Release HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kernel_gateway.