{"action":"created","comment":{"url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/comments/60918404","id":60918404,"diff_hunk":"@@ -0,0 +1,117 @@\n+# Kernel 'nanny' processes\n+\n+## Summary\n+\n+We propose to start Jupyter kernels through a 'nanny' process, which will always\n+be running on the same machine as its associated kernel. This offers various\n+advantages over the current situation, including:\n+\n+- Kernels will no longer need to implement the 'heartbeat' for frontends to\n+  check that they are still alive.\n+- We will be able to interrupt remote kernels (SIGINT cannot be sent over the network)\n+- There will be a consistent way to start kernels without a frontend\n+  (`jupyter kernel --kernel x`).\n+- Kernel stdout & stderr can be captured at the OS level, with real-time updates\n+  of output.\n+\n+## The basics\n+\n+When a frontend wants to start a kernel, it currently instantiates a `KernelManager`\n+object which reads the kernelspec to find how to start the kernel, writes a\n+connection file, and launches the kernel process. With the proposed changes, it will\n+instead launch the kernel nanny on the machine where the kernel is to run, and\n+the nanny will be responsible for creating the connection file and launching\n+the kernel process.\n+\n+**Rejected alternative:** One kernel nanny process per machine, able to start\n+multiple kernels. This would be more complex, but we may come back to it later\n+if the overhead of one nanny per kernel is too much.\n+\n+## Socket connections\n+\n+Currently, the frontend connects to five sockets to communicate with the kernel:\n+\n+* Shell\n+* Control (priority, used for shutdown)\n+* Iopub (kernel to frontend only, for output)\n+* Stdin (used to request input from the frontend)\n+* Heartbeat\n+\n+Of these, shell and stdin will remain connected directly between the kernel and\n+the frontend. Control and iopub (see output capturing) will be connected through\n+the nanny, i.e. each channel will have one socket for communications between\n+the frontend and the nanny, and a second socket for communications between the\n+nanny and the kernel. (*TODO: What are these called in the connection file? Or\n+do we have two connection files?*) The heartbeat will only be between the\n+frontend and the nanny, to detect situations such as network failures.\n+\n+## Messaging changes\n+\n+* A new message type on the control channel from the frontend to the nanny,","path":"kernel-nanny.md","position":50,"original_position":50,"commit_id":"77d97ba03387cc73109d314d2137b04714b5944d","original_commit_id":"77d97ba03387cc73109d314d2137b04714b5944d","user":{"login":"lbustelo","id":2474841,"avatar_url":"https://avatars.githubusercontent.com/u/2474841?v=3","gravatar_id":"","url":"https://api.github.com/users/lbustelo","html_url":"https://github.com/lbustelo","followers_url":"https://api.github.com/users/lbustelo/followers","following_url":"https://api.github.com/users/lbustelo/following{/other_user}","gists_url":"https://api.github.com/users/lbustelo/gists{/gist_id}","starred_url":"https://api.github.com/users/lbustelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbustelo/subscriptions","organizations_url":"https://api.github.com/users/lbustelo/orgs","repos_url":"https://api.github.com/users/lbustelo/repos","events_url":"https://api.github.com/users/lbustelo/events{/privacy}","received_events_url":"https://api.github.com/users/lbustelo/received_events","type":"User","site_admin":false},"body":"Why not have the nanny capture https://ipython.org/ipython-doc/3/development/messaging.html#kernel-shutdown","created_at":"2016-04-25T14:08:22Z","updated_at":"2016-04-25T14:08:22Z","html_url":"https://github.com/jupyter/enhancement-proposals/pull/14#discussion_r60918404","pull_request_url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/comments/60918404"},"html":{"href":"https://github.com/jupyter/enhancement-proposals/pull/14#discussion_r60918404"},"pull_request":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14","id":66880387,"html_url":"https://github.com/jupyter/enhancement-proposals/pull/14","diff_url":"https://github.com/jupyter/enhancement-proposals/pull/14.diff","patch_url":"https://github.com/jupyter/enhancement-proposals/pull/14.patch","issue_url":"https://api.github.com/repos/jupyter/enhancement-proposals/issues/14","number":14,"state":"open","locked":false,"title":"Kernel nanny proposal","user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"body":"As discussed at the dev meeting. There are a few TODOs which have not yet been decided. We can bikeshed about them, or whoever gets to implementing the relevant bits first can try their preferred option ;-).\r\n\r\nPinging @JanSchulz, who was interested in this for IRkernel logging. ","created_at":"2016-04-18T16:12:21Z","updated_at":"2016-04-25T14:08:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01ddffdd59647ce8415a93776d187dc50600b673","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14/commits","review_comments_url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14/comments","review_comment_url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyter/enhancement-proposals/issues/14/comments","statuses_url":"https://api.github.com/repos/jupyter/enhancement-proposals/statuses/77d97ba03387cc73109d314d2137b04714b5944d","head":{"label":"takluyver:nanny","ref":"nanny","sha":"77d97ba03387cc73109d314d2137b04714b5944d","user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"repo":{"id":56522583,"name":"enhancement-proposals","full_name":"takluyver/enhancement-proposals","owner":{"login":"takluyver","id":327925,"avatar_url":"https://avatars.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/takluyver/enhancement-proposals","description":"Enhancement proposals for the Jupyter Ecosystem","fork":true,"url":"https://api.github.com/repos/takluyver/enhancement-proposals","forks_url":"https://api.github.com/repos/takluyver/enhancement-proposals/forks","keys_url":"https://api.github.com/repos/takluyver/enhancement-proposals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takluyver/enhancement-proposals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takluyver/enhancement-proposals/teams","hooks_url":"https://api.github.com/repos/takluyver/enhancement-proposals/hooks","issue_events_url":"https://api.github.com/repos/takluyver/enhancement-proposals/issues/events{/number}","events_url":"https://api.github.com/repos/takluyver/enhancement-proposals/events","assignees_url":"https://api.github.com/repos/takluyver/enhancement-proposals/assignees{/user}","branches_url":"https://api.github.com/repos/takluyver/enhancement-proposals/branches{/branch}","tags_url":"https://api.github.com/repos/takluyver/enhancement-proposals/tags","blobs_url":"https://api.github.com/repos/takluyver/enhancement-proposals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takluyver/enhancement-proposals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takluyver/enhancement-proposals/git/refs{/sha}","trees_url":"https://api.github.com/repos/takluyver/enhancement-proposals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takluyver/enhancement-proposals/statuses/{sha}","languages_url":"https://api.github.com/repos/takluyver/enhancement-proposals/languages","stargazers_url":"https://api.github.com/repos/takluyver/enhancement-proposals/stargazers","contributors_url":"https://api.github.com/repos/takluyver/enhancement-proposals/contributors","subscribers_url":"https://api.github.com/repos/takluyver/enhancement-proposals/subscribers","subscription_url":"https://api.github.com/repos/takluyver/enhancement-proposals/subscription","commits_url":"https://api.github.com/repos/takluyver/enhancement-proposals/commits{/sha}","git_commits_url":"https://api.github.com/repos/takluyver/enhancement-proposals/git/commits{/sha}","comments_url":"https://api.github.com/repos/takluyver/enhancement-proposals/comments{/number}","issue_comment_url":"https://api.github.com/repos/takluyver/enhancement-proposals/issues/comments{/number}","contents_url":"https://api.github.com/repos/takluyver/enhancement-proposals/contents/{+path}","compare_url":"https://api.github.com/repos/takluyver/enhancement-proposals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takluyver/enhancement-proposals/merges","archive_url":"https://api.github.com/repos/takluyver/enhancement-proposals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takluyver/enhancement-proposals/downloads","issues_url":"https://api.github.com/repos/takluyver/enhancement-proposals/issues{/number}","pulls_url":"https://api.github.com/repos/takluyver/enhancement-proposals/pulls{/number}","milestones_url":"https://api.github.com/repos/takluyver/enhancement-proposals/milestones{/number}","notifications_url":"https://api.github.com/repos/takluyver/enhancement-proposals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takluyver/enhancement-proposals/labels{/name}","releases_url":"https://api.github.com/repos/takluyver/enhancement-proposals/releases{/id}","deployments_url":"https://api.github.com/repos/takluyver/enhancement-proposals/deployments","created_at":"2016-04-18T16:09:30Z","updated_at":"2016-04-08T06:33:42Z","pushed_at":"2016-04-20T10:05:49Z","git_url":"git://github.com/takluyver/enhancement-proposals.git","ssh_url":"git@github.com:takluyver/enhancement-proposals.git","clone_url":"https://github.com/takluyver/enhancement-proposals.git","svn_url":"https://github.com/takluyver/enhancement-proposals","homepage":null,"size":30,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jupyter:master","ref":"master","sha":"521a2f7a3654d1d41845b0b77a1443d69aca37a5","user":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"repo":{"id":41511140,"name":"enhancement-proposals","full_name":"jupyter/enhancement-proposals","owner":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyter/enhancement-proposals","description":"Enhancement proposals for the Jupyter Ecosystem","fork":false,"url":"https://api.github.com/repos/jupyter/enhancement-proposals","forks_url":"https://api.github.com/repos/jupyter/enhancement-proposals/forks","keys_url":"https://api.github.com/repos/jupyter/enhancement-proposals/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyter/enhancement-proposals/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyter/enhancement-proposals/teams","hooks_url":"https://api.github.com/repos/jupyter/enhancement-proposals/hooks","issue_events_url":"https://api.github.com/repos/jupyter/enhancement-proposals/issues/events{/number}","events_url":"https://api.github.com/repos/jupyter/enhancement-proposals/events","assignees_url":"https://api.github.com/repos/jupyter/enhancement-proposals/assignees{/user}","branches_url":"https://api.github.com/repos/jupyter/enhancement-proposals/branches{/branch}","tags_url":"https://api.github.com/repos/jupyter/enhancement-proposals/tags","blobs_url":"https://api.github.com/repos/jupyter/enhancement-proposals/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyter/enhancement-proposals/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyter/enhancement-proposals/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyter/enhancement-proposals/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyter/enhancement-proposals/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyter/enhancement-proposals/languages","stargazers_url":"https://api.github.com/repos/jupyter/enhancement-proposals/stargazers","contributors_url":"https://api.github.com/repos/jupyter/enhancement-proposals/contributors","subscribers_url":"https://api.github.com/repos/jupyter/enhancement-proposals/subscribers","subscription_url":"https://api.github.com/repos/jupyter/enhancement-proposals/subscription","commits_url":"https://api.github.com/repos/jupyter/enhancement-proposals/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyter/enhancement-proposals/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyter/enhancement-proposals/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyter/enhancement-proposals/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyter/enhancement-proposals/contents/{+path}","compare_url":"https://api.github.com/repos/jupyter/enhancement-proposals/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyter/enhancement-proposals/merges","archive_url":"https://api.github.com/repos/jupyter/enhancement-proposals/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyter/enhancement-proposals/downloads","issues_url":"https://api.github.com/repos/jupyter/enhancement-proposals/issues{/number}","pulls_url":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyter/enhancement-proposals/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyter/enhancement-proposals/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyter/enhancement-proposals/labels{/name}","releases_url":"https://api.github.com/repos/jupyter/enhancement-proposals/releases{/id}","deployments_url":"https://api.github.com/repos/jupyter/enhancement-proposals/deployments","created_at":"2015-08-27T21:01:47Z","updated_at":"2016-04-08T06:33:42Z","pushed_at":"2016-04-20T10:05:50Z","git_url":"git://github.com/jupyter/enhancement-proposals.git","ssh_url":"git@github.com:jupyter/enhancement-proposals.git","clone_url":"https://github.com/jupyter/enhancement-proposals.git","svn_url":"https://github.com/jupyter/enhancement-proposals","homepage":null,"size":76,"stargazers_count":14,"watchers_count":14,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":8,"forks":15,"open_issues":8,"watchers":14,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14"},"html":{"href":"https://github.com/jupyter/enhancement-proposals/pull/14"},"issue":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/issues/14"},"comments":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/jupyter/enhancement-proposals/statuses/77d97ba03387cc73109d314d2137b04714b5944d"}}}}