{"action":"created","comment":{"url":"https://api.github.com/repos/spotify/luigi/pulls/comments/37069985","id":37069985,"diff_hunk":"@@ -0,0 +1,75 @@\n+# -*- coding: utf-8 -*-\n+#\n+# Copyright 2012-2015 Spotify AB\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+# http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+#\n+\n+import os\n+import sys\n+try:\n+    import cPickle as pickle\n+except ImportError:\n+    import pickle\n+import logging\n+import tarfile\n+\n+\n+def do_work_on_compute_node(work_dir):\n+\n+    # Extract the necessary dependencies\n+    extract_packages_archive(work_dir)\n+\n+    # Open up the pickle file with the work to be done\n+    os.chdir(work_dir)\n+    with open(\"job-instance.pickle\", \"r\") as f:\n+        job = pickle.load(f)\n+\n+    # Do the work contained\n+    job.work()\n+\n+\n+def extract_packages_archive(work_dir):\n+    package_file = os.path.join(work_dir, \"packages.tar\")\n+    if not os.path.exists(package_file):\n+        return\n+\n+    curdir = os.path.abspath(os.curdir)\n+\n+    os.chdir(work_dir)\n+    tar = tarfile.open(package_file)\n+    for tarinfo in tar:\n+        tar.extract(tarinfo)\n+    tar.close()\n+    if '' not in sys.path:\n+        sys.path.insert(0, '')\n+\n+    os.chdir(curdir)\n+\n+\n+def main(args=sys.argv):","path":"luigi/contrib/sge_runner.py","position":60,"original_position":60,"commit_id":"dfe99e061f063d5c2ee982cff38c6d61c9217a7e","original_commit_id":"dfe99e061f063d5c2ee982cff38c6d61c9217a7e","user":{"login":"erikbern","id":1027979,"avatar_url":"https://avatars.githubusercontent.com/u/1027979?v=3","gravatar_id":"","url":"https://api.github.com/users/erikbern","html_url":"https://github.com/erikbern","followers_url":"https://api.github.com/users/erikbern/followers","following_url":"https://api.github.com/users/erikbern/following{/other_user}","gists_url":"https://api.github.com/users/erikbern/gists{/gist_id}","starred_url":"https://api.github.com/users/erikbern/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erikbern/subscriptions","organizations_url":"https://api.github.com/users/erikbern/orgs","repos_url":"https://api.github.com/users/erikbern/repos","events_url":"https://api.github.com/users/erikbern/events{/privacy}","received_events_url":"https://api.github.com/users/erikbern/received_events","type":"User","site_admin":false},"body":"guessing it's like mrrunner.py?","created_at":"2015-08-14T12:02:09Z","updated_at":"2015-08-14T12:02:09Z","html_url":"https://github.com/spotify/luigi/pull/1124#discussion_r37069985","pull_request_url":"https://api.github.com/repos/spotify/luigi/pulls/1124","_links":{"self":{"href":"https://api.github.com/repos/spotify/luigi/pulls/comments/37069985"},"html":{"href":"https://github.com/spotify/luigi/pull/1124#discussion_r37069985"},"pull_request":{"href":"https://api.github.com/repos/spotify/luigi/pulls/1124"}}},"pull_request":{"url":"https://api.github.com/repos/spotify/luigi/pulls/1124","id":42231789,"html_url":"https://github.com/spotify/luigi/pull/1124","diff_url":"https://github.com/spotify/luigi/pull/1124.diff","patch_url":"https://github.com/spotify/luigi/pull/1124.patch","issue_url":"https://api.github.com/repos/spotify/luigi/issues/1124","number":1124,"state":"open","locked":false,"title":"SunGrid Engine support","user":{"login":"jfeala","id":2364366,"avatar_url":"https://avatars.githubusercontent.com/u/2364366?v=3","gravatar_id":"","url":"https://api.github.com/users/jfeala","html_url":"https://github.com/jfeala","followers_url":"https://api.github.com/users/jfeala/followers","following_url":"https://api.github.com/users/jfeala/following{/other_user}","gists_url":"https://api.github.com/users/jfeala/gists{/gist_id}","starred_url":"https://api.github.com/users/jfeala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfeala/subscriptions","organizations_url":"https://api.github.com/users/jfeala/orgs","repos_url":"https://api.github.com/users/jfeala/repos","events_url":"https://api.github.com/users/jfeala/events{/privacy}","received_events_url":"https://api.github.com/users/jfeala/received_events","type":"User","site_admin":false},"body":"This is a re-submission of https://github.com/spotify/luigi/pull/1056, with a rebase, better docs, cleaned up for tox/Python 3, and also to reset some confusing conversation around the PR :)\r\n\r\nOverview:\r\n- Submits luigi tasks to a SunGrid Engine cluster using qsub\r\n- Executes \"work\" function on pickled task class\r\n- Monitors task completion using qstat\r\n\r\nAdapted from Alex Wiltschko's (@alexbw) implementation of LSF (https://github.com/dattalab/luigi/tree/lsf_submission).\r\n","created_at":"2015-08-12T12:01:21Z","updated_at":"2015-08-14T12:02:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"83752de6dc4a2343761b5ee842354586f11b5c01","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spotify/luigi/pulls/1124/commits","review_comments_url":"https://api.github.com/repos/spotify/luigi/pulls/1124/comments","review_comment_url":"https://api.github.com/repos/spotify/luigi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spotify/luigi/issues/1124/comments","statuses_url":"https://api.github.com/repos/spotify/luigi/statuses/dfe99e061f063d5c2ee982cff38c6d61c9217a7e","head":{"label":"jfeala:sungrid-engine","ref":"sungrid-engine","sha":"dfe99e061f063d5c2ee982cff38c6d61c9217a7e","user":{"login":"jfeala","id":2364366,"avatar_url":"https://avatars.githubusercontent.com/u/2364366?v=3","gravatar_id":"","url":"https://api.github.com/users/jfeala","html_url":"https://github.com/jfeala","followers_url":"https://api.github.com/users/jfeala/followers","following_url":"https://api.github.com/users/jfeala/following{/other_user}","gists_url":"https://api.github.com/users/jfeala/gists{/gist_id}","starred_url":"https://api.github.com/users/jfeala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfeala/subscriptions","organizations_url":"https://api.github.com/users/jfeala/orgs","repos_url":"https://api.github.com/users/jfeala/repos","events_url":"https://api.github.com/users/jfeala/events{/privacy}","received_events_url":"https://api.github.com/users/jfeala/received_events","type":"User","site_admin":false},"repo":{"id":40597723,"name":"luigi","full_name":"jfeala/luigi","owner":{"login":"jfeala","id":2364366,"avatar_url":"https://avatars.githubusercontent.com/u/2364366?v=3","gravatar_id":"","url":"https://api.github.com/users/jfeala","html_url":"https://github.com/jfeala","followers_url":"https://api.github.com/users/jfeala/followers","following_url":"https://api.github.com/users/jfeala/following{/other_user}","gists_url":"https://api.github.com/users/jfeala/gists{/gist_id}","starred_url":"https://api.github.com/users/jfeala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jfeala/subscriptions","organizations_url":"https://api.github.com/users/jfeala/orgs","repos_url":"https://api.github.com/users/jfeala/repos","events_url":"https://api.github.com/users/jfeala/events{/privacy}","received_events_url":"https://api.github.com/users/jfeala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jfeala/luigi","description":"Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization etc. It also comes with Hadoop support built in. ","fork":true,"url":"https://api.github.com/repos/jfeala/luigi","forks_url":"https://api.github.com/repos/jfeala/luigi/forks","keys_url":"https://api.github.com/repos/jfeala/luigi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jfeala/luigi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jfeala/luigi/teams","hooks_url":"https://api.github.com/repos/jfeala/luigi/hooks","issue_events_url":"https://api.github.com/repos/jfeala/luigi/issues/events{/number}","events_url":"https://api.github.com/repos/jfeala/luigi/events","assignees_url":"https://api.github.com/repos/jfeala/luigi/assignees{/user}","branches_url":"https://api.github.com/repos/jfeala/luigi/branches{/branch}","tags_url":"https://api.github.com/repos/jfeala/luigi/tags","blobs_url":"https://api.github.com/repos/jfeala/luigi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jfeala/luigi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jfeala/luigi/git/refs{/sha}","trees_url":"https://api.github.com/repos/jfeala/luigi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jfeala/luigi/statuses/{sha}","languages_url":"https://api.github.com/repos/jfeala/luigi/languages","stargazers_url":"https://api.github.com/repos/jfeala/luigi/stargazers","contributors_url":"https://api.github.com/repos/jfeala/luigi/contributors","subscribers_url":"https://api.github.com/repos/jfeala/luigi/subscribers","subscription_url":"https://api.github.com/repos/jfeala/luigi/subscription","commits_url":"https://api.github.com/repos/jfeala/luigi/commits{/sha}","git_commits_url":"https://api.github.com/repos/jfeala/luigi/git/commits{/sha}","comments_url":"https://api.github.com/repos/jfeala/luigi/comments{/number}","issue_comment_url":"https://api.github.com/repos/jfeala/luigi/issues/comments{/number}","contents_url":"https://api.github.com/repos/jfeala/luigi/contents/{+path}","compare_url":"https://api.github.com/repos/jfeala/luigi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jfeala/luigi/merges","archive_url":"https://api.github.com/repos/jfeala/luigi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jfeala/luigi/downloads","issues_url":"https://api.github.com/repos/jfeala/luigi/issues{/number}","pulls_url":"https://api.github.com/repos/jfeala/luigi/pulls{/number}","milestones_url":"https://api.github.com/repos/jfeala/luigi/milestones{/number}","notifications_url":"https://api.github.com/repos/jfeala/luigi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jfeala/luigi/labels{/name}","releases_url":"https://api.github.com/repos/jfeala/luigi/releases{/id}","created_at":"2015-08-12T11:45:21Z","updated_at":"2015-08-12T11:45:22Z","pushed_at":"2015-08-12T13:41:07Z","git_url":"git://github.com/jfeala/luigi.git","ssh_url":"git@github.com:jfeala/luigi.git","clone_url":"https://github.com/jfeala/luigi.git","svn_url":"https://github.com/jfeala/luigi","homepage":null,"size":5593,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"spotify:master","ref":"master","sha":"3309dc002feb0852aafbcbeff9be1daf43b50478","user":{"login":"spotify","id":251374,"avatar_url":"https://avatars.githubusercontent.com/u/251374?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"repo":{"id":5888353,"name":"luigi","full_name":"spotify/luigi","owner":{"login":"spotify","id":251374,"avatar_url":"https://avatars.githubusercontent.com/u/251374?v=3","gravatar_id":"","url":"https://api.github.com/users/spotify","html_url":"https://github.com/spotify","followers_url":"https://api.github.com/users/spotify/followers","following_url":"https://api.github.com/users/spotify/following{/other_user}","gists_url":"https://api.github.com/users/spotify/gists{/gist_id}","starred_url":"https://api.github.com/users/spotify/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spotify/subscriptions","organizations_url":"https://api.github.com/users/spotify/orgs","repos_url":"https://api.github.com/users/spotify/repos","events_url":"https://api.github.com/users/spotify/events{/privacy}","received_events_url":"https://api.github.com/users/spotify/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spotify/luigi","description":"Luigi is a Python module that helps you build complex pipelines of batch jobs. It handles dependency resolution, workflow management, visualization etc. It also comes with Hadoop support built in. ","fork":false,"url":"https://api.github.com/repos/spotify/luigi","forks_url":"https://api.github.com/repos/spotify/luigi/forks","keys_url":"https://api.github.com/repos/spotify/luigi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spotify/luigi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spotify/luigi/teams","hooks_url":"https://api.github.com/repos/spotify/luigi/hooks","issue_events_url":"https://api.github.com/repos/spotify/luigi/issues/events{/number}","events_url":"https://api.github.com/repos/spotify/luigi/events","assignees_url":"https://api.github.com/repos/spotify/luigi/assignees{/user}","branches_url":"https://api.github.com/repos/spotify/luigi/branches{/branch}","tags_url":"https://api.github.com/repos/spotify/luigi/tags","blobs_url":"https://api.github.com/repos/spotify/luigi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spotify/luigi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spotify/luigi/git/refs{/sha}","trees_url":"https://api.github.com/repos/spotify/luigi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spotify/luigi/statuses/{sha}","languages_url":"https://api.github.com/repos/spotify/luigi/languages","stargazers_url":"https://api.github.com/repos/spotify/luigi/stargazers","contributors_url":"https://api.github.com/repos/spotify/luigi/contributors","subscribers_url":"https://api.github.com/repos/spotify/luigi/subscribers","subscription_url":"https://api.github.com/repos/spotify/luigi/subscription","commits_url":"https://api.github.com/repos/spotify/luigi/commits{/sha}","git_commits_url":"https://api.github.com/repos/spotify/luigi/git/commits{/sha}","comments_url":"https://api.github.com/repos/spotify/luigi/comments{/number}","issue_comment_url":"https://api.github.com/repos/spotify/luigi/issues/comments{/number}","contents_url":"https://api.github.com/repos/spotify/luigi/contents/{+path}","compare_url":"https://api.github.com/repos/spotify/luigi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spotify/luigi/merges","archive_url":"https://api.github.com/repos/spotify/luigi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spotify/luigi/downloads","issues_url":"https://api.github.com/repos/spotify/luigi/issues{/number}","pulls_url":"https://api.github.com/repos/spotify/luigi/pulls{/number}","milestones_url":"https://api.github.com/repos/spotify/luigi/milestones{/number}","notifications_url":"https://api.github.com/repos/spotify/luigi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spotify/luigi/labels{/name}","releases_url":"https://api.github.com/repos/spotify/luigi/releases{/id}","created_at":"2012-09-20T15:06:38Z","updated_at":"2015-08-14T11:30:53Z","pushed_at":"2015-08-14T11:24:31Z","git_url":"git://github.com/spotify/luigi.git","ssh_url":"git@github.com:spotify/luigi.git","clone_url":"https://github.com/spotify/luigi.git","svn_url":"https://github.com/spotify/luigi","homepage":null,"size":13207,"stargazers_count":3030,"watchers_count":3030,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":532,"mirror_url":null,"open_issues_count":96,"forks":532,"open_issues":96,"watchers":3030,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spotify/luigi/pulls/1124"},"html":{"href":"https://github.com/spotify/luigi/pull/1124"},"issue":{"href":"https://api.github.com/repos/spotify/luigi/issues/1124"},"comments":{"href":"https://api.github.com/repos/spotify/luigi/issues/1124/comments"},"review_comments":{"href":"https://api.github.com/repos/spotify/luigi/pulls/1124/comments"},"review_comment":{"href":"https://api.github.com/repos/spotify/luigi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spotify/luigi/pulls/1124/commits"},"statuses":{"href":"https://api.github.com/repos/spotify/luigi/statuses/dfe99e061f063d5c2ee982cff38c6d61c9217a7e"}}}}