workflow_manager 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e1065d164138dc5eff1ba9cd87910322c0e1387
4
- data.tar.gz: 37e9557d9cafcf146bf0d2d74ce612bdc6c702b6
3
+ metadata.gz: b886550f64757d521efa14ad7aa0b3069f8154d6
4
+ data.tar.gz: 4f0bc2ff94c94b558e7324754d34228bdd0cac55
5
5
  SHA512:
6
- metadata.gz: 4b00d44d57d0c74164815366b15b8f9191d754b9bf086ebf3b15e3f32758b4aff279dc53dc4ff8c169ddd476dec458b973675b4346e0cc0804e66df5c6959ca2
7
- data.tar.gz: 437dd99972576d6d8ceaf8c645ace2352732cc53405555c976296849e47ef6cbd7c6219ae93e5df20f976addf13837a03f348f037a4f56f9a0f79cb2008a75fc
6
+ metadata.gz: 67d550af640f7e54cb5763ffa7892e95c5e0c6e173674d8238f097e48b891c9051d8e635cd0e85b6336ac966c75fad8fed61cc8879a8a4ed80c078f72a60ada8
7
+ data.tar.gz: 2bb89597aa0d715fd108a285786741b757c2dbf6fc2c8af5a28bd5646abdd95bcc8a7003d79d9b347e2610ed50f91f857c3a8395a944ed5a4faefc6e4f30ade8
@@ -142,7 +142,10 @@ module WorkflowManager
142
142
  qstat_flag
143
143
  end
144
144
  def copy_commands(org_dir, dest_parent_dir, now=nil)
145
- commands = if now
145
+ commands = if now == "force"
146
+ target_file = File.join(dest_parent_dir, File.basename(org_dir))
147
+ ["g-req copynow -f #{org_dir} #{dest_parent_dir}"]
148
+ elsif now
146
149
  ["g-req copynow #{org_dir} #{dest_parent_dir}"]
147
150
  else
148
151
  ["g-req -w copy #{org_dir} #{dest_parent_dir}"]
@@ -189,4 +192,46 @@ module WorkflowManager
189
192
  command = "rm -rf #{target}"
190
193
  end
191
194
  end
195
+
196
+ class HydraCluster < Cluster
197
+ def submit_job(script_file, script_content, option='')
198
+ # TODO
199
+ if script_name = File.basename(script_file) and script_name =~ /\.sh$/
200
+ new_job_script = generate_new_job_script(script_name, script_content)
201
+ new_job_script_base = File.basename(new_job_script)
202
+ log_file = File.join(@log_dir, new_job_script_base + "_o.log")
203
+ err_file = File.join(@log_dir, new_job_script_base + "_e.log")
204
+ #command = "g-sub -o #{log_file} -e #{err_file} #{option} #{new_job_script}"
205
+ command = "cat #{new_job_script} |ssh hydra 'cat > #{new_job_script_base}; source /etc/profile; module load cluster/largemem; sbatch #{new_job_script_base};'"
206
+ job_id = `#{command}`
207
+ job_id = job_id.match(/Submitted batch job (\d+)/)[1]
208
+ [job_id, log_file, command]
209
+ end
210
+ end
211
+ def job_running?(job_id)
212
+ # TODO
213
+ end
214
+ def job_ends?(log_file)
215
+ # TODO
216
+ end
217
+ def job_pending?(job_id)
218
+ # TODO
219
+ end
220
+ def copy_commands(org_dir, dest_parent_dir, now=nil)
221
+ # TODO
222
+ end
223
+ def kill_command(job_id)
224
+ # TODO
225
+ command = "ssh hydra; scancel #{job_id}"
226
+ end
227
+ def delete_command(target)
228
+ # TODO
229
+ end
230
+ def cluster_nodes
231
+ # TODO
232
+ nodes = {
233
+ 'cluster/largemem' => 'cluster/largemem',
234
+ }
235
+ end
236
+ end
192
237
  end
@@ -1,3 +1,3 @@
1
1
  module WorkflowManager
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workflow_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Functional Genomics Center Zurich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-28 00:00:00.000000000 Z
11
+ date: 2017-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler