-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Reconnect to running session: keeping output #2833
Reconnect to running session: keeping output #2833
Comments
Hi @oersted, this work needs to be done on the server side, and JupyterLab uses the same server as the classic notebook, so the work to be done is the same. |
Is there some kind of alternative? |
You could make a python client ("headless frontend") that auto-saves when new messages are received, and automatically shuts down when last pending execution is finished. If you spin this up in a separate process (from the notebook) before starting your execution, I think you should be able to do what you want. But this is not really a JupyterLab issue. |
So am I correct in understanding that when you close the browser, the notebook keeps running, there is simply no way to connect to it again to view the output? If so, the logical thing to do is to have it dump summaries to file every so often, and use another, quick-to-restart notebook to display these. |
Thanks for responding :) Perhaps, it's not a JuypterLab specific issue.
How do Jupyter experts work with long running (remotely hosted) scripts? Am I supposed to login to the notebook--only after the scripts have finished? Sometimes, scripts takes days to execute... On my end, my code is inserting rows into a SQLite3 (which I can check) and sending me notifications by pushbullet. So, there are notifications. I'm also experimenting with KeepAlive Settings and Tmux on both ends (local and Gcloud) If this question is not appropriate to JupyterLab (which is currently open in Chrome), what is an appropriate forum to ask this question? |
Hi @grahamanderson, I think the mailing list would be the best forum. |
so, will this issue be addressed? Its so irritating when you have no idea what is happening on your long-running notebook. :( |
@blink1073 any updates? |
The RTC work is ongoing and being tracked in #5382. Adding the server side model is an extra step after that groundwork is laid. |
Awesome! Looking so much forward to this issue being fixed. |
I am desperately waiting for this issue to be fixed. Please please fix it :-) |
I have been reading all the related issues but there is no solution proposed. I really need this function. |
We too would love if people would help contribute toward solving this! |
I'll need this functionality and I'm willing to help. Can anyone give me insight where to start? ✌️ |
I think first step is to see if the current output buffering in the notebook server is working in JupyterLab. If there is one client connected to a kernel, and that client disconnects, then the server should be buffering output for when that one client reconnects. To test this, have a kernel that is generating output, then disconnect and reconnect to that kernel and see if output is buffered and sent to the client. There should be some messages in the server log about the buffering as well. |
Thanks to all the Devs for their continuous contribution! There is a partial work-around, which I re-post here for those who may find it helpful; it does not resolve the matter, yet provides some of the desired functionality.
%load_ext ipycache
%mkdir -vp ipycache
import time
%%cache ipycache/test_long
i = 1
while i<30:
print '{}, '.format(i),
time.sleep(1)
i+=1
Originally posted in ipython/ipython#4140 (comment) |
Hey guys, possibly a dumb suggestion, but why not just send all the output of a running cell to the first cell. If the issue is that cells lose which output maps to them, can't you just have a work around like: "Insert generic message about why this is happening" I mean I'm getting the messages of output under websocket traffic so the session is still receiving output. |
Just a note that the current work on a real time data model is meant to address this issue as well: https://github.com/jupyterlab/rtc |
@davidbrochart that is great to hear. I would like to contribute but I'm new to the jupyter codebase - is there anything I can help with? |
@davidbrochart Your video looks amazing. I just want to applaud 👏 any effort towards resolving this issue, since it is the biggest disappointments that jupyterlab currently has (at least to me :) ). Any solution towards resolving this issue is highly welcome - thank you for your work in this direction! |
And here is a demo showing full notebook state recovery, including widgets: Peek.2023-11-10.11-29.mp4 |
That's amazing! |
Wouldn't that be easier to keep a running session as an html document on the server side, and connect to it just to change this html. So that it would never disconnects only the renderer and editor of this html could disconnect. Basically I am trying to say that run an jupyter html in the server. And connect to it like google sheets(multiple users or single) and edit this html and trigger run and render output from this. Wouldn't it preserve states easily ? Another things come to mind, whenever a notebook disconnects , server can keep dumping output to a temp html which is exact copy of disconnected ones and show it in a list of sessions. When you click to a session, you download this html and server will keep dumping ouput to this html. Also may have cell and widget states ? Or does it already work like this ? |
It doesn't work like this, there is no such thing as an HTML document on the server side. |
How do I achieve this effect? |
Is this really closed? If so, yay! 🥳 Very exciting |
Well, it is not yet implemented in jupyter-server, and not released but there definitely is some progress here ;) |
Does this mean that this feature will become available in jupyterlab-server before jupyter-server? Or something else? |
No, it means that this feature will be available if you run JupyterLab with jupyverse instead of jupyter-server, until it is implemented in |
@davidbrochart Could you please share how we can achieve this via jupyverse? I've installed jupyverse and still the output can't be seen after closed & reopen a browser tab. |
pip install "jupyter-collaboration" "jupyverse[jupyterlab,auth]"
jupyverse --set kernels.require_yjs=true --set jupyterlab.server_side_execution=true |
There's been a lot of requests in the past to:
I'd like to resurface this issue. To the best of my knowledge, these features have been planned at least since 2015 (earliest reference I found: link). It hasn't been implemented yet because it directly conflicts with the architecture of the stack and would require a big refactor.
I don't know if this is easier in the JupyterLab context or not. But now that this project is in very active development, it might be a good opportunity to revisit this and try to get it in now at the foundations.
I found to open issues on the topic in the old notebooks repo:
The text was updated successfully, but these errors were encountered: