Skip to content
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

Kernel status/shutdown from dashboard #1676

Closed
wants to merge 11 commits into from

Conversation

Carreau
Copy link
Member

@Carreau Carreau commented Apr 30, 2012

this is a partial fix for #1515 ,
It replace the delete button by shutdown button when kernel are running.
the list is updated when dashboard page get focus, and refresh every 60 seconds.
Refresh stop when page loose focus.

It also move the clear_list when clicking on the refresh button to avoid flickering.

refresh notebook list and cluster list when :
- page get focus
- every 60 sec when page is on focus

stop refreshing every 60 sec when page loose focus
if kid is not None:
f['kernel_status']=kid
else:
f['kernel_status']='off'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are going to store kernel ID and kernel status in a single key, perhaps it would be clearer to just do:

f['kernel'] = km.kernel_for_notebook(nid)

And then in js, you would check null:

                if(kernel){
                    this.add_shutdown_button(item, kernel);
                } else {
                    this.add_delete_button(item);
                }

Also minor style note: try to add spaces around assignment.

@minrk
Copy link
Member

minrk commented May 2, 2012

This looks pretty good. My only behavioral complaint is what happens when you shutdown a kernel. Frontends are not notified by anything other than regular heart failure. But then again, I think this is exactly what happens if you kill a kernel from one frontend, while it is in use by another, so perhaps coordinating clean shutdown is a separate issue.

@Carreau
Copy link
Member Author

Carreau commented May 3, 2012

True, I should have done that when changing 'on' to kernel_id.
Done, and renamed to kernel id at the same time.

I guess this does not prevent us from the clean shutdown option in the notebook menubar.

files = nbm.list_notebooks()
for f in files :
nid = f['notebook_id']
kid = km.kernel_for_notebook(nid)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for this if statement. just use f['kernel_id'] = km.kernel_for_notebook(nid). Then use null in js instead of undefined.

set kernel id to None/null if not started
@Carreau
Copy link
Member Author

Carreau commented May 3, 2012

Done.

don't clear list if 'upload' button are present to avoid clearing the
list and the upload form
@@ -590,7 +590,10 @@ class NotebookRootHandler(AuthenticatedHandler):
@authenticate_unless_readonly
def get(self):
nbm = self.application.notebook_manager
km = self.application.kernel_manager
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thinking a bit more about this, I think this is OK. We do need to try and keep the kernel and notebook server side handlers+logic separate, but we have to have some way for the notebook handler to learn about the kernels for that notebook.

@Carreau
Copy link
Member Author

Carreau commented May 11, 2012

Don't expose enable and disable autorefresh done.

Carreau added a commit to Carreau/ipython that referenced this pull request May 15, 2012
superseed ipython#1676 ipython#1658 (and correct bug in 1676 where one con't upload
notebook because of refresh)
@Carreau
Copy link
Member Author

Carreau commented May 15, 2012

Closing as it is part of Pull Request #1739 now.

@Carreau Carreau closed this May 15, 2012
Carreau added a commit that referenced this pull request May 31, 2012
Dashboard improvement

see #1658 #1676

Allow to shutdown the kernels from the dashboard, 
autorefresh dashboard,
add a native upload method, especially for https/chrome/linux that prevent drag and drop
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
superseed ipython#1676 ipython#1658 (and correct bug in 1676 where one con't upload
notebook because of refresh)
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Dashboard improvement

see ipython#1658 ipython#1676

Allow to shutdown the kernels from the dashboard, 
autorefresh dashboard,
add a native upload method, especially for https/chrome/linux that prevent drag and drop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants