workflow_manager 0.5.4 → 0.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d30a3a06c3c0eb512d58215a2e8c3da59a3995c61701417bfa446dd40689149
4
- data.tar.gz: 0a1ac6b93e877da5ced89faeb37e11cad399d91653aa7d7bbca32c570601d14f
3
+ metadata.gz: c6828da4a43654aa14bb9a4592a42bdc3d0084daf98e7ab29cb11d94928b54de
4
+ data.tar.gz: 87122a9b3e395f12535e700d80568328876f8784917da762956d7abbdd4a77c0
5
5
  SHA512:
6
- metadata.gz: 423b03ccc17b5e78c4f7a323967e23d8f608ab199ef757cf595a0bb7d4c58f82e2a2b19435dfae8ee09e68b24d314ed9931738f1c09abf5f1ddfb956befc6fa6
7
- data.tar.gz: de329289a5bff13cea1f45943467c917bfb5f058167c2386973b45d76a40117d0adbb3d837501560f14dcdf7a800c9a2a453db2a20e1320fefd8a06a49b4204b
6
+ metadata.gz: a27da5bd02d7d6a8130f9bb8844c3b4a640153a37751e0e7bd34fd64d0c13caaf0e0aade85e34ec4699a3307fe8df6624562e9a0cd48858861ec543bd3c1c910
7
+ data.tar.gz: 6f043fe95d6911baffbd0f606f5790d60651a013cea213caf1728632267987f09a20e161ea186f372eaaf66f7823f07e323990268bdc28ec669f37623f02b409
@@ -349,4 +349,87 @@ module WorkflowManager
349
349
  }
350
350
  end
351
351
  end
352
+
353
+ class FGCZDevian10Cluster < Cluster
354
+ def submit_job(script_file, script_content, option='')
355
+ if script_name = File.basename(script_file) and script_name =~ /\.sh/
356
+ script_name = script_name.split(/\.sh/).first + ".sh"
357
+ new_job_script = generate_new_job_script(script_name, script_content)
358
+ new_job_script_base = File.basename(new_job_script)
359
+ log_file = File.join(@log_dir, new_job_script_base + "_o.log")
360
+ err_file = File.join(@log_dir, new_job_script_base + "_e.log")
361
+ #command = "g-sub -o #{log_file} -e #{err_file} #{option} #{new_job_script}"
362
+ command = "sbatch -o #{log_file} -e #{err_file} #{option} #{new_job_script}"
363
+ job_id = `#{command}`
364
+ job_id = job_id.match(/Your job (\d+) \(/)[1]
365
+ [job_id, log_file, command]
366
+ else
367
+ err_msg = "FGCZDevian10Cluster#submit_job, ERROR: script_name is not *.sh: #{File.basename(script_file)}"
368
+ warn err_msg
369
+ raise err_msg
370
+ end
371
+ end
372
+ def job_running?(job_id)
373
+ qstat_flag = false
374
+ IO.popen('squeue') do |io|
375
+ while line=io.gets
376
+ # ["JOBID", "PARTITION", "NAME", "USER", "ST", "TIME", "NODES", "NODELIST(REASON)"]
377
+ # ["206", "employee", "test.sh", "masaomi", "R", "0:03", "1", "fgcz-h-030"]
378
+ jobid, partition, name, user, state, *others = line.chomp.split
379
+ if jobid.strip == job_id and state == 'R'
380
+ qstat_flag = true
381
+ break
382
+ end
383
+ end
384
+ end
385
+ qstat_flag
386
+ end
387
+ def job_ends?(log_file)
388
+ log_flag = false
389
+ IO.popen("tail -n 10 #{log_file} 2> /dev/null") do |io|
390
+ while line=io.gets
391
+ if line =~ /__SCRIPT END__/
392
+ log_flag = true
393
+ break
394
+ end
395
+ end
396
+ end
397
+ log_flag
398
+ end
399
+ def job_pending?(job_id)
400
+ qstat_flag = false
401
+ IO.popen('squeue') do |io|
402
+ while line=io.gets
403
+ jobid, partition, name, user, state, *others = line.chomp.split
404
+ if jobid.strip == job_id and state =~ /PD/
405
+ qstat_flag = true
406
+ break
407
+ end
408
+ end
409
+ end
410
+ qstat_flag
411
+ end
412
+ def copy_commands(org_dir, dest_parent_dir, now=nil)
413
+ commands = if now == "force"
414
+ target_file = File.join(dest_parent_dir, File.basename(org_dir))
415
+ ["g-req copynow -f #{org_dir} #{dest_parent_dir}"]
416
+ elsif now
417
+ ["g-req copynow #{org_dir} #{dest_parent_dir}"]
418
+ else
419
+ ["g-req -w copy #{org_dir} #{dest_parent_dir}"]
420
+ end
421
+ end
422
+ def kill_command(job_id)
423
+ command = "scancel #{job_id}"
424
+ end
425
+ def delete_command(target)
426
+ command = "g-req remove #{target}"
427
+ end
428
+ def cluster_nodes
429
+ nodes = {
430
+ 'fgcz-h-900: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-900',
431
+ 'fgcz-h-901: cpu 8,mem 30 GB,scr 400G' => 'fgcz-h-901',
432
+ }
433
+ end
434
+ end
352
435
  end
@@ -1,3 +1,3 @@
1
1
  module WorkflowManager
2
- VERSION = "0.5.4"
2
+ VERSION = "0.5.5"
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.5.4
4
+ version: 0.5.5
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: 2020-05-22 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler