workflow_manager 0.5.4 → 0.5.5
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 +83 -0
- 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: c6828da4a43654aa14bb9a4592a42bdc3d0084daf98e7ab29cb11d94928b54de
|
4
|
+
data.tar.gz: 87122a9b3e395f12535e700d80568328876f8784917da762956d7abbdd4a77c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
+
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-
|
11
|
+
date: 2020-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|