atom.io, hydrogen and ipython remote (ssh) kernel - python

So I discovered lately this atom.io text editor. Soon after the amazing hydrogen. So far so good, hydrogen starts an ipython kernel if it isn't already running and then it gives you real time interaction, just like with ipython notebook.
Good, but does anyone know if it's possible for hydrogen to be set up to work with a remote ipython kernel? The way I thought I could make this work is to have a local kernel be a communication layer between hydrogen and the remote kernel, but I don't see any way to do this. Do you have any idea how to set this up?

Hydrogen is able to connect to remote kernels running locally or on a server since version 0.12.
Checkout our documentation for more infos.

Related

Interrupting Remote Python Kernels in Spyder or Other IDEs

I'm currently using Spyder to connect to a remote kernel, and I'm looking for a way to interrupt the kernel from Spyder. I found a post on Stack Overflow (Shutting down a remote kernel from Spyder) from 2020 (and 2021 in the comments) where a maintainer said that interrupting a remote kernel from Spyder is not feasible.
However, I'm wondering if other IDEs support interrupting a remote kernel. If you have any information about whether this is possible in other IDEs, I would appreciate any guidance on this topic.

Reconnect jupyter notebook to existing kernel

I am somewhat confused about the frontend/backend separation of Jupyter Notebook. I am working on a Linux server and suddenly encountered a memory error which was very unlikely given the available memory. And it lead me to realize that the kernels never completely shut down as it was reported here Memory leakage due to presumably unclosed kernels. Here the solution is to just kill all the processes but as I don't want to run my notebook all from the beginning again it would be handy to connect the notebook back to the existing kernel which holds all the variables and data that were already calculated.
I tried it with
jupyter lab --existing kernel-XXkernelnrXX.json
but it just brings me to the starting page of Jupiter lab where I can open a new file. When I open the file I want to reconnect a new kernel is started which I see in htop and %connect_info executed in the notebook gives me a different kernel. I also tried clicking "Reconnect to kernel" from the menu bar and also "Select kernel for: YX.ipynb" but it doesn't work either. So how can I connect the frontend visual notebook again with a running kernel?

Run local code in the Jupyter notebook on remote server via kernel

I want to run local code using local data on a remote server and get back execution results back to my Jupyter notebook cells.
Not usual scheme "run Jupyter notebook remotely, connect to remote notebook via ssh tunneling" but more sophisticated via custom remote kernel which I may choose from the kernel list, and run local code on remote server seamlessly.
Some packages (like this -- https://pypi.org/project/remote-kernel) mention that it is possible, but look dated and come with limited usage instructions.
Anyone knows how to implement this? If so, be as more detailed as possible, thanks!

Why IPython Console in Spyder4 updates constantly when connecting to remote kernel on server?

I followed the instructions on the official Spyder page and successfully connected to remote kernel via SSH. However I have a problem in my Ipython Console as it refreshes every 2-3 seconds adding In [1]: lines infinitely. I suppose it is refreshing of a state on server, but could someone explain what is this, why this happens and can I turn it off, so that the Console behaves the same as when I work on my local kernel(without infinite adding of empty lines)?
The solution could be found here in post of scott-8: https://github.com/spyder-ide/spyder/issues/10240#issuecomment-543913159
The copy of the answer:
Don't know about the issue above, but here is what solved my issue for anyone reading: instead of running python -m spyder_kernels.console and connecting to the kernel, quit the kernel after running it. Then restart the kernel with python -m spyder_kernels.console -f kernel-xxxxx.json, specifying the file that was just created in the runtime directory, and connect to it. This fixed my problem for some reason.

(is) kernel busy in ipython notebook

I'm using an EC2 spot instance (my windows to ubuntu instance) to run a function that was well beyond my laptop's capabilities. The kernel busy dot has been filled for hours. Previously, I would just listen to my laptop as it was obvious when something was running as opposed to ipnb getting stuck. Is there any way I can tell now?
If I try something like 1+1 in the box below my function it will also turn into an asterisk, but I can open a new notebook and have zero issues running simple commands in the new notebook.
this is because all though each notebook has multiple cells but only one kernel, so the commands in the other cells are queued until the first cell finishes its task. When you open a new notebook that notebook is provided with its own kernel so it can do other simple commands quickly without attempting whatever it is that's taking so much cpu power

Categories