workflow_manager 0.5.9 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/workflow_manager/cluster.rb +4 -95
- data/lib/workflow_manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe50e7ccd102e4cd531cf2afb47e1222ca0b06e434ab34fdfff6a0f3a0fd35c3
|
4
|
+
data.tar.gz: fd07c0b863627a1a8065e7f710931ba99c0609e5ef9e9e82f107c35eee678b68
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a9701699b79fd61f889b86dbc3060fe63f6d5e8b6e2532dabb0635b5c3f37f335563dfeda5ba677328ff88e1c2197df60c84e9c9526b4a316eac751b9e3b939
|
7
|
+
data.tar.gz: d42a9d888a80e7f8b549a64595d13e3c268499d4f78d00805c070c6d60feb9febd20f335e7e8af398f910f6e1eade7b60cf200e83d99451230a4e0f37e134e0f
|
@@ -435,97 +435,6 @@ module WorkflowManager
|
|
435
435
|
end
|
436
436
|
end
|
437
437
|
|
438
|
-
class FGCZDebian10CourseCluster < Cluster
|
439
|
-
def submit_job(script_file, script_content, option='')
|
440
|
-
if script_name = File.basename(script_file) and script_name =~ /\.sh/
|
441
|
-
script_name = script_name.split(/\.sh/).first + ".sh"
|
442
|
-
new_job_script = generate_new_job_script(script_name, script_content)
|
443
|
-
new_job_script_base = File.basename(new_job_script)
|
444
|
-
log_file = File.join(@log_dir, new_job_script_base + "_o.log")
|
445
|
-
err_file = File.join(@log_dir, new_job_script_base + "_e.log")
|
446
|
-
command = "g-sub -o #{log_file} -e #{err_file} -q course #{option} #{new_job_script}"
|
447
|
-
job_id = `#{command}`
|
448
|
-
job_id = job_id.chomp.split.last
|
449
|
-
[job_id, log_file, command]
|
450
|
-
else
|
451
|
-
err_msg = "FGCZDebian10CourseCluster#submit_job, ERROR: script_name is not *.sh: #{File.basename(script_file)}"
|
452
|
-
warn err_msg
|
453
|
-
raise err_msg
|
454
|
-
end
|
455
|
-
end
|
456
|
-
def job_running?(job_id)
|
457
|
-
qstat_flag = false
|
458
|
-
IO.popen('squeue') do |io|
|
459
|
-
while line=io.gets
|
460
|
-
# ["JOBID", "PARTITION", "NAME", "USER", "ST", "TIME", "NODES", "NODELIST(REASON)"]
|
461
|
-
# ["206", "employee", "test.sh", "masaomi", "R", "0:03", "1", "fgcz-h-030"]
|
462
|
-
jobid, partition, name, user, state, *others = line.chomp.split
|
463
|
-
if jobid.strip == job_id and state == 'R'
|
464
|
-
qstat_flag = true
|
465
|
-
break
|
466
|
-
end
|
467
|
-
end
|
468
|
-
end
|
469
|
-
qstat_flag
|
470
|
-
end
|
471
|
-
def job_ends?(log_file)
|
472
|
-
log_flag = false
|
473
|
-
IO.popen("tail -n 10 #{log_file} 2> /dev/null") do |io|
|
474
|
-
while line=io.gets
|
475
|
-
if line =~ /__SCRIPT END__/
|
476
|
-
log_flag = true
|
477
|
-
break
|
478
|
-
end
|
479
|
-
end
|
480
|
-
end
|
481
|
-
log_flag
|
482
|
-
end
|
483
|
-
def job_pending?(job_id)
|
484
|
-
qstat_flag = false
|
485
|
-
IO.popen('squeue') do |io|
|
486
|
-
while line=io.gets
|
487
|
-
jobid, partition, name, user, state, *others = line.chomp.split
|
488
|
-
if jobid.strip == job_id and state =~ /PD/
|
489
|
-
qstat_flag = true
|
490
|
-
break
|
491
|
-
end
|
492
|
-
end
|
493
|
-
end
|
494
|
-
qstat_flag
|
495
|
-
end
|
496
|
-
def copy_commands(org_dir, dest_parent_dir, now=nil)
|
497
|
-
commands = ["cp -r #{org_dir} #{dest_parent_dir}"]
|
498
|
-
end
|
499
|
-
def kill_command(job_id)
|
500
|
-
command = "scancel #{job_id}"
|
501
|
-
end
|
502
|
-
def delete_command(target)
|
503
|
-
command = "rm -rf #{target}"
|
504
|
-
end
|
505
|
-
def cluster_nodes
|
506
|
-
nodes = {
|
507
|
-
'fgcz-h-900: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-900',
|
508
|
-
'fgcz-h-901: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-901',
|
509
|
-
'fgcz-h-902: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-902',
|
510
|
-
'fgcz-h-903: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-903',
|
511
|
-
'fgcz-h-904: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-904',
|
512
|
-
'fgcz-h-905: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-905',
|
513
|
-
'fgcz-h-906: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-906',
|
514
|
-
'fgcz-h-907: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-907',
|
515
|
-
'fgcz-h-908: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-908',
|
516
|
-
'fgcz-h-909: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-909',
|
517
|
-
'fgcz-h-910: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-910',
|
518
|
-
'fgcz-h-911: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-911',
|
519
|
-
'fgcz-h-912: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-912',
|
520
|
-
'fgcz-h-913: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-913',
|
521
|
-
'fgcz-h-914: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-914',
|
522
|
-
'fgcz-h-915: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-915',
|
523
|
-
'fgcz-h-916: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-916',
|
524
|
-
'fgcz-h-917: cpu 8,mem 30 GB,scr 500G' => 'fgcz-h-917',
|
525
|
-
}
|
526
|
-
end
|
527
|
-
end
|
528
|
-
|
529
438
|
class FGCZDebian10Cluster < Cluster
|
530
439
|
def parse(options)
|
531
440
|
options = options.split
|
@@ -538,14 +447,14 @@ module WorkflowManager
|
|
538
447
|
scratch = if i = options.index("-s")
|
539
448
|
options[i+1]
|
540
449
|
end
|
541
|
-
|
542
|
-
|
543
|
-
|
450
|
+
partition = if i = options.index("-p")
|
451
|
+
options[i+1]
|
452
|
+
end
|
544
453
|
new_options = []
|
545
454
|
new_options << "--mem=#{ram}G" if ram
|
546
455
|
new_options << "-n #{cores}" if cores
|
547
456
|
new_options << "--tmp=#{scratch}G" if scratch
|
548
|
-
new_options << "-p #{
|
457
|
+
new_options << "-p #{partition}" if partition
|
549
458
|
new_options.join(" ")
|
550
459
|
end
|
551
460
|
def submit_job(script_file, script_content, option='')
|
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.
|
4
|
+
version: 0.6.0
|
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-
|
11
|
+
date: 2020-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|