-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[feature request] add "Pause" button to Notebook #2363
Comments
Thanks for filing. I think this should be straightforward on Unix systems, using SIGSTOP (or SIGTSTP if we want to give the kernel the option to ignore it) and SIGCONT. These could be exposed as kernel actions in the REST API, like interrupt and restart already are. I don't know if Windows has an equivalent, but if someone builds a Unix-only solution and leaves the actions as no-ops on Windows, I don't think we'd hold it up. |
Maybe relevant for Windows side: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686342(v=vs.85).aspx |
I ll check this out, if no one is working on it. |
I don't think anyone is. The place to start will be in the jupyter_client package, adding API functions to pause and continue a kernel's execution. |
Hey, I see there hasn't been any update on this in a while. I've been checking out the jupyter_client package and working out where to add the API pause/continue functions. However, could anyone point me towards the right directory to go about adding a new button to the top bar of a notebook? I think the best way to do it is to have a separate button controlling SIGTSTP and SIGCONT and leave the current Run and Interrupt buttons as is. |
I probably wouldn't put this in the toolbar for now: it's likely to be Unix only, and I'm not sure how reliably it will work. In terms of the UI, I'd probably start by making it an action (see |
Understandable, I'll go there and check it out. Is there a preference between having one action that both suspends the process if it is running AND continues the process if it has been suspended, or two separate actions to achieve the same thing? |
It's not a strong preference, but I'd lean towards two separate actions. We can always add a separate toggle action afterwards. |
Guys, I am working on this with PR 3739. Thanks. |
@arovit, I tested #3739 with some pytorch/cuda long running code - seems to pause and resume just fine. As far as usability goes, you probably don't need 2 buttons - one Pause/Resume toggle button should suffice as it'll mimic the hardware Play/Pause button we are so used to. Plus, it would help to indicate somewhere at the menu level (always visible) that the execution thread is paused (perhaps in some color), (or perhaps the bg of the notebook itself change?), because I can see someone hitting the Pause button/menu item by mistake or on purpose and forgetting they did that, and then wonder why nothing works. Perhaps any attempts to execute cells while in that suspended mode should complain too, asking to resume first? Thank you! |
Thanks @stas00 for testing out and sharing this great feedback. |
I thought of changing the background of all cells to a different color indicating this different state. But then I remembered the themes extension, which would make this complicated, as unless that extension is brought in sync with such change, some color conflict may happen. Probably, for now leaving the cells as they are is fine - as it is will just turn [*] waiting/busy flag on and perhaps, that'd be enough. It'd be good to hear an opinion from the developers so that you don't waste time designing something that won't be accepted at the end. Thank you for your work, Arovit. |
@arovit: Thank you for the amazing contribution and @stas00: thank you for taking the time for testing the changes out. @takluyver: Can you please tell us when can we have this feature rolled out? |
We're on the cusp of releasing notebook 5.6, so I don't want to merge a new feature like this just before a release. After the release is done, hopefully quite soon. |
Verified it to work as discussed earlier. Thank you, @arovit! wrt to placement - would it be functionally logical to put it next to Interrupt in the Kernel submenu? Now, I've noticed that the Kernel sub-menu appears to be almost sorted alphabetically (but not exactly). So, perhaps, it's another reason to place it in 2nd place? |
Thanks @stas00 . I just pushed a commit which adds a selenium testcase for testing this feature and also made changes to have pausing/resume options right next to Interrupt in the kernel submenu. Please let me know if there is anything else I need to work on. Thanks. |
Hello, Gentle ping to get some traction on the PR. Thanks ! |
Just for reference, I found that if I wanted to pause the script running in Jupyter notebook and resume it later, CTRL+S ended up working well for me (although this must be performed in the Anaconda terminal). Thanks |
just chiming to say i googled how to pause a notebook and ended up here! hope the feature's live sometime! |
From the Linux shell, you can do Ctrl+Z to pause, then |
In which version of jupyter notebooks is this implemented? I just checked because I have this issue with a time consuming process and I would love to have this feature. |
This work is still WIP: #3739 |
Hi everyone, I'm seeking a project to contribute to for one of my college courses. I was curious if there is anything going on in this feature that I could help with? I use Anaconda/Jupyter all the time and would really appreciate the opportunity to give back. |
Is this still being worked on? If not I am happy to step in and contribute... |
Hi, can I work on this? I'm new so can someone guide me? |
Hi @dhivyasreedhar, We are primarily focused on bug fixes and security issues in the notebook repository right now, but appreciate your interest in helping. Resolution of this issue would likely require work in Jupyter Lab, Jupyter Server, and Jupyter Client although this does seem useful. |
I was wondering if there is a way to pause/suspend a running Jupyter kernel from the Notebook interface? I was looking for a "Pause" button but couldn't find any.
Use case: Imagine you're working on a laptop, and have a long-running computation at work. Then it would be nice to suspend the kernel's activity when the battery gets drained.
The text was updated successfully, but these errors were encountered: