{"action":"created","comment":{"url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments/54211975","id":54211975,"diff_hunk":"@@ -170,5 +224,38 @@ def handle_requests(self, authentication, proxy_requests):\n             finally:\n                 conn.close()\n \n-# TODO: RESTful API driven proxy?\n+class RestGolangProxyIpc(object):\n+\n+    def __init__(self, config):\n+        self.config = config\n+        self.api_url = 'http://127.0.0.1:%s/api?api_key=%s' % (self.config.dynamic_proxy_bind_port, self.config.dynamic_proxy_golang_api_key)\n+\n+    def handle_requests(self, authentication, proxy_requests, route_name, container_ids, sleep=1):\n+        \"\"\"Make a POST request to the GO proxy to register a route\n+        \"\"\"\n+        values = {\n+            'FrontendPath': route_name,\n+            'BackendAddr': \"%s:%s\" % ( proxy_requests.host, proxy_requests.port ),\n+            'AuthorizedCookie': authentication.cookie_value,\n+            'ContainerIds': container_ids,\n+        }\n+\n+        print values","path":"lib/galaxy/web/proxy/__init__.py","position":null,"original_position":193,"commit_id":"5bfb87204841ddf566d078555e9f0458dd407de5","original_commit_id":"3c8278c1bae103d5aaa3d264748c5f9049474dba","user":{"login":"erasche","id":458683,"avatar_url":"https://avatars.githubusercontent.com/u/458683?v=3","gravatar_id":"","url":"https://api.github.com/users/erasche","html_url":"https://github.com/erasche","followers_url":"https://api.github.com/users/erasche/followers","following_url":"https://api.github.com/users/erasche/following{/other_user}","gists_url":"https://api.github.com/users/erasche/gists{/gist_id}","starred_url":"https://api.github.com/users/erasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erasche/subscriptions","organizations_url":"https://api.github.com/users/erasche/orgs","repos_url":"https://api.github.com/users/erasche/repos","events_url":"https://api.github.com/users/erasche/events{/privacy}","received_events_url":"https://api.github.com/users/erasche/received_events","type":"User","site_admin":false},"body":"Heh, fair. Nice catch","created_at":"2016-02-26T07:26:38Z","updated_at":"2016-02-26T07:26:38Z","html_url":"https://github.com/galaxyproject/galaxy/pull/1807#discussion_r54211975","pull_request_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807","_links":{"self":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments/54211975"},"html":{"href":"https://github.com/galaxyproject/galaxy/pull/1807#discussion_r54211975"},"pull_request":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807"}}},"pull_request":{"url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807","id":60801497,"html_url":"https://github.com/galaxyproject/galaxy/pull/1807","diff_url":"https://github.com/galaxyproject/galaxy/pull/1807.diff","patch_url":"https://github.com/galaxyproject/galaxy/pull/1807.patch","issue_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/1807","number":1807,"state":"open","locked":false,"title":"Implement new GIE proxy","user":{"login":"erasche","id":458683,"avatar_url":"https://avatars.githubusercontent.com/u/458683?v=3","gravatar_id":"","url":"https://api.github.com/users/erasche","html_url":"https://github.com/erasche","followers_url":"https://api.github.com/users/erasche/followers","following_url":"https://api.github.com/users/erasche/following{/other_user}","gists_url":"https://api.github.com/users/erasche/gists{/gist_id}","starred_url":"https://api.github.com/users/erasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erasche/subscriptions","organizations_url":"https://api.github.com/users/erasche/orgs","repos_url":"https://api.github.com/users/erasche/repos","events_url":"https://api.github.com/users/erasche/events{/privacy}","received_events_url":"https://api.github.com/users/erasche/received_events","type":"User","site_admin":false},"body":"This provides an alternative proxy to the original NodeJS proxy.\r\n\r\nThe implementation is done in golang, which has the nice property of compiling to a single binary. While it's a negative in terms of number of devteam who write that language, I'd argue it's not that much worse than nodejs in terms of accessibility to new devs. The upside is that there are zero dependencies, no nodejs, no modules to install, no version issues. Just a single binary to plop in, it could not be easier.\r\n\r\nFeatures include:\r\n\r\n- Simple rest-ish API instead of file-based IPC\r\n- Automatic culling of containers from the Galaxy side, no more monitor_traffic.sh hacks\r\n- Admin configurable, cross GIE timeout setting. The admin sets it once, it applies to all GIEs.\r\n- Works on windows!\r\n    - I'm mostly kidding, but the cross compilation features of golang are really swell.\r\n    - Get your platform appropriate binary here https://jenkins.galaxyproject.org/job/GIE-proxy/\r\n\r\nThis is a redo of #852, without the docker-compose stuff. This is marked WIP as I haven't figured out distribution of the proxy binary yet.\r\n\r\ncc @bgruening @jmchilton \r\n\r\n@bgruening you had raised concerns about this alternative to `monitor_traffic.sh`, I'd like to reply to them now :)\r\n\r\njupyter uses websockets, and those have a ping/pong that occurs every 30 seconds. This will keep the container alive essentially indefinitely. I've been running one in another tab on another desktop for half an hour and no problems. I've been watching the logs and no problems show up. \r\n\r\n```\r\n06:48:05.569 Seen > DEBU 0b4 2016-02-26 06:47:37.369907421 +0000 UTC seen 2016-02-26 06:48:05.569944278 +0000 UTC\r\n06:48:35.569 Seen > DEBU 0c6 2016-02-26 06:48:07.370419873 +0000 UTC seen 2016-02-26 06:48:35.569832561 +0000 UTC\r\n06:49:05.570 Seen > DEBU 0d8 2016-02-26 06:48:37.370218441 +0000 UTC seen 2016-02-26 06:49:05.570293131 +0000 UTC\r\n06:49:35.569 Seen > DEBU 0ea 2016-02-26 06:49:07.369800935 +0000 UTC seen 2016-02-26 06:49:35.569910645 +0000 UTC\r\n```\r\n\r\nThe `Route` object has a `LastSeen` attribute. A `.Seen()` method is called which was generating the above as part of debugging. Every time a ws/http request comes in, the LastSeen attribute is updated, which prevents the route from being killed.","created_at":"2016-02-26T07:06:11Z","updated_at":"2016-02-26T07:26:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dd54948fae3e0b19357d2fd8bee7248d6243cfef","assignee":null,"milestone":{"url":"https://api.github.com/repos/galaxyproject/galaxy/milestones/2","html_url":"https://github.com/galaxyproject/galaxy/milestones/16.04","labels_url":"https://api.github.com/repos/galaxyproject/galaxy/milestones/2/labels","id":1435676,"number":2,"title":"16.04","description":"Update this after 16.01","creator":{"login":"erasche","id":458683,"avatar_url":"https://avatars.githubusercontent.com/u/458683?v=3","gravatar_id":"","url":"https://api.github.com/users/erasche","html_url":"https://github.com/erasche","followers_url":"https://api.github.com/users/erasche/followers","following_url":"https://api.github.com/users/erasche/following{/other_user}","gists_url":"https://api.github.com/users/erasche/gists{/gist_id}","starred_url":"https://api.github.com/users/erasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erasche/subscriptions","organizations_url":"https://api.github.com/users/erasche/orgs","repos_url":"https://api.github.com/users/erasche/repos","events_url":"https://api.github.com/users/erasche/events{/privacy}","received_events_url":"https://api.github.com/users/erasche/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":103,"state":"open","created_at":"2015-11-30T17:22:37Z","updated_at":"2016-02-26T07:07:29Z","due_on":"2016-04-01T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807/commits","review_comments_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807/comments","review_comment_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/1807/comments","statuses_url":"https://api.github.com/repos/galaxyproject/galaxy/statuses/5bfb87204841ddf566d078555e9f0458dd407de5","head":{"label":"erasche:gie-go-proxy-2","ref":"gie-go-proxy-2","sha":"5bfb87204841ddf566d078555e9f0458dd407de5","user":{"login":"erasche","id":458683,"avatar_url":"https://avatars.githubusercontent.com/u/458683?v=3","gravatar_id":"","url":"https://api.github.com/users/erasche","html_url":"https://github.com/erasche","followers_url":"https://api.github.com/users/erasche/followers","following_url":"https://api.github.com/users/erasche/following{/other_user}","gists_url":"https://api.github.com/users/erasche/gists{/gist_id}","starred_url":"https://api.github.com/users/erasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erasche/subscriptions","organizations_url":"https://api.github.com/users/erasche/orgs","repos_url":"https://api.github.com/users/erasche/repos","events_url":"https://api.github.com/users/erasche/events{/privacy}","received_events_url":"https://api.github.com/users/erasche/received_events","type":"User","site_admin":false},"repo":{"id":32467598,"name":"galaxy","full_name":"erasche/galaxy","owner":{"login":"erasche","id":458683,"avatar_url":"https://avatars.githubusercontent.com/u/458683?v=3","gravatar_id":"","url":"https://api.github.com/users/erasche","html_url":"https://github.com/erasche","followers_url":"https://api.github.com/users/erasche/followers","following_url":"https://api.github.com/users/erasche/following{/other_user}","gists_url":"https://api.github.com/users/erasche/gists{/gist_id}","starred_url":"https://api.github.com/users/erasche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erasche/subscriptions","organizations_url":"https://api.github.com/users/erasche/orgs","repos_url":"https://api.github.com/users/erasche/repos","events_url":"https://api.github.com/users/erasche/events{/privacy}","received_events_url":"https://api.github.com/users/erasche/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erasche/galaxy","description":"Data intensive biology for everyone.","fork":true,"url":"https://api.github.com/repos/erasche/galaxy","forks_url":"https://api.github.com/repos/erasche/galaxy/forks","keys_url":"https://api.github.com/repos/erasche/galaxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erasche/galaxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erasche/galaxy/teams","hooks_url":"https://api.github.com/repos/erasche/galaxy/hooks","issue_events_url":"https://api.github.com/repos/erasche/galaxy/issues/events{/number}","events_url":"https://api.github.com/repos/erasche/galaxy/events","assignees_url":"https://api.github.com/repos/erasche/galaxy/assignees{/user}","branches_url":"https://api.github.com/repos/erasche/galaxy/branches{/branch}","tags_url":"https://api.github.com/repos/erasche/galaxy/tags","blobs_url":"https://api.github.com/repos/erasche/galaxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erasche/galaxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erasche/galaxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/erasche/galaxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erasche/galaxy/statuses/{sha}","languages_url":"https://api.github.com/repos/erasche/galaxy/languages","stargazers_url":"https://api.github.com/repos/erasche/galaxy/stargazers","contributors_url":"https://api.github.com/repos/erasche/galaxy/contributors","subscribers_url":"https://api.github.com/repos/erasche/galaxy/subscribers","subscription_url":"https://api.github.com/repos/erasche/galaxy/subscription","commits_url":"https://api.github.com/repos/erasche/galaxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/erasche/galaxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/erasche/galaxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/erasche/galaxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/erasche/galaxy/contents/{+path}","compare_url":"https://api.github.com/repos/erasche/galaxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erasche/galaxy/merges","archive_url":"https://api.github.com/repos/erasche/galaxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erasche/galaxy/downloads","issues_url":"https://api.github.com/repos/erasche/galaxy/issues{/number}","pulls_url":"https://api.github.com/repos/erasche/galaxy/pulls{/number}","milestones_url":"https://api.github.com/repos/erasche/galaxy/milestones{/number}","notifications_url":"https://api.github.com/repos/erasche/galaxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erasche/galaxy/labels{/name}","releases_url":"https://api.github.com/repos/erasche/galaxy/releases{/id}","deployments_url":"https://api.github.com/repos/erasche/galaxy/deployments","created_at":"2015-03-18T15:37:04Z","updated_at":"2015-05-07T16:22:05Z","pushed_at":"2016-02-26T07:26:33Z","git_url":"git://github.com/erasche/galaxy.git","ssh_url":"git@github.com:erasche/galaxy.git","clone_url":"https://github.com/erasche/galaxy.git","svn_url":"https://github.com/erasche/galaxy","homepage":"http://galaxyproject.org/","size":91408,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":0,"default_branch":"dev"}},"base":{"label":"galaxyproject:dev","ref":"dev","sha":"da50cf114923b241f1e4c6fc1d90f920207170cf","user":{"login":"galaxyproject","id":7937847,"avatar_url":"https://avatars.githubusercontent.com/u/7937847?v=3","gravatar_id":"","url":"https://api.github.com/users/galaxyproject","html_url":"https://github.com/galaxyproject","followers_url":"https://api.github.com/users/galaxyproject/followers","following_url":"https://api.github.com/users/galaxyproject/following{/other_user}","gists_url":"https://api.github.com/users/galaxyproject/gists{/gist_id}","starred_url":"https://api.github.com/users/galaxyproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galaxyproject/subscriptions","organizations_url":"https://api.github.com/users/galaxyproject/orgs","repos_url":"https://api.github.com/users/galaxyproject/repos","events_url":"https://api.github.com/users/galaxyproject/events{/privacy}","received_events_url":"https://api.github.com/users/galaxyproject/received_events","type":"Organization","site_admin":false},"repo":{"id":31211061,"name":"galaxy","full_name":"galaxyproject/galaxy","owner":{"login":"galaxyproject","id":7937847,"avatar_url":"https://avatars.githubusercontent.com/u/7937847?v=3","gravatar_id":"","url":"https://api.github.com/users/galaxyproject","html_url":"https://github.com/galaxyproject","followers_url":"https://api.github.com/users/galaxyproject/followers","following_url":"https://api.github.com/users/galaxyproject/following{/other_user}","gists_url":"https://api.github.com/users/galaxyproject/gists{/gist_id}","starred_url":"https://api.github.com/users/galaxyproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galaxyproject/subscriptions","organizations_url":"https://api.github.com/users/galaxyproject/orgs","repos_url":"https://api.github.com/users/galaxyproject/repos","events_url":"https://api.github.com/users/galaxyproject/events{/privacy}","received_events_url":"https://api.github.com/users/galaxyproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/galaxyproject/galaxy","description":"Data intensive science for everyone.","fork":false,"url":"https://api.github.com/repos/galaxyproject/galaxy","forks_url":"https://api.github.com/repos/galaxyproject/galaxy/forks","keys_url":"https://api.github.com/repos/galaxyproject/galaxy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/galaxyproject/galaxy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/galaxyproject/galaxy/teams","hooks_url":"https://api.github.com/repos/galaxyproject/galaxy/hooks","issue_events_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/events{/number}","events_url":"https://api.github.com/repos/galaxyproject/galaxy/events","assignees_url":"https://api.github.com/repos/galaxyproject/galaxy/assignees{/user}","branches_url":"https://api.github.com/repos/galaxyproject/galaxy/branches{/branch}","tags_url":"https://api.github.com/repos/galaxyproject/galaxy/tags","blobs_url":"https://api.github.com/repos/galaxyproject/galaxy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/galaxyproject/galaxy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/galaxyproject/galaxy/git/refs{/sha}","trees_url":"https://api.github.com/repos/galaxyproject/galaxy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/galaxyproject/galaxy/statuses/{sha}","languages_url":"https://api.github.com/repos/galaxyproject/galaxy/languages","stargazers_url":"https://api.github.com/repos/galaxyproject/galaxy/stargazers","contributors_url":"https://api.github.com/repos/galaxyproject/galaxy/contributors","subscribers_url":"https://api.github.com/repos/galaxyproject/galaxy/subscribers","subscription_url":"https://api.github.com/repos/galaxyproject/galaxy/subscription","commits_url":"https://api.github.com/repos/galaxyproject/galaxy/commits{/sha}","git_commits_url":"https://api.github.com/repos/galaxyproject/galaxy/git/commits{/sha}","comments_url":"https://api.github.com/repos/galaxyproject/galaxy/comments{/number}","issue_comment_url":"https://api.github.com/repos/galaxyproject/galaxy/issues/comments{/number}","contents_url":"https://api.github.com/repos/galaxyproject/galaxy/contents/{+path}","compare_url":"https://api.github.com/repos/galaxyproject/galaxy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/galaxyproject/galaxy/merges","archive_url":"https://api.github.com/repos/galaxyproject/galaxy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/galaxyproject/galaxy/downloads","issues_url":"https://api.github.com/repos/galaxyproject/galaxy/issues{/number}","pulls_url":"https://api.github.com/repos/galaxyproject/galaxy/pulls{/number}","milestones_url":"https://api.github.com/repos/galaxyproject/galaxy/milestones{/number}","notifications_url":"https://api.github.com/repos/galaxyproject/galaxy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/galaxyproject/galaxy/labels{/name}","releases_url":"https://api.github.com/repos/galaxyproject/galaxy/releases{/id}","deployments_url":"https://api.github.com/repos/galaxyproject/galaxy/deployments","created_at":"2015-02-23T14:18:06Z","updated_at":"2016-02-19T08:18:04Z","pushed_at":"2016-02-26T07:26:34Z","git_url":"git://github.com/galaxyproject/galaxy.git","ssh_url":"git@github.com:galaxyproject/galaxy.git","clone_url":"https://github.com/galaxyproject/galaxy.git","svn_url":"https://github.com/galaxyproject/galaxy","homepage":"https://galaxyproject.org/","size":115027,"stargazers_count":116,"watchers_count":116,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":171,"mirror_url":null,"open_issues_count":304,"forks":171,"open_issues":304,"watchers":116,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807"},"html":{"href":"https://github.com/galaxyproject/galaxy/pull/1807"},"issue":{"href":"https://api.github.com/repos/galaxyproject/galaxy/issues/1807"},"comments":{"href":"https://api.github.com/repos/galaxyproject/galaxy/issues/1807/comments"},"review_comments":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807/comments"},"review_comment":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/galaxyproject/galaxy/pulls/1807/commits"},"statuses":{"href":"https://api.github.com/repos/galaxyproject/galaxy/statuses/5bfb87204841ddf566d078555e9f0458dd407de5"}}}}