Comments (12)
It's been a year and a half since this issue was opened, and I want to point out that since then remote kernel support has been added to hydrogen. It's now possible to use kernel gateway to manage multiple running kernels, and switch between them at will. Additionally, it was always the case that each atom window keeps its own set of kernels.
It should now be possible to use these features day-to-day, and to reflect on whether there's a better UI for presenting kernel-switching. (There are limitations to the current approach, such as the fact that manual switching takes time, and clears results boxes.) Both kernel-per-language and kernel-per-file are reasonable usecases, as are many things in between. I personally enjoy how hydrogen works very cleanly with minimal configuration, and it would be ideal if kernel switching didn't sacrifice those qualities. One of the big reasons I haven't proposed code that modifies kernel switching is that I don't have a clear idea of an interaction setup that better balances ease-of-use and kernel-switching than what's currently in Hydrogen.
from hydrogen.
What if we made the default startup to start a new kernel for the current editor? If you wanted to connect to an existing kernel you would do an additional ui step like @lgeiger's mockup above.
from hydrogen.
Thanks for bringing up this discussion 🎉
I think this could be a very powerful feature. I haven't thought long about this so take my following suggestions with a grain of salt. It's just a first draft 😄
For this to be transparent to the user I propose the introduction of sessions:
- Each session holds one instance of a running kernel (remote or local)
- Multiple files can be "connected" to the same session
- Hydrogen should be able to keep reference to which file belongs to which session (which may be be tricky if the file is renamed).
- If a user want's to run commands and no kernel is running for the language, a new session and kernel are started
- If there's a running kernel for the desired language (started from a other file) the user get's prompted if he wants to start a new session or wants connect to a running session.
- I would save the case of multiple kernels for the same file for later.
This approach would mix remote kernels and ZMQ kernels but I think that's a good thing.
Basically what I suggest is having a high level way of managing multiple different kernels with different interfaces and clients. Maybe we could build something on top of https://github.com/nteract/enchannel.
from hydrogen.
This is one of our oldest open issues and I think it's finally time to tackle it.
Here're my ideas on how we could handle this in way that hopefully is very flexible yet doesn't sacrifice ease-of-use. The proposed workflow mixes both local and remote kernels in order to be less confusing and easier to use:
Every time the user switches to a new tab and wants to execute some code, he gets prompted if he likes to connect to a running/existing kernel or a remote kernel or if he likes to start a new local kernel.
Internally the kernels are stored together with the file paths related to them, so they can be reused. Multiple files can be connect to the same kernel but one file is connected to at most one kernel.
I've roughly sketched how the UI (mainly the popup panels) may look like to get a idea on how this would feel:
Kernels are never killed if the user closes a editor tab so they can be reused later. Therefore we either need a command to shutdown specific kernels or a UI that lists all running kernels and the possibility to shut them down individually, similar to how the notebook does it:
Right now remote kernels also implement a concept of session which for my understanding would become redundant and make things overly complicated for users if we handle multiple kernels internally. I think if we want to go this route we should remove the concept of additional remote sessions. @nikitakit I could really need some help and feedback for this since you're the expert for remote kernels 😄
What do you think about this workflow? Would this be a welcome improvement or would it make things just more complicated?
from hydrogen.
I definitely would have wished for one kernel per file when I was running through tutorials yesterday. It was frustrating to have to restart the kernel for each file I was going to, at least with a JS kernel (mostly because of const x = require(...)
).
from hydrogen.
This would be an essential feature, as a long running process shouldn't hinder running other unrelated files. Currently, i have to wait till the kernel to become idle in order to see the output of executing even a completely unrelated file.
It might be useful to add an option to start in a new kernel.
from hydrogen.
Emacs's package ESS manages multiple processes in almost the same way as what @lgeiger propose. Adding to that,
- ESS has "switch-process" command so a user can change the process for each buffer anytime (s)he wants to (maybe it corresponds to "the case of multiple kernels for the same file").
- We can rename processes (to be precise, rename the buffers on which the results are shown)
I have used ESS and thought the way as sufficiently simple and powerful, though sometimes I'm confused when multiple processes are running. I wish Hydrogen had a similar feature.
from hydrogen.
Oops, autoclosed since I merged the PR.
from hydrogen.
So this used to work perfectly well until the last update - different files/views will connect to their separate kernels (through the remote kernel gateway), but now this workflow was broken. Was this an intential update?
from hydrogen.
@maximsch2 remote kernels should still be working, we did deprecate the connection.json method of connecting existing kernels
If you arent talking about the connection.json method this would be a new issue.
from hydrogen.
@BenRussert , sounds good. I've posted my issue as a separate bug: #884
from hydrogen.
I like that @BenRussert
from hydrogen.
Related Issues (20)
- hydrogen fails to install on Atom HOT 2
- fialedto activate
- npm WARN deprecated [email protected] HOT 2
- Failed to activate the Hydrogen package HOT 18
- [email protected] failed
- Interactive input in output area
- VSCode: port or alternative HOT 12
- Uncaught Error: Cannot find module 'lodash/debounce'Require stack:- $ATOM_HOME/packages\Hydroge... HOT 3
- Uncaught error: no native build was found for platforms HOT 4
- Please port to Vs Code or any other IDE HOT 1
- Uncaught Error: No native build was found for platform=darwin arch=x64 runtime=electron abi=85 uv... HOT 2
- TypeError when using hydrogen with pulsar HOT 4
- Hi, If the notebook in "not trusted" mode. Just click on it and make it trusted then save the file. It will work fine.
- SCRIPT WONT EXECUTE. HOT 1
- can't rebuild zeromq for pulsar
- Newly installed python modules cannot be found by hydrogen in pulsar
- [18:30] r p npm WARN deprecated [email protected]: this library is no longer supported [18:31] r p npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic [18:31] r p npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic
- deleted
- Is this going to be maintained? HOT 5
- Publish Hydrogen to Pulsar Package Repository HOT 3
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 hydrogen.