{"action":"created","comment":{"url":"https://api.github.com/repos/cylc/cylc/pulls/comments/25935245","id":25935245,"diff_hunk":"@@ -0,0 +1,61 @@\n+#!/usr/bin/env python\n+\n+# THIS FILE IS PART OF THE CYLC SUITE ENGINE.\n+# Copyright (C) 2008-2015 NIWA\n+#\n+# This program is free software: you can redistribute it and/or modify\n+# it under the terms of the GNU General Public License as published by\n+# the Free Software Foundation, either version 3 of the License, or\n+# (at your option) any later version.\n+#\n+# This program is distributed in the hope that it will be useful,\n+# but WITHOUT ANY WARRANTY; without even the implied warranty of\n+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+# GNU General Public License for more details.\n+#\n+# You should have received a copy of the GNU General Public License\n+# along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+\"IBM Platform LSF bsub job submission\"\n+\n+import re\n+\n+\n+class LSFHandler(object):\n+    \"IBM Platform LSF bsub job submission\"\n+\n+    DIRECTIVE_PREFIX = \"#BSUB \"\n+    KILL_CMD_TMPL = \"bkill '%(job_id)s'\"\n+    POLL_CMD_TMPL = \"bjobs -noheader '%(job_id)s'\"\n+    REC_ID_FROM_SUBMIT_OUT = re.compile(r\"^Job <(?P<id>\\d+)>\")\n+    SUBMIT_CMD_TMPL = \"bsub\"\n+    SUBMIT_CMD_STDIN_EXEC_TMPL = \"cat '%(job)s'\"","path":"lib/cylc/batch_sys_handlers/lsf.py","position":31,"original_position":31,"commit_id":"14a6dd7b2708dce99bf3e092236c3e58990ffd6c","original_commit_id":"14a6dd7b2708dce99bf3e092236c3e58990ffd6c","user":{"login":"matthewrmshin","id":908613,"avatar_url":"https://avatars.githubusercontent.com/u/908613?v=3","gravatar_id":"","url":"https://api.github.com/users/matthewrmshin","html_url":"https://github.com/matthewrmshin","followers_url":"https://api.github.com/users/matthewrmshin/followers","following_url":"https://api.github.com/users/matthewrmshin/following{/other_user}","gists_url":"https://api.github.com/users/matthewrmshin/gists{/gist_id}","starred_url":"https://api.github.com/users/matthewrmshin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matthewrmshin/subscriptions","organizations_url":"https://api.github.com/users/matthewrmshin/orgs","repos_url":"https://api.github.com/users/matthewrmshin/repos","events_url":"https://api.github.com/users/matthewrmshin/events{/privacy}","received_events_url":"https://api.github.com/users/matthewrmshin/received_events","type":"User","site_admin":false},"body":"Instead of using a `cat` command to open another pipe, I think it will be much nicer to do:\r\n\r\n```python\r\nproc = Popen(\r\n    command,\r\n    stdin=open(job_file_path),\r\n    # ...\r\n)\r\n```","created_at":"2015-03-06T10:00:25Z","updated_at":"2015-03-06T10:00:25Z","html_url":"https://github.com/cylc/cylc/pull/1362#discussion_r25935245","pull_request_url":"https://api.github.com/repos/cylc/cylc/pulls/1362","_links":{"self":{"href":"https://api.github.com/repos/cylc/cylc/pulls/comments/25935245"},"html":{"href":"https://github.com/cylc/cylc/pull/1362#discussion_r25935245"},"pull_request":{"href":"https://api.github.com/repos/cylc/cylc/pulls/1362"}}},"pull_request":{"url":"https://api.github.com/repos/cylc/cylc/pulls/1362","id":30554053,"html_url":"https://github.com/cylc/cylc/pull/1362","diff_url":"https://github.com/cylc/cylc/pull/1362.diff","patch_url":"https://github.com/cylc/cylc/pull/1362.patch","issue_url":"https://api.github.com/repos/cylc/cylc/issues/1362","number":1362,"state":"open","locked":false,"title":"Add IBM Platform LSF batch submission support.","user":{"login":"benfitzpatrick","id":1138333,"avatar_url":"https://avatars.githubusercontent.com/u/1138333?v=3","gravatar_id":"","url":"https://api.github.com/users/benfitzpatrick","html_url":"https://github.com/benfitzpatrick","followers_url":"https://api.github.com/users/benfitzpatrick/followers","following_url":"https://api.github.com/users/benfitzpatrick/following{/other_user}","gists_url":"https://api.github.com/users/benfitzpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/benfitzpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfitzpatrick/subscriptions","organizations_url":"https://api.github.com/users/benfitzpatrick/orgs","repos_url":"https://api.github.com/users/benfitzpatrick/repos","events_url":"https://api.github.com/users/benfitzpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/benfitzpatrick/received_events","type":"User","site_admin":false},"body":"This adds support for LSF. In order to use directives in the command\r\nfile, the whole file contents must be piped into 'bsub'. This requires\r\nsome extra generic batch system support.\r\n\r\nThis pull request includes tests that can't be run yet on the destination\r\nplatform, so it is not for merging yet.\r\n\r\n@matthewrmshin, please take a look when you can.","created_at":"2015-03-05T12:49:40Z","updated_at":"2015-03-06T10:00:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3bfa8e2bab8ba452fb83e4430d45a0262001903","assignee":{"login":"benfitzpatrick","id":1138333,"avatar_url":"https://avatars.githubusercontent.com/u/1138333?v=3","gravatar_id":"","url":"https://api.github.com/users/benfitzpatrick","html_url":"https://github.com/benfitzpatrick","followers_url":"https://api.github.com/users/benfitzpatrick/followers","following_url":"https://api.github.com/users/benfitzpatrick/following{/other_user}","gists_url":"https://api.github.com/users/benfitzpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/benfitzpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfitzpatrick/subscriptions","organizations_url":"https://api.github.com/users/benfitzpatrick/orgs","repos_url":"https://api.github.com/users/benfitzpatrick/repos","events_url":"https://api.github.com/users/benfitzpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/benfitzpatrick/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/cylc/cylc/milestones/5","html_url":"https://github.com/cylc/cylc/milestones/soon","labels_url":"https://api.github.com/repos/cylc/cylc/milestones/5/labels","id":262614,"number":5,"title":"soon","description":"A few months in the future. Top priority issues and easy fixes should initially be marked against this milestone, and then moved to *next-release* if work progresses quickly enough.","creator":{"login":"hjoliver","id":2362137,"avatar_url":"https://avatars.githubusercontent.com/u/2362137?v=3","gravatar_id":"","url":"https://api.github.com/users/hjoliver","html_url":"https://github.com/hjoliver","followers_url":"https://api.github.com/users/hjoliver/followers","following_url":"https://api.github.com/users/hjoliver/following{/other_user}","gists_url":"https://api.github.com/users/hjoliver/gists{/gist_id}","starred_url":"https://api.github.com/users/hjoliver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hjoliver/subscriptions","organizations_url":"https://api.github.com/users/hjoliver/orgs","repos_url":"https://api.github.com/users/hjoliver/repos","events_url":"https://api.github.com/users/hjoliver/events{/privacy}","received_events_url":"https://api.github.com/users/hjoliver/received_events","type":"User","site_admin":false},"open_issues":61,"closed_issues":0,"state":"open","created_at":"2013-02-08T07:07:13Z","updated_at":"2015-03-05T12:50:21Z","due_on":"2015-05-30T23:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/cylc/cylc/pulls/1362/commits","review_comments_url":"https://api.github.com/repos/cylc/cylc/pulls/1362/comments","review_comment_url":"https://api.github.com/repos/cylc/cylc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cylc/cylc/issues/1362/comments","statuses_url":"https://api.github.com/repos/cylc/cylc/statuses/14a6dd7b2708dce99bf3e092236c3e58990ffd6c","head":{"label":"benfitzpatrick:batch_sys.lsf","ref":"batch_sys.lsf","sha":"14a6dd7b2708dce99bf3e092236c3e58990ffd6c","user":{"login":"benfitzpatrick","id":1138333,"avatar_url":"https://avatars.githubusercontent.com/u/1138333?v=3","gravatar_id":"","url":"https://api.github.com/users/benfitzpatrick","html_url":"https://github.com/benfitzpatrick","followers_url":"https://api.github.com/users/benfitzpatrick/followers","following_url":"https://api.github.com/users/benfitzpatrick/following{/other_user}","gists_url":"https://api.github.com/users/benfitzpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/benfitzpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfitzpatrick/subscriptions","organizations_url":"https://api.github.com/users/benfitzpatrick/orgs","repos_url":"https://api.github.com/users/benfitzpatrick/repos","events_url":"https://api.github.com/users/benfitzpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/benfitzpatrick/received_events","type":"User","site_admin":false},"repo":{"id":2606625,"name":"cylc","full_name":"benfitzpatrick/cylc","owner":{"login":"benfitzpatrick","id":1138333,"avatar_url":"https://avatars.githubusercontent.com/u/1138333?v=3","gravatar_id":"","url":"https://api.github.com/users/benfitzpatrick","html_url":"https://github.com/benfitzpatrick","followers_url":"https://api.github.com/users/benfitzpatrick/followers","following_url":"https://api.github.com/users/benfitzpatrick/following{/other_user}","gists_url":"https://api.github.com/users/benfitzpatrick/gists{/gist_id}","starred_url":"https://api.github.com/users/benfitzpatrick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benfitzpatrick/subscriptions","organizations_url":"https://api.github.com/users/benfitzpatrick/orgs","repos_url":"https://api.github.com/users/benfitzpatrick/repos","events_url":"https://api.github.com/users/benfitzpatrick/events{/privacy}","received_events_url":"https://api.github.com/users/benfitzpatrick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/benfitzpatrick/cylc","description":"The cylc forecast suite metascheduler","fork":true,"url":"https://api.github.com/repos/benfitzpatrick/cylc","forks_url":"https://api.github.com/repos/benfitzpatrick/cylc/forks","keys_url":"https://api.github.com/repos/benfitzpatrick/cylc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benfitzpatrick/cylc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benfitzpatrick/cylc/teams","hooks_url":"https://api.github.com/repos/benfitzpatrick/cylc/hooks","issue_events_url":"https://api.github.com/repos/benfitzpatrick/cylc/issues/events{/number}","events_url":"https://api.github.com/repos/benfitzpatrick/cylc/events","assignees_url":"https://api.github.com/repos/benfitzpatrick/cylc/assignees{/user}","branches_url":"https://api.github.com/repos/benfitzpatrick/cylc/branches{/branch}","tags_url":"https://api.github.com/repos/benfitzpatrick/cylc/tags","blobs_url":"https://api.github.com/repos/benfitzpatrick/cylc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benfitzpatrick/cylc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benfitzpatrick/cylc/git/refs{/sha}","trees_url":"https://api.github.com/repos/benfitzpatrick/cylc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benfitzpatrick/cylc/statuses/{sha}","languages_url":"https://api.github.com/repos/benfitzpatrick/cylc/languages","stargazers_url":"https://api.github.com/repos/benfitzpatrick/cylc/stargazers","contributors_url":"https://api.github.com/repos/benfitzpatrick/cylc/contributors","subscribers_url":"https://api.github.com/repos/benfitzpatrick/cylc/subscribers","subscription_url":"https://api.github.com/repos/benfitzpatrick/cylc/subscription","commits_url":"https://api.github.com/repos/benfitzpatrick/cylc/commits{/sha}","git_commits_url":"https://api.github.com/repos/benfitzpatrick/cylc/git/commits{/sha}","comments_url":"https://api.github.com/repos/benfitzpatrick/cylc/comments{/number}","issue_comment_url":"https://api.github.com/repos/benfitzpatrick/cylc/issues/comments{/number}","contents_url":"https://api.github.com/repos/benfitzpatrick/cylc/contents/{+path}","compare_url":"https://api.github.com/repos/benfitzpatrick/cylc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benfitzpatrick/cylc/merges","archive_url":"https://api.github.com/repos/benfitzpatrick/cylc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benfitzpatrick/cylc/downloads","issues_url":"https://api.github.com/repos/benfitzpatrick/cylc/issues{/number}","pulls_url":"https://api.github.com/repos/benfitzpatrick/cylc/pulls{/number}","milestones_url":"https://api.github.com/repos/benfitzpatrick/cylc/milestones{/number}","notifications_url":"https://api.github.com/repos/benfitzpatrick/cylc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benfitzpatrick/cylc/labels{/name}","releases_url":"https://api.github.com/repos/benfitzpatrick/cylc/releases{/id}","created_at":"2011-10-19T14:47:18Z","updated_at":"2015-02-20T15:47:26Z","pushed_at":"2015-03-05T12:39:00Z","git_url":"git://github.com/benfitzpatrick/cylc.git","ssh_url":"git@github.com:benfitzpatrick/cylc.git","clone_url":"https://github.com/benfitzpatrick/cylc.git","svn_url":"https://github.com/benfitzpatrick/cylc","homepage":"https://github.com/cylc/cylc","size":91707,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":3,"default_branch":"master"}},"base":{"label":"cylc:master","ref":"master","sha":"658d1fe482f9964b5e30143773bdc0a06d8114e1","user":{"login":"cylc","id":824878,"avatar_url":"https://avatars.githubusercontent.com/u/824878?v=3","gravatar_id":"","url":"https://api.github.com/users/cylc","html_url":"https://github.com/cylc","followers_url":"https://api.github.com/users/cylc/followers","following_url":"https://api.github.com/users/cylc/following{/other_user}","gists_url":"https://api.github.com/users/cylc/gists{/gist_id}","starred_url":"https://api.github.com/users/cylc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cylc/subscriptions","organizations_url":"https://api.github.com/users/cylc/orgs","repos_url":"https://api.github.com/users/cylc/repos","events_url":"https://api.github.com/users/cylc/events{/privacy}","received_events_url":"https://api.github.com/users/cylc/received_events","type":"Organization","site_admin":false},"repo":{"id":1836229,"name":"cylc","full_name":"cylc/cylc","owner":{"login":"cylc","id":824878,"avatar_url":"https://avatars.githubusercontent.com/u/824878?v=3","gravatar_id":"","url":"https://api.github.com/users/cylc","html_url":"https://github.com/cylc","followers_url":"https://api.github.com/users/cylc/followers","following_url":"https://api.github.com/users/cylc/following{/other_user}","gists_url":"https://api.github.com/users/cylc/gists{/gist_id}","starred_url":"https://api.github.com/users/cylc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cylc/subscriptions","organizations_url":"https://api.github.com/users/cylc/orgs","repos_url":"https://api.github.com/users/cylc/repos","events_url":"https://api.github.com/users/cylc/events{/privacy}","received_events_url":"https://api.github.com/users/cylc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cylc/cylc","description":"This is the official repository of the cylc suite engine. It will normally contain just the master branch, with completed features merged in from feature branches in developer forks.","fork":false,"url":"https://api.github.com/repos/cylc/cylc","forks_url":"https://api.github.com/repos/cylc/cylc/forks","keys_url":"https://api.github.com/repos/cylc/cylc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cylc/cylc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cylc/cylc/teams","hooks_url":"https://api.github.com/repos/cylc/cylc/hooks","issue_events_url":"https://api.github.com/repos/cylc/cylc/issues/events{/number}","events_url":"https://api.github.com/repos/cylc/cylc/events","assignees_url":"https://api.github.com/repos/cylc/cylc/assignees{/user}","branches_url":"https://api.github.com/repos/cylc/cylc/branches{/branch}","tags_url":"https://api.github.com/repos/cylc/cylc/tags","blobs_url":"https://api.github.com/repos/cylc/cylc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cylc/cylc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cylc/cylc/git/refs{/sha}","trees_url":"https://api.github.com/repos/cylc/cylc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cylc/cylc/statuses/{sha}","languages_url":"https://api.github.com/repos/cylc/cylc/languages","stargazers_url":"https://api.github.com/repos/cylc/cylc/stargazers","contributors_url":"https://api.github.com/repos/cylc/cylc/contributors","subscribers_url":"https://api.github.com/repos/cylc/cylc/subscribers","subscription_url":"https://api.github.com/repos/cylc/cylc/subscription","commits_url":"https://api.github.com/repos/cylc/cylc/commits{/sha}","git_commits_url":"https://api.github.com/repos/cylc/cylc/git/commits{/sha}","comments_url":"https://api.github.com/repos/cylc/cylc/comments{/number}","issue_comment_url":"https://api.github.com/repos/cylc/cylc/issues/comments{/number}","contents_url":"https://api.github.com/repos/cylc/cylc/contents/{+path}","compare_url":"https://api.github.com/repos/cylc/cylc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cylc/cylc/merges","archive_url":"https://api.github.com/repos/cylc/cylc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cylc/cylc/downloads","issues_url":"https://api.github.com/repos/cylc/cylc/issues{/number}","pulls_url":"https://api.github.com/repos/cylc/cylc/pulls{/number}","milestones_url":"https://api.github.com/repos/cylc/cylc/milestones{/number}","notifications_url":"https://api.github.com/repos/cylc/cylc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cylc/cylc/labels{/name}","releases_url":"https://api.github.com/repos/cylc/cylc/releases{/id}","created_at":"2011-06-02T08:31:49Z","updated_at":"2015-03-04T11:58:32Z","pushed_at":"2015-03-04T11:58:32Z","git_url":"git://github.com/cylc/cylc.git","ssh_url":"git@github.com:cylc/cylc.git","clone_url":"https://github.com/cylc/cylc.git","svn_url":"https://github.com/cylc/cylc","homepage":"http://cylc.github.com/cylc","size":86988,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":16,"mirror_url":null,"open_issues_count":167,"forks":16,"open_issues":167,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cylc/cylc/pulls/1362"},"html":{"href":"https://github.com/cylc/cylc/pull/1362"},"issue":{"href":"https://api.github.com/repos/cylc/cylc/issues/1362"},"comments":{"href":"https://api.github.com/repos/cylc/cylc/issues/1362/comments"},"review_comments":{"href":"https://api.github.com/repos/cylc/cylc/pulls/1362/comments"},"review_comment":{"href":"https://api.github.com/repos/cylc/cylc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cylc/cylc/pulls/1362/commits"},"statuses":{"href":"https://api.github.com/repos/cylc/cylc/statuses/14a6dd7b2708dce99bf3e092236c3e58990ffd6c"}}}}