{"action":"created","comment":{"url":"https://api.github.com/repos/crest-cassia/oacis/pulls/comments/40639402","id":40639402,"diff_hunk":"@@ -35,118 +36,133 @@ def remote_status(run)\n           raise RemoteSchedulerError, \"remote_status failed: rc:#{rc}, #{out}, #{err}\"\n         end\n       rescue => ex\n-        error_handle(ex, run, ssh)\n+        error_handle(ex, job, ssh)\n       end\n     end\n     status\n   end\n \n-  def cancel_remote_job(run)\n-    stat = remote_status(run)\n+  def cancel_remote_job(job)\n+    stat = remote_status(job)\n     if stat == :submitted or stat == :running\n       scheduler = SchedulerWrapper.new(@host)\n-      cmd = scheduler.cancel_command(run.job_id)\n+      cmd = scheduler.cancel_command(job.job_id)\n       @host.start_ssh do |ssh|\n         begin\n           out, err, rc, sig = SSHUtil.execute2(ssh, cmd)\n           raise RemoteSchedulerError, \"cancel_remote_jos failed: rc:#{rc}, #{out}, #{err}\" unless rc == 0\n         rescue => ex\n-          error_handle(ex, run, ssh)\n+          error_handle(ex, job, ssh)\n         end\n       end\n     end\n-    remove_remote_files(run)\n+    remove_remote_files(job)\n   end\n \n   private\n-  def create_remote_work_dir(run)\n-    cmd = \"mkdir -p #{RemoteFilePath.work_dir_path(@host,run)}\"\n+  def create_remote_work_dir(job)\n+    cmd = \"mkdir -p #{RemoteFilePath.work_dir_path(@host,job)}\"\n     @host.start_ssh do |ssh|\n       out, err, rc, sig = SSHUtil.execute2(ssh, cmd)\n       raise RemoteOperationError, \"\\\"#{cmd}\\\" failed: rc:#{rc}, #{out}, #{err}\" unless rc == 0\n     end\n   end\n \n-  def prepare_input_json(run)\n-    input = run.input\n+  def prepare_input_json(job)\n+    input = job.input\n     if input\n       @host.start_ssh do |ssh|\n-        SSHUtil.write_remote_file(ssh, RemoteFilePath.input_json_path(@host,run), input.to_json)\n+        SSHUtil.write_remote_file(ssh, RemoteFilePath.input_json_path(@host,job), input.to_json)\n       end\n     end\n   end\n \n-  def execute_pre_process(run)\n-    script = run.simulator.pre_process_script\n+  def prepare_input_files(job)","path":"app/services/remote_job_handler.rb","position":93,"original_position":93,"commit_id":"1e95d51e2a4e10f9263bb14cd64c573eb8a534b3","original_commit_id":"1e95d51e2a4e10f9263bb14cd64c573eb8a534b3","user":{"login":"yohm","id":718731,"avatar_url":"https://avatars.githubusercontent.com/u/718731?v=3","gravatar_id":"","url":"https://api.github.com/users/yohm","html_url":"https://github.com/yohm","followers_url":"https://api.github.com/users/yohm/followers","following_url":"https://api.github.com/users/yohm/following{/other_user}","gists_url":"https://api.github.com/users/yohm/gists{/gist_id}","starred_url":"https://api.github.com/users/yohm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yohm/subscriptions","organizations_url":"https://api.github.com/users/yohm/orgs","repos_url":"https://api.github.com/users/yohm/repos","events_url":"https://api.github.com/users/yohm/events{/privacy}","received_events_url":"https://api.github.com/users/yohm/received_events","type":"User","site_admin":false},"body":"それが良さそうですね。リンクを貼った場合、リモートのマシンでちゃんとファイルが見えるのだろうか？コピーした方がよい？\r\n","created_at":"2015-09-29T06:52:22Z","updated_at":"2015-09-29T06:52:22Z","html_url":"https://github.com/crest-cassia/oacis/pull/365#discussion_r40639402","pull_request_url":"https://api.github.com/repos/crest-cassia/oacis/pulls/365","_links":{"self":{"href":"https://api.github.com/repos/crest-cassia/oacis/pulls/comments/40639402"},"html":{"href":"https://github.com/crest-cassia/oacis/pull/365#discussion_r40639402"},"pull_request":{"href":"https://api.github.com/repos/crest-cassia/oacis/pulls/365"}}},"pull_request":{"url":"https://api.github.com/repos/crest-cassia/oacis/pulls/365","id":46135889,"html_url":"https://github.com/crest-cassia/oacis/pull/365","diff_url":"https://github.com/crest-cassia/oacis/pull/365.diff","patch_url":"https://github.com/crest-cassia/oacis/pull/365.patch","issue_url":"https://api.github.com/repos/crest-cassia/oacis/issues/365","number":365,"state":"open","locked":false,"title":"Remote analyzer execution","user":{"login":"yohm","id":718731,"avatar_url":"https://avatars.githubusercontent.com/u/718731?v=3","gravatar_id":"","url":"https://api.github.com/users/yohm","html_url":"https://github.com/yohm","followers_url":"https://api.github.com/users/yohm/followers","following_url":"https://api.github.com/users/yohm/following{/other_user}","gists_url":"https://api.github.com/users/yohm/gists{/gist_id}","starred_url":"https://api.github.com/users/yohm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yohm/subscriptions","organizations_url":"https://api.github.com/users/yohm/orgs","repos_url":"https://api.github.com/users/yohm/repos","events_url":"https://api.github.com/users/yohm/events{/privacy}","received_events_url":"https://api.github.com/users/yohm/received_events","type":"User","site_admin":false},"body":"fixed #246 \r\n\r\nanalyzerとsimulator, runとanalysisの処理を共通化。それぞれ、Executable, Submittableのmoduleをincludeするように変更。\r\n\r\nAnalyzerには新たに以下のフィールドが追加された。\r\n- support_input_json\r\n- support_mpi\r\n- support_omp\r\n- pre_process_script\r\n- default_host_parameters\r\n- default_mpi_procs\r\n- default_omp_threads\r\n- executable_on\r\n\r\nAnalysisには以下のフィールドが追加された。\r\n- submitted_to\r\n- job_script\r\n- host_parameters\r\n- mpi_procs\r\n- omp_threads\r\n- priority\r\n- job_id\r\n- submitted_at\r\n- error_messages\r\n\r\nHostには以下が追加された。\r\n- executable_analyzers\r\n\r\nAnalyzer, Analysis, HostのControllerおよびviewを変更。とくにフィールド関連の処理が大きく変更されている。\r\n\r\nWorkerの処理を変更。\r\nAnalyzerRunnerを削除し、JobSubmitter, JobObserverのworkerで対応。ジョブの投入とObserveはそれぞれ別のworkerを立てることにし、AnalysisとRunは同じworkerからジョブを投入する。\r\nHostのジョブ投入数の制限を確実に守るため、AnalysisとRunが同じホストに同時に投げ無いようにするため。\r\n同じpriorityのRunとAnalysisがあった場合、Analysisが優先的に実行される仕様。\r\n\r\nAuto-RunのAnalysisは以下のように作られる。\r\n- 投入ホストは Analyzer#auto_run_submitted_to で指定されたホストに投入される\r\n- その際のホストパラメータはHostで指定されているデフォルト値が用いられる。\r\n  - Analyzerが保持しているdefault_host_parametersは使用しない。この値はAnalysisを手動で作るたびに値が変わるため\r\n- priorityはnormalで投入される\r\n\r\n- Analysis実行時に作られる `_input` ディレクトリはシミュレーターが正常終了した場合に限り、ジョブスクリプト内で削除する\r\n  - 結果のファイル容量を少しでも削減するため\r\n  - 異常系の場合はファイルを残す\r\n\r\nそのほか、リファクタリング、テストの修正、viewの改善などを実施。\r\n\r\n#### 後方互換性\r\n\r\n- 新たに追加されたフィールドにはデフォルト値がセットされるので、後方互換性は保たれ、今までのanalyzerがそのまま使える。\r\n- ただし、auto-runはデフォルトではmanual submissionになり、自動で実行されない。\r\n  - auto-runをセットしているanalyzerについては、 `Analyzer#submitted_to`, `Analyzer#auto_run_submitted_to` を適切にセットすればセットすれば自動で実行されるようになる。\r\n","created_at":"2015-09-28T09:29:39Z","updated_at":"2015-09-29T06:52:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8606d5e3dccd1e8f010afdacce29a9c6ef368699","assignee":{"login":"takeshi-uchitane","id":5600507,"avatar_url":"https://avatars.githubusercontent.com/u/5600507?v=3","gravatar_id":"","url":"https://api.github.com/users/takeshi-uchitane","html_url":"https://github.com/takeshi-uchitane","followers_url":"https://api.github.com/users/takeshi-uchitane/followers","following_url":"https://api.github.com/users/takeshi-uchitane/following{/other_user}","gists_url":"https://api.github.com/users/takeshi-uchitane/gists{/gist_id}","starred_url":"https://api.github.com/users/takeshi-uchitane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takeshi-uchitane/subscriptions","organizations_url":"https://api.github.com/users/takeshi-uchitane/orgs","repos_url":"https://api.github.com/users/takeshi-uchitane/repos","events_url":"https://api.github.com/users/takeshi-uchitane/events{/privacy}","received_events_url":"https://api.github.com/users/takeshi-uchitane/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/crest-cassia/oacis/milestones/14","html_url":"https://github.com/crest-cassia/oacis/milestones/v2.0.0","labels_url":"https://api.github.com/repos/crest-cassia/oacis/milestones/14/labels","id":905187,"number":14,"title":"v2.0.0","description":"","creator":{"login":"ymurase","id":5601253,"avatar_url":"https://avatars.githubusercontent.com/u/5601253?v=3","gravatar_id":"","url":"https://api.github.com/users/ymurase","html_url":"https://github.com/ymurase","followers_url":"https://api.github.com/users/ymurase/followers","following_url":"https://api.github.com/users/ymurase/following{/other_user}","gists_url":"https://api.github.com/users/ymurase/gists{/gist_id}","starred_url":"https://api.github.com/users/ymurase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ymurase/subscriptions","organizations_url":"https://api.github.com/users/ymurase/orgs","repos_url":"https://api.github.com/users/ymurase/repos","events_url":"https://api.github.com/users/ymurase/events{/privacy}","received_events_url":"https://api.github.com/users/ymurase/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":46,"state":"open","created_at":"2014-12-16T04:31:25Z","updated_at":"2015-09-29T05:36:00Z","due_on":"2015-06-29T15:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/crest-cassia/oacis/pulls/365/commits","review_comments_url":"https://api.github.com/repos/crest-cassia/oacis/pulls/365/comments","review_comment_url":"https://api.github.com/repos/crest-cassia/oacis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/crest-cassia/oacis/issues/365/comments","statuses_url":"https://api.github.com/repos/crest-cassia/oacis/statuses/1e95d51e2a4e10f9263bb14cd64c573eb8a534b3","head":{"label":"crest-cassia:remote_analyzer_execution","ref":"remote_analyzer_execution","sha":"1e95d51e2a4e10f9263bb14cd64c573eb8a534b3","user":{"login":"crest-cassia","id":5803360,"avatar_url":"https://avatars.githubusercontent.com/u/5803360?v=3","gravatar_id":"","url":"https://api.github.com/users/crest-cassia","html_url":"https://github.com/crest-cassia","followers_url":"https://api.github.com/users/crest-cassia/followers","following_url":"https://api.github.com/users/crest-cassia/following{/other_user}","gists_url":"https://api.github.com/users/crest-cassia/gists{/gist_id}","starred_url":"https://api.github.com/users/crest-cassia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crest-cassia/subscriptions","organizations_url":"https://api.github.com/users/crest-cassia/orgs","repos_url":"https://api.github.com/users/crest-cassia/repos","events_url":"https://api.github.com/users/crest-cassia/events{/privacy}","received_events_url":"https://api.github.com/users/crest-cassia/received_events","type":"Organization","site_admin":false},"repo":{"id":13269212,"name":"oacis","full_name":"crest-cassia/oacis","owner":{"login":"crest-cassia","id":5803360,"avatar_url":"https://avatars.githubusercontent.com/u/5803360?v=3","gravatar_id":"","url":"https://api.github.com/users/crest-cassia","html_url":"https://github.com/crest-cassia","followers_url":"https://api.github.com/users/crest-cassia/followers","following_url":"https://api.github.com/users/crest-cassia/following{/other_user}","gists_url":"https://api.github.com/users/crest-cassia/gists{/gist_id}","starred_url":"https://api.github.com/users/crest-cassia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crest-cassia/subscriptions","organizations_url":"https://api.github.com/users/crest-cassia/orgs","repos_url":"https://api.github.com/users/crest-cassia/repos","events_url":"https://api.github.com/users/crest-cassia/events{/privacy}","received_events_url":"https://api.github.com/users/crest-cassia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crest-cassia/oacis","description":"shared repository for cassia project developments","fork":false,"url":"https://api.github.com/repos/crest-cassia/oacis","forks_url":"https://api.github.com/repos/crest-cassia/oacis/forks","keys_url":"https://api.github.com/repos/crest-cassia/oacis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crest-cassia/oacis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crest-cassia/oacis/teams","hooks_url":"https://api.github.com/repos/crest-cassia/oacis/hooks","issue_events_url":"https://api.github.com/repos/crest-cassia/oacis/issues/events{/number}","events_url":"https://api.github.com/repos/crest-cassia/oacis/events","assignees_url":"https://api.github.com/repos/crest-cassia/oacis/assignees{/user}","branches_url":"https://api.github.com/repos/crest-cassia/oacis/branches{/branch}","tags_url":"https://api.github.com/repos/crest-cassia/oacis/tags","blobs_url":"https://api.github.com/repos/crest-cassia/oacis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crest-cassia/oacis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crest-cassia/oacis/git/refs{/sha}","trees_url":"https://api.github.com/repos/crest-cassia/oacis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crest-cassia/oacis/statuses/{sha}","languages_url":"https://api.github.com/repos/crest-cassia/oacis/languages","stargazers_url":"https://api.github.com/repos/crest-cassia/oacis/stargazers","contributors_url":"https://api.github.com/repos/crest-cassia/oacis/contributors","subscribers_url":"https://api.github.com/repos/crest-cassia/oacis/subscribers","subscription_url":"https://api.github.com/repos/crest-cassia/oacis/subscription","commits_url":"https://api.github.com/repos/crest-cassia/oacis/commits{/sha}","git_commits_url":"https://api.github.com/repos/crest-cassia/oacis/git/commits{/sha}","comments_url":"https://api.github.com/repos/crest-cassia/oacis/comments{/number}","issue_comment_url":"https://api.github.com/repos/crest-cassia/oacis/issues/comments{/number}","contents_url":"https://api.github.com/repos/crest-cassia/oacis/contents/{+path}","compare_url":"https://api.github.com/repos/crest-cassia/oacis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crest-cassia/oacis/merges","archive_url":"https://api.github.com/repos/crest-cassia/oacis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crest-cassia/oacis/downloads","issues_url":"https://api.github.com/repos/crest-cassia/oacis/issues{/number}","pulls_url":"https://api.github.com/repos/crest-cassia/oacis/pulls{/number}","milestones_url":"https://api.github.com/repos/crest-cassia/oacis/milestones{/number}","notifications_url":"https://api.github.com/repos/crest-cassia/oacis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crest-cassia/oacis/labels{/name}","releases_url":"https://api.github.com/repos/crest-cassia/oacis/releases{/id}","created_at":"2013-10-02T11:20:13Z","updated_at":"2015-09-02T05:28:18Z","pushed_at":"2015-09-29T05:36:00Z","git_url":"git://github.com/crest-cassia/oacis.git","ssh_url":"git@github.com:crest-cassia/oacis.git","clone_url":"https://github.com/crest-cassia/oacis.git","svn_url":"https://github.com/crest-cassia/oacis","homepage":null,"size":9000,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":10,"default_branch":"Development"}},"base":{"label":"crest-cassia:Development","ref":"Development","sha":"b1a9a0fef8852d2a09b4728f76e543384b2c8dbf","user":{"login":"crest-cassia","id":5803360,"avatar_url":"https://avatars.githubusercontent.com/u/5803360?v=3","gravatar_id":"","url":"https://api.github.com/users/crest-cassia","html_url":"https://github.com/crest-cassia","followers_url":"https://api.github.com/users/crest-cassia/followers","following_url":"https://api.github.com/users/crest-cassia/following{/other_user}","gists_url":"https://api.github.com/users/crest-cassia/gists{/gist_id}","starred_url":"https://api.github.com/users/crest-cassia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crest-cassia/subscriptions","organizations_url":"https://api.github.com/users/crest-cassia/orgs","repos_url":"https://api.github.com/users/crest-cassia/repos","events_url":"https://api.github.com/users/crest-cassia/events{/privacy}","received_events_url":"https://api.github.com/users/crest-cassia/received_events","type":"Organization","site_admin":false},"repo":{"id":13269212,"name":"oacis","full_name":"crest-cassia/oacis","owner":{"login":"crest-cassia","id":5803360,"avatar_url":"https://avatars.githubusercontent.com/u/5803360?v=3","gravatar_id":"","url":"https://api.github.com/users/crest-cassia","html_url":"https://github.com/crest-cassia","followers_url":"https://api.github.com/users/crest-cassia/followers","following_url":"https://api.github.com/users/crest-cassia/following{/other_user}","gists_url":"https://api.github.com/users/crest-cassia/gists{/gist_id}","starred_url":"https://api.github.com/users/crest-cassia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crest-cassia/subscriptions","organizations_url":"https://api.github.com/users/crest-cassia/orgs","repos_url":"https://api.github.com/users/crest-cassia/repos","events_url":"https://api.github.com/users/crest-cassia/events{/privacy}","received_events_url":"https://api.github.com/users/crest-cassia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/crest-cassia/oacis","description":"shared repository for cassia project developments","fork":false,"url":"https://api.github.com/repos/crest-cassia/oacis","forks_url":"https://api.github.com/repos/crest-cassia/oacis/forks","keys_url":"https://api.github.com/repos/crest-cassia/oacis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/crest-cassia/oacis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/crest-cassia/oacis/teams","hooks_url":"https://api.github.com/repos/crest-cassia/oacis/hooks","issue_events_url":"https://api.github.com/repos/crest-cassia/oacis/issues/events{/number}","events_url":"https://api.github.com/repos/crest-cassia/oacis/events","assignees_url":"https://api.github.com/repos/crest-cassia/oacis/assignees{/user}","branches_url":"https://api.github.com/repos/crest-cassia/oacis/branches{/branch}","tags_url":"https://api.github.com/repos/crest-cassia/oacis/tags","blobs_url":"https://api.github.com/repos/crest-cassia/oacis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/crest-cassia/oacis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/crest-cassia/oacis/git/refs{/sha}","trees_url":"https://api.github.com/repos/crest-cassia/oacis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/crest-cassia/oacis/statuses/{sha}","languages_url":"https://api.github.com/repos/crest-cassia/oacis/languages","stargazers_url":"https://api.github.com/repos/crest-cassia/oacis/stargazers","contributors_url":"https://api.github.com/repos/crest-cassia/oacis/contributors","subscribers_url":"https://api.github.com/repos/crest-cassia/oacis/subscribers","subscription_url":"https://api.github.com/repos/crest-cassia/oacis/subscription","commits_url":"https://api.github.com/repos/crest-cassia/oacis/commits{/sha}","git_commits_url":"https://api.github.com/repos/crest-cassia/oacis/git/commits{/sha}","comments_url":"https://api.github.com/repos/crest-cassia/oacis/comments{/number}","issue_comment_url":"https://api.github.com/repos/crest-cassia/oacis/issues/comments{/number}","contents_url":"https://api.github.com/repos/crest-cassia/oacis/contents/{+path}","compare_url":"https://api.github.com/repos/crest-cassia/oacis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/crest-cassia/oacis/merges","archive_url":"https://api.github.com/repos/crest-cassia/oacis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/crest-cassia/oacis/downloads","issues_url":"https://api.github.com/repos/crest-cassia/oacis/issues{/number}","pulls_url":"https://api.github.com/repos/crest-cassia/oacis/pulls{/number}","milestones_url":"https://api.github.com/repos/crest-cassia/oacis/milestones{/number}","notifications_url":"https://api.github.com/repos/crest-cassia/oacis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/crest-cassia/oacis/labels{/name}","releases_url":"https://api.github.com/repos/crest-cassia/oacis/releases{/id}","created_at":"2013-10-02T11:20:13Z","updated_at":"2015-09-02T05:28:18Z","pushed_at":"2015-09-29T05:36:00Z","git_url":"git://github.com/crest-cassia/oacis.git","ssh_url":"git@github.com:crest-cassia/oacis.git","clone_url":"https://github.com/crest-cassia/oacis.git","svn_url":"https://github.com/crest-cassia/oacis","homepage":null,"size":9000,"stargazers_count":10,"watchers_count":10,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":26,"forks":1,"open_issues":26,"watchers":10,"default_branch":"Development"}},"_links":{"self":{"href":"https://api.github.com/repos/crest-cassia/oacis/pulls/365"},"html":{"href":"https://github.com/crest-cassia/oacis/pull/365"},"issue":{"href":"https://api.github.com/repos/crest-cassia/oacis/issues/365"},"comments":{"href":"https://api.github.com/repos/crest-cassia/oacis/issues/365/comments"},"review_comments":{"href":"https://api.github.com/repos/crest-cassia/oacis/pulls/365/comments"},"review_comment":{"href":"https://api.github.com/repos/crest-cassia/oacis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/crest-cassia/oacis/pulls/365/commits"},"statuses":{"href":"https://api.github.com/repos/crest-cassia/oacis/statuses/1e95d51e2a4e10f9263bb14cd64c573eb8a534b3"}}}}