{"action":"created","comment":{"url":"https://api.github.com/repos/nteract/hydrogen/pulls/comments/70898777","id":70898777,"diff_hunk":"@@ -98,7 +74,13 @@ class KernelManager\n \n \n     getAllKernelSpecs: ->\n-        return _.map @_kernelSpecs, 'spec'\n+        # TODO(nikita): switch to async and jupyter-js-services API\n+        # Note that using sync here is a temporary regression, because it forces\n+        # a manual call to update-kernels by the user.\n+        # This will be fixed in a later patch, that adds proper async back\n+        kernelSpecs = zmq_services.getZMQGateway().getKernelSpecsSync()\n+        _.forEach kernelSpecs, (obj, name) -> obj.spec.name = name","path":"lib/kernel-manager.coffee","position":null,"original_position":90,"commit_id":"aaabe430bb2b20a8e211066ee7466caffc1d8a2d","original_commit_id":"a3dc04b5a0cd59432f4bdf4d1d6d92a3759eb627","user":{"login":"nikitakit","id":252225,"avatar_url":"https://avatars.githubusercontent.com/u/252225?v=3","gravatar_id":"","url":"https://api.github.com/users/nikitakit","html_url":"https://github.com/nikitakit","followers_url":"https://api.github.com/users/nikitakit/followers","following_url":"https://api.github.com/users/nikitakit/following{/other_user}","gists_url":"https://api.github.com/users/nikitakit/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitakit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitakit/subscriptions","organizations_url":"https://api.github.com/users/nikitakit/orgs","repos_url":"https://api.github.com/users/nikitakit/repos","events_url":"https://api.github.com/users/nikitakit/events{/privacy}","received_events_url":"https://api.github.com/users/nikitakit/received_events","type":"User","site_admin":false},"body":"Gateway kernel spawning works using the kernel name (not display_name), which is not part of the kernelspec.\r\n\r\nThis whole method gets rewritten in patch 2, where I address this in a more comprehensive way.","created_at":"2016-07-14T23:00:11Z","updated_at":"2016-07-14T23:00:11Z","html_url":"https://github.com/nteract/hydrogen/pull/330#discussion_r70898777","pull_request_url":"https://api.github.com/repos/nteract/hydrogen/pulls/330","_links":{"self":{"href":"https://api.github.com/repos/nteract/hydrogen/pulls/comments/70898777"},"html":{"href":"https://github.com/nteract/hydrogen/pull/330#discussion_r70898777"},"pull_request":{"href":"https://api.github.com/repos/nteract/hydrogen/pulls/330"}}},"pull_request":{"url":"https://api.github.com/repos/nteract/hydrogen/pulls/330","id":76682386,"html_url":"https://github.com/nteract/hydrogen/pull/330","diff_url":"https://github.com/nteract/hydrogen/pull/330.diff","patch_url":"https://github.com/nteract/hydrogen/pull/330.patch","issue_url":"https://api.github.com/repos/nteract/hydrogen/issues/330","number":330,"state":"open","locked":false,"title":"[DEMO] Support for remote kernels via kernel gateway","user":{"login":"nikitakit","id":252225,"avatar_url":"https://avatars.githubusercontent.com/u/252225?v=3","gravatar_id":"","url":"https://api.github.com/users/nikitakit","html_url":"https://github.com/nikitakit","followers_url":"https://api.github.com/users/nikitakit/followers","following_url":"https://api.github.com/users/nikitakit/following{/other_user}","gists_url":"https://api.github.com/users/nikitakit/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitakit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitakit/subscriptions","organizations_url":"https://api.github.com/users/nikitakit/orgs","repos_url":"https://api.github.com/users/nikitakit/repos","events_url":"https://api.github.com/users/nikitakit/events{/privacy}","received_events_url":"https://api.github.com/users/nikitakit/received_events","type":"User","site_admin":false},"body":"Thanks to everyone for developing hydrogen!\r\n\r\nI'm really happy with the features it provides, but unfortunately there are a few things that make it really hard to use with my everyday workflow. I'd like to share a rather substantial set of changes I made to get remote kernel support into a state where I can use it. (The code is still pretty rough; I haven't cleaned it up yet)\r\n\r\nThe work was driven by two guiding principles:\r\n1. Make remote kernels first-class citizens\r\n2. Never accidentally kill a kernel\r\n\r\nThe second point might seem obvious, but it is the main reason for using kernel gateways. ZMQ-forwarding approaches (like `rk`) tend to fail pretty badly on this regard. When the SSH connection to the server drops, they tend to activate cleanup routines that basically assume that the kernel is dead. This usually makes something as trivial as disconnecting from Wifi effectively kill a remote kernel. The desired behavior is tricky enough to get right that I know of only two implementations that can do it. They are the jupyter notebook and the jupyter kernel gateway (an official Jupyter project that mimics the programmatic API of the notebook)\r\n\r\nAlso remote kernels shouldn't be covered by hydrogen's resource management, which tends to destroy kernels on multiple codepaths (e.g. when hydrogen is disabled)\r\n\r\nChanges in this patchset:\r\n* Connect to kernels via kernel gateways instead of over ZMQ\r\n* Specify remote endpoints and authentication credentials via settings\r\n* Replaces the kernel switcher UI with a session switcher that can select among\r\nlocal and remote sessions\r\n* Kernel connections can survive survive both network failures and Atom restarts\r\n\r\nFor simplicity I implemented this as a replacement to ZMQ-based connections. This adds a hard dependency on jupyter and either jupyter_kernel_gateway or jupyter_notebook for local connections, but I don't see that as a problem because you're going to have to install some local kernels anyway.\r\n\r\nAt the moment it requires manually starting a notebook or gateway on localhost:8888, but if there is interest in the approach I think hydrogen could spawn its own gateway automatically.\r\n\r\n## Quick setup for testing\r\n\r\n* Start a Jupyter notebook (or jupyter kernel gateway) on localhost:8888\r\n* Run the modified version of Hydrogen\r\n\r\nMany of the more advanced features haven't been ported (so they don't work), but core execution functionality is there.\r\n\r\nI think the current state of the patch covers enough functionality to support a discussion about the merits of the approach.\r\n","created_at":"2016-07-07T23:36:29Z","updated_at":"2016-07-14T23:00:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a683ac710f563c125edaf8069cbfba5b5e46b60c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/nteract/hydrogen/pulls/330/commits","review_comments_url":"https://api.github.com/repos/nteract/hydrogen/pulls/330/comments","review_comment_url":"https://api.github.com/repos/nteract/hydrogen/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nteract/hydrogen/issues/330/comments","statuses_url":"https://api.github.com/repos/nteract/hydrogen/statuses/aaabe430bb2b20a8e211066ee7466caffc1d8a2d","head":{"label":"nikitakit:kernelgateway","ref":"kernelgateway","sha":"aaabe430bb2b20a8e211066ee7466caffc1d8a2d","user":{"login":"nikitakit","id":252225,"avatar_url":"https://avatars.githubusercontent.com/u/252225?v=3","gravatar_id":"","url":"https://api.github.com/users/nikitakit","html_url":"https://github.com/nikitakit","followers_url":"https://api.github.com/users/nikitakit/followers","following_url":"https://api.github.com/users/nikitakit/following{/other_user}","gists_url":"https://api.github.com/users/nikitakit/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitakit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitakit/subscriptions","organizations_url":"https://api.github.com/users/nikitakit/orgs","repos_url":"https://api.github.com/users/nikitakit/repos","events_url":"https://api.github.com/users/nikitakit/events{/privacy}","received_events_url":"https://api.github.com/users/nikitakit/received_events","type":"User","site_admin":false},"repo":{"id":62476578,"name":"deuterium","full_name":"nikitakit/deuterium","owner":{"login":"nikitakit","id":252225,"avatar_url":"https://avatars.githubusercontent.com/u/252225?v=3","gravatar_id":"","url":"https://api.github.com/users/nikitakit","html_url":"https://github.com/nikitakit","followers_url":"https://api.github.com/users/nikitakit/followers","following_url":"https://api.github.com/users/nikitakit/following{/other_user}","gists_url":"https://api.github.com/users/nikitakit/gists{/gist_id}","starred_url":"https://api.github.com/users/nikitakit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikitakit/subscriptions","organizations_url":"https://api.github.com/users/nikitakit/orgs","repos_url":"https://api.github.com/users/nikitakit/repos","events_url":"https://api.github.com/users/nikitakit/events{/privacy}","received_events_url":"https://api.github.com/users/nikitakit/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nikitakit/deuterium","description":"Python live coding in Atom (Python3-only fork of Hydrogen)","fork":true,"url":"https://api.github.com/repos/nikitakit/deuterium","forks_url":"https://api.github.com/repos/nikitakit/deuterium/forks","keys_url":"https://api.github.com/repos/nikitakit/deuterium/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nikitakit/deuterium/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nikitakit/deuterium/teams","hooks_url":"https://api.github.com/repos/nikitakit/deuterium/hooks","issue_events_url":"https://api.github.com/repos/nikitakit/deuterium/issues/events{/number}","events_url":"https://api.github.com/repos/nikitakit/deuterium/events","assignees_url":"https://api.github.com/repos/nikitakit/deuterium/assignees{/user}","branches_url":"https://api.github.com/repos/nikitakit/deuterium/branches{/branch}","tags_url":"https://api.github.com/repos/nikitakit/deuterium/tags","blobs_url":"https://api.github.com/repos/nikitakit/deuterium/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nikitakit/deuterium/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nikitakit/deuterium/git/refs{/sha}","trees_url":"https://api.github.com/repos/nikitakit/deuterium/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nikitakit/deuterium/statuses/{sha}","languages_url":"https://api.github.com/repos/nikitakit/deuterium/languages","stargazers_url":"https://api.github.com/repos/nikitakit/deuterium/stargazers","contributors_url":"https://api.github.com/repos/nikitakit/deuterium/contributors","subscribers_url":"https://api.github.com/repos/nikitakit/deuterium/subscribers","subscription_url":"https://api.github.com/repos/nikitakit/deuterium/subscription","commits_url":"https://api.github.com/repos/nikitakit/deuterium/commits{/sha}","git_commits_url":"https://api.github.com/repos/nikitakit/deuterium/git/commits{/sha}","comments_url":"https://api.github.com/repos/nikitakit/deuterium/comments{/number}","issue_comment_url":"https://api.github.com/repos/nikitakit/deuterium/issues/comments{/number}","contents_url":"https://api.github.com/repos/nikitakit/deuterium/contents/{+path}","compare_url":"https://api.github.com/repos/nikitakit/deuterium/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nikitakit/deuterium/merges","archive_url":"https://api.github.com/repos/nikitakit/deuterium/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nikitakit/deuterium/downloads","issues_url":"https://api.github.com/repos/nikitakit/deuterium/issues{/number}","pulls_url":"https://api.github.com/repos/nikitakit/deuterium/pulls{/number}","milestones_url":"https://api.github.com/repos/nikitakit/deuterium/milestones{/number}","notifications_url":"https://api.github.com/repos/nikitakit/deuterium/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nikitakit/deuterium/labels{/name}","releases_url":"https://api.github.com/repos/nikitakit/deuterium/releases{/id}","deployments_url":"https://api.github.com/repos/nikitakit/deuterium/deployments","created_at":"2016-07-03T01:34:41Z","updated_at":"2016-07-03T02:35:27Z","pushed_at":"2016-07-14T14:37:45Z","git_url":"git://github.com/nikitakit/deuterium.git","ssh_url":"git@github.com:nikitakit/deuterium.git","clone_url":"https://github.com/nikitakit/deuterium.git","svn_url":"https://github.com/nikitakit/deuterium","homepage":"https://atom.io/packages/deuterium","size":456,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":"nteract:master","ref":"master","sha":"d25a1b6392c3489370749500c349b8c27927682e","user":{"login":"nteract","id":12401040,"avatar_url":"https://avatars.githubusercontent.com/u/12401040?v=3","gravatar_id":"","url":"https://api.github.com/users/nteract","html_url":"https://github.com/nteract","followers_url":"https://api.github.com/users/nteract/followers","following_url":"https://api.github.com/users/nteract/following{/other_user}","gists_url":"https://api.github.com/users/nteract/gists{/gist_id}","starred_url":"https://api.github.com/users/nteract/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nteract/subscriptions","organizations_url":"https://api.github.com/users/nteract/orgs","repos_url":"https://api.github.com/users/nteract/repos","events_url":"https://api.github.com/users/nteract/events{/privacy}","received_events_url":"https://api.github.com/users/nteract/received_events","type":"Organization","site_admin":false},"repo":{"id":35395056,"name":"hydrogen","full_name":"nteract/hydrogen","owner":{"login":"nteract","id":12401040,"avatar_url":"https://avatars.githubusercontent.com/u/12401040?v=3","gravatar_id":"","url":"https://api.github.com/users/nteract","html_url":"https://github.com/nteract","followers_url":"https://api.github.com/users/nteract/followers","following_url":"https://api.github.com/users/nteract/following{/other_user}","gists_url":"https://api.github.com/users/nteract/gists{/gist_id}","starred_url":"https://api.github.com/users/nteract/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nteract/subscriptions","organizations_url":"https://api.github.com/users/nteract/orgs","repos_url":"https://api.github.com/users/nteract/repos","events_url":"https://api.github.com/users/nteract/events{/privacy}","received_events_url":"https://api.github.com/users/nteract/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nteract/hydrogen","description":":eight_spoked_asterisk: Run code inline in Atom using Jupyter kernels","fork":false,"url":"https://api.github.com/repos/nteract/hydrogen","forks_url":"https://api.github.com/repos/nteract/hydrogen/forks","keys_url":"https://api.github.com/repos/nteract/hydrogen/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nteract/hydrogen/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nteract/hydrogen/teams","hooks_url":"https://api.github.com/repos/nteract/hydrogen/hooks","issue_events_url":"https://api.github.com/repos/nteract/hydrogen/issues/events{/number}","events_url":"https://api.github.com/repos/nteract/hydrogen/events","assignees_url":"https://api.github.com/repos/nteract/hydrogen/assignees{/user}","branches_url":"https://api.github.com/repos/nteract/hydrogen/branches{/branch}","tags_url":"https://api.github.com/repos/nteract/hydrogen/tags","blobs_url":"https://api.github.com/repos/nteract/hydrogen/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nteract/hydrogen/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nteract/hydrogen/git/refs{/sha}","trees_url":"https://api.github.com/repos/nteract/hydrogen/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nteract/hydrogen/statuses/{sha}","languages_url":"https://api.github.com/repos/nteract/hydrogen/languages","stargazers_url":"https://api.github.com/repos/nteract/hydrogen/stargazers","contributors_url":"https://api.github.com/repos/nteract/hydrogen/contributors","subscribers_url":"https://api.github.com/repos/nteract/hydrogen/subscribers","subscription_url":"https://api.github.com/repos/nteract/hydrogen/subscription","commits_url":"https://api.github.com/repos/nteract/hydrogen/commits{/sha}","git_commits_url":"https://api.github.com/repos/nteract/hydrogen/git/commits{/sha}","comments_url":"https://api.github.com/repos/nteract/hydrogen/comments{/number}","issue_comment_url":"https://api.github.com/repos/nteract/hydrogen/issues/comments{/number}","contents_url":"https://api.github.com/repos/nteract/hydrogen/contents/{+path}","compare_url":"https://api.github.com/repos/nteract/hydrogen/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nteract/hydrogen/merges","archive_url":"https://api.github.com/repos/nteract/hydrogen/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nteract/hydrogen/downloads","issues_url":"https://api.github.com/repos/nteract/hydrogen/issues{/number}","pulls_url":"https://api.github.com/repos/nteract/hydrogen/pulls{/number}","milestones_url":"https://api.github.com/repos/nteract/hydrogen/milestones{/number}","notifications_url":"https://api.github.com/repos/nteract/hydrogen/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nteract/hydrogen/labels{/name}","releases_url":"https://api.github.com/repos/nteract/hydrogen/releases{/id}","deployments_url":"https://api.github.com/repos/nteract/hydrogen/deployments","created_at":"2015-05-11T01:16:55Z","updated_at":"2016-07-14T17:40:15Z","pushed_at":"2016-07-14T14:37:45Z","git_url":"git://github.com/nteract/hydrogen.git","ssh_url":"git@github.com:nteract/hydrogen.git","clone_url":"https://github.com/nteract/hydrogen.git","svn_url":"https://github.com/nteract/hydrogen","homepage":"https://atom.io/packages/hydrogen","size":479,"stargazers_count":660,"watchers_count":660,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":51,"forks":24,"open_issues":51,"watchers":660,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nteract/hydrogen/pulls/330"},"html":{"href":"https://github.com/nteract/hydrogen/pull/330"},"issue":{"href":"https://api.github.com/repos/nteract/hydrogen/issues/330"},"comments":{"href":"https://api.github.com/repos/nteract/hydrogen/issues/330/comments"},"review_comments":{"href":"https://api.github.com/repos/nteract/hydrogen/pulls/330/comments"},"review_comment":{"href":"https://api.github.com/repos/nteract/hydrogen/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nteract/hydrogen/pulls/330/commits"},"statuses":{"href":"https://api.github.com/repos/nteract/hydrogen/statuses/aaabe430bb2b20a8e211066ee7466caffc1d8a2d"}}}}
{"actor":{"display_login":"nikitakit"}}