rbbt-util 5.44.1 → 6.0.4
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 +4 -4
- data/LICENSE +1 -1
- data/bin/rbbt +67 -90
- data/bin/rbbt_exec.rb +2 -2
- data/etc/app.d/base.rb +2 -2
- data/etc/app.d/semaphores.rb +3 -3
- data/lib/rbbt/annotations/annotated_array.rb +207 -207
- data/lib/rbbt/annotations/refactor.rb +27 -0
- data/lib/rbbt/annotations/util.rb +282 -282
- data/lib/rbbt/annotations.rb +343 -320
- data/lib/rbbt/association/database.rb +200 -225
- data/lib/rbbt/association/index.rb +294 -291
- data/lib/rbbt/association/item.rb +227 -227
- data/lib/rbbt/association/open.rb +35 -34
- data/lib/rbbt/association/util.rb +0 -169
- data/lib/rbbt/association.rb +2 -4
- data/lib/rbbt/entity/identifiers.rb +119 -118
- data/lib/rbbt/entity/refactor.rb +12 -0
- data/lib/rbbt/entity.rb +319 -315
- data/lib/rbbt/hpc/batch.rb +72 -53
- data/lib/rbbt/hpc/lsf.rb +2 -2
- data/lib/rbbt/hpc/orchestrate/batches.rb +2 -2
- data/lib/rbbt/hpc/orchestrate/chains.rb +25 -5
- data/lib/rbbt/hpc/orchestrate/rules.rb +2 -2
- data/lib/rbbt/hpc/orchestrate.rb +19 -13
- data/lib/rbbt/hpc/slurm.rb +18 -18
- data/lib/rbbt/knowledge_base/entity.rb +13 -5
- data/lib/rbbt/knowledge_base/query.rb +2 -2
- data/lib/rbbt/knowledge_base/registry.rb +32 -31
- data/lib/rbbt/knowledge_base/traverse.rb +1 -1
- data/lib/rbbt/knowledge_base.rb +1 -1
- data/lib/rbbt/monitor.rb +36 -25
- data/lib/rbbt/persist/refactor.rb +166 -0
- data/lib/rbbt/persist/tsv/tokyocabinet.rb +105 -105
- data/lib/rbbt/persist/tsv.rb +187 -185
- data/lib/rbbt/persist.rb +556 -551
- data/lib/rbbt/refactor.rb +20 -0
- data/lib/rbbt/resource/path/refactor.rb +178 -0
- data/lib/rbbt/resource/path.rb +317 -497
- data/lib/rbbt/resource/util.rb +0 -48
- data/lib/rbbt/resource.rb +3 -390
- data/lib/rbbt/tsv/accessor.rb +2 -838
- data/lib/rbbt/tsv/attach.rb +303 -299
- data/lib/rbbt/tsv/change_id.rb +244 -245
- data/lib/rbbt/tsv/csv.rb +87 -85
- data/lib/rbbt/tsv/dumper.rb +2 -100
- data/lib/rbbt/tsv/excel.rb +26 -24
- data/lib/rbbt/tsv/field_index.rb +4 -1
- data/lib/rbbt/tsv/filter.rb +3 -2
- data/lib/rbbt/tsv/index.rb +2 -284
- data/lib/rbbt/tsv/manipulate.rb +750 -747
- data/lib/rbbt/tsv/marshal.rb +3 -3
- data/lib/rbbt/tsv/matrix.rb +2 -2
- data/lib/rbbt/tsv/parallel/through.rb +2 -1
- data/lib/rbbt/tsv/parallel/traverse.rb +783 -781
- data/lib/rbbt/tsv/parser.rb +678 -678
- data/lib/rbbt/tsv/refactor.rb +195 -0
- data/lib/rbbt/tsv/stream.rb +253 -251
- data/lib/rbbt/tsv/util.rb +420 -420
- data/lib/rbbt/tsv.rb +210 -208
- data/lib/rbbt/util/R/eval.rb +4 -4
- data/lib/rbbt/util/R/plot.rb +62 -166
- data/lib/rbbt/util/R.rb +21 -18
- data/lib/rbbt/util/cmd.rb +2 -318
- data/lib/rbbt/util/color.rb +269 -269
- data/lib/rbbt/util/colorize.rb +89 -89
- data/lib/rbbt/util/concurrency/processes/refactor.rb +22 -0
- data/lib/rbbt/util/concurrency/processes/worker.rb +2 -2
- data/lib/rbbt/util/concurrency/processes.rb +389 -386
- data/lib/rbbt/util/config.rb +169 -167
- data/lib/rbbt/util/filecache.rb +1 -1
- data/lib/rbbt/util/iruby.rb +20 -0
- data/lib/rbbt/util/log/progress/report.rb +241 -241
- data/lib/rbbt/util/log/progress/util.rb +99 -99
- data/lib/rbbt/util/log/progress.rb +102 -102
- data/lib/rbbt/util/log/refactor.rb +49 -0
- data/lib/rbbt/util/log.rb +486 -532
- data/lib/rbbt/util/migrate.rb +2 -2
- data/lib/rbbt/util/misc/concurrent_stream.rb +248 -246
- data/lib/rbbt/util/misc/development.rb +12 -11
- data/lib/rbbt/util/misc/exceptions.rb +117 -112
- data/lib/rbbt/util/misc/format.rb +2 -230
- data/lib/rbbt/util/misc/indiferent_hash.rb +2 -107
- data/lib/rbbt/util/misc/inspect.rb +2 -476
- data/lib/rbbt/util/misc/lock.rb +109 -106
- data/lib/rbbt/util/misc/omics.rb +9 -1
- data/lib/rbbt/util/misc/pipes.rb +765 -793
- data/lib/rbbt/util/misc/refactor.rb +20 -0
- data/lib/rbbt/util/misc/ssw.rb +27 -17
- data/lib/rbbt/util/misc/system.rb +92 -105
- data/lib/rbbt/util/misc.rb +39 -20
- data/lib/rbbt/util/named_array/refactor.rb +4 -0
- data/lib/rbbt/util/named_array.rb +3 -220
- data/lib/rbbt/util/open/refactor.rb +7 -0
- data/lib/rbbt/util/open.rb +3 -857
- data/lib/rbbt/util/procpath.rb +6 -6
- data/lib/rbbt/util/python/paths.rb +27 -0
- data/lib/rbbt/util/python/run.rb +115 -0
- data/lib/rbbt/util/python/script.rb +110 -0
- data/lib/rbbt/util/python/util.rb +3 -3
- data/lib/rbbt/util/python.rb +22 -81
- data/lib/rbbt/util/semaphore.rb +152 -148
- data/lib/rbbt/util/simpleopt.rb +9 -8
- data/lib/rbbt/util/ssh/refactor.rb +19 -0
- data/lib/rbbt/util/ssh.rb +122 -118
- data/lib/rbbt/util/tar.rb +117 -115
- data/lib/rbbt/util/tmpfile.rb +69 -67
- data/lib/rbbt/util/version.rb +2 -0
- data/lib/rbbt/workflow/refactor/entity.rb +11 -0
- data/lib/rbbt/workflow/refactor/export.rb +66 -0
- data/lib/rbbt/workflow/refactor/inputs.rb +24 -0
- data/lib/rbbt/workflow/refactor/recursive.rb +64 -0
- data/lib/rbbt/workflow/refactor/task_info.rb +66 -0
- data/lib/rbbt/workflow/refactor.rb +150 -0
- data/lib/rbbt/workflow/remote_workflow/driver/rest.rb +1 -2
- data/lib/rbbt/workflow/remote_workflow/driver/ssh.rb +55 -32
- data/lib/rbbt/workflow/remote_workflow/remote_step/rest.rb +3 -1
- data/lib/rbbt/workflow/remote_workflow/remote_step/ssh.rb +14 -5
- data/lib/rbbt/workflow/remote_workflow/remote_step.rb +19 -7
- data/lib/rbbt/workflow/remote_workflow.rb +6 -1
- data/lib/rbbt/workflow/step/run.rb +766 -766
- data/lib/rbbt/workflow/step/save_load_inputs.rb +254 -254
- data/lib/rbbt/workflow/step.rb +2 -362
- data/lib/rbbt/workflow/task.rb +118 -118
- data/lib/rbbt/workflow/usage.rb +289 -287
- data/lib/rbbt/workflow/util/archive.rb +6 -5
- data/lib/rbbt/workflow/util/data.rb +1 -1
- data/lib/rbbt/workflow/util/orchestrator.rb +249 -246
- data/lib/rbbt/workflow/util/trace.rb +79 -44
- data/lib/rbbt/workflow.rb +4 -882
- data/lib/rbbt-util.rb +21 -13
- data/lib/rbbt.rb +16 -3
- data/python/rbbt/__init__.py +96 -4
- data/python/rbbt/workflow/remote.py +104 -0
- data/python/rbbt/workflow.py +64 -0
- data/python/test.py +10 -0
- data/share/Rlib/plot.R +37 -37
- data/share/Rlib/svg.R +22 -5
- data/share/install/software/lib/install_helpers +1 -1
- data/share/rbbt_commands/hpc/list +2 -3
- data/share/rbbt_commands/hpc/orchestrate +4 -4
- data/share/rbbt_commands/hpc/tail +2 -0
- data/share/rbbt_commands/hpc/task +10 -7
- data/share/rbbt_commands/lsf/list +2 -3
- data/share/rbbt_commands/lsf/orchestrate +4 -4
- data/share/rbbt_commands/lsf/tail +2 -0
- data/share/rbbt_commands/lsf/task +10 -7
- data/share/rbbt_commands/migrate +1 -1
- data/share/rbbt_commands/pbs/list +2 -3
- data/share/rbbt_commands/pbs/orchestrate +4 -4
- data/share/rbbt_commands/pbs/tail +2 -0
- data/share/rbbt_commands/pbs/task +10 -7
- data/share/rbbt_commands/resource/produce +8 -1
- data/share/rbbt_commands/slurm/list +2 -3
- data/share/rbbt_commands/slurm/orchestrate +4 -4
- data/share/rbbt_commands/slurm/tail +2 -0
- data/share/rbbt_commands/slurm/task +10 -7
- data/share/rbbt_commands/system/clean +5 -5
- data/share/rbbt_commands/system/status +5 -5
- data/share/rbbt_commands/tsv/get +2 -3
- data/share/rbbt_commands/tsv/info +10 -13
- data/share/rbbt_commands/tsv/keys +18 -14
- data/share/rbbt_commands/tsv/slice +2 -2
- data/share/rbbt_commands/tsv/transpose +6 -2
- data/share/rbbt_commands/workflow/info +20 -24
- data/share/rbbt_commands/workflow/list +1 -1
- data/share/rbbt_commands/workflow/prov +20 -13
- data/share/rbbt_commands/workflow/retry +43 -0
- data/share/rbbt_commands/workflow/server +12 -2
- data/share/rbbt_commands/workflow/task +80 -73
- data/share/rbbt_commands/workflow/write_info +26 -9
- data/share/software/opt/ssw/ssw.c +861 -0
- data/share/software/opt/ssw/ssw.h +130 -0
- data/share/workflow_config.ru +3 -3
- metadata +45 -6
@@ -18,9 +18,9 @@ $slurm_options = SOPT.get <<EOF
|
|
18
18
|
-si--singularity_img* Singularity image to use
|
19
19
|
-sm--singularity_mounts* Singularity image to use
|
20
20
|
-ug--user_group* Use alternative user group for group project directory
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
--contain* Contain in directory (using Singularity)
|
22
|
+
--sync* Contain in directory and sync jobs
|
23
|
+
--exclusive Make exclusive use of the node
|
24
24
|
-hm--highmem Make use of highmem cores
|
25
25
|
-wc--wipe_container* Wipe the jobs from the contain directory
|
26
26
|
-pd--purge_deps Purge job dependencies
|
@@ -57,7 +57,7 @@ raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint
|
|
57
57
|
|
58
58
|
class Step
|
59
59
|
def join
|
60
|
-
HPC::BATCH_MODULE.wait_for_job(@batch_job_dir)
|
60
|
+
HPC::BATCH_MODULE.wait_for_job(@batch_job_dir) unless done?
|
61
61
|
end
|
62
62
|
|
63
63
|
def run(no_load = true)
|
@@ -9,7 +9,7 @@ require 'time'
|
|
9
9
|
|
10
10
|
rbbt_options = SOPT::GOT_OPTIONS
|
11
11
|
|
12
|
-
$
|
12
|
+
$batch_options = SOPT.get <<EOF
|
13
13
|
-dr--dry_run Print only the template
|
14
14
|
-cj--clean_job Clean job
|
15
15
|
--drbbt* Use development version of rbbt
|
@@ -17,9 +17,9 @@ $slurm_options = SOPT.get <<EOF
|
|
17
17
|
-si--singularity_img* Singularity image to use
|
18
18
|
-sm--singularity_mounts* Singularity image to use
|
19
19
|
-ug--user_group* Use alternative user group for group project directory
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
--contain* Contain in directory (using Singularity)
|
21
|
+
--sync* Contain in directory and sync jobs
|
22
|
+
--exclusive Make exclusive use of the node
|
23
23
|
-hm--highmem Make use of highmem cores
|
24
24
|
-wc--wipe_container* Wipe the jobs from the contain directory
|
25
25
|
-pd--purge_deps Purge job dependencies
|
@@ -45,11 +45,14 @@ $slurm_options = SOPT.get <<EOF
|
|
45
45
|
-OR--orchestration_rules* Orchestration rules
|
46
46
|
EOF
|
47
47
|
|
48
|
-
batch_system = $
|
48
|
+
batch_system = $batch_options.delete :batch_system
|
49
49
|
batch_system ||= 'auto'
|
50
|
+
$batch_options[:log] = rbbt_options[:log]
|
51
|
+
$batch_options[:config_keys] = rbbt_options[:config_keys]
|
50
52
|
|
51
53
|
HPC::BATCH_MODULE = HPC.batch_system batch_system
|
52
54
|
|
55
|
+
|
53
56
|
raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
|
54
57
|
|
55
58
|
class Step
|
@@ -60,7 +63,7 @@ class Step
|
|
60
63
|
else
|
61
64
|
begin
|
62
65
|
Log.debug "Issuing BATCH job for #{self.path}"
|
63
|
-
HPC::BATCH_MODULE.run_job(self, $
|
66
|
+
HPC::BATCH_MODULE.run_job(self, $batch_options)
|
64
67
|
rescue HPC::BATCH_DRY_RUN
|
65
68
|
end
|
66
69
|
end
|
@@ -70,7 +73,7 @@ end
|
|
70
73
|
module RemoteStep::SSH
|
71
74
|
|
72
75
|
def _run
|
73
|
-
RemoteWorkflow::SSH.run_slurm_job(File.join(base_url, task.to_s), @input_id, @base_name, $
|
76
|
+
RemoteWorkflow::SSH.run_slurm_job(File.join(base_url, task.to_s), @input_id, @base_name, $batch_options)
|
74
77
|
end
|
75
78
|
|
76
79
|
end
|
data/share/rbbt_commands/migrate
CHANGED
@@ -206,7 +206,6 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
206
206
|
require 'rbbt/workflow'
|
207
207
|
step_path = step_line.split(": ").last.strip
|
208
208
|
step = Step.new step_path
|
209
|
-
step.load_dependencies_from_info
|
210
209
|
has_bar = false
|
211
210
|
[step].reverse.each do |j|
|
212
211
|
next if j.done?
|
@@ -218,6 +217,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
218
217
|
prog_rep << [rep]
|
219
218
|
end
|
220
219
|
end
|
220
|
+
prog_rep = [Log.color(step.status, step.status)] if prog_rep.empty?
|
221
221
|
end
|
222
222
|
end
|
223
223
|
workflow, task, name = step_path.split("/")[-3..-1]
|
@@ -321,7 +321,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
321
321
|
if tail && File.exist?(File.join(dir, 'std.err'))
|
322
322
|
if exit_status && exit_status != 0
|
323
323
|
puts Log.color(:magenta, "First error or exception found: ")
|
324
|
-
puts CMD.cmd("grep -i
|
324
|
+
puts CMD.cmd("grep -i 'error\\|exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
|
325
325
|
elsif exit_status
|
326
326
|
puts Log.color(:magenta, "Completed jobs: ")
|
327
327
|
puts CMD.cmd("grep -i -w 'Completed step' #{File.join(dir, 'std.err')} | grep -v 'Retrying dep.' | tail -n #{tail.to_i}", :no_fail => true).read
|
@@ -337,7 +337,6 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
337
337
|
require 'rbbt/workflow'
|
338
338
|
step_path = step_line.split(": ").last.strip
|
339
339
|
step = Step.new step_path
|
340
|
-
step.load_dependencies_from_info
|
341
340
|
has_bar = false
|
342
341
|
(step.rec_dependencies + [step]).reverse.each do |j|
|
343
342
|
next if j.done?
|
@@ -18,9 +18,9 @@ $slurm_options = SOPT.get <<EOF
|
|
18
18
|
-si--singularity_img* Singularity image to use
|
19
19
|
-sm--singularity_mounts* Singularity image to use
|
20
20
|
-ug--user_group* Use alternative user group for group project directory
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
--contain* Contain in directory (using Singularity)
|
22
|
+
--sync* Contain in directory and sync jobs
|
23
|
+
--exclusive Make exclusive use of the node
|
24
24
|
-hm--highmem Make use of highmem cores
|
25
25
|
-wc--wipe_container* Wipe the jobs from the contain directory
|
26
26
|
-pd--purge_deps Purge job dependencies
|
@@ -57,7 +57,7 @@ raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint
|
|
57
57
|
|
58
58
|
class Step
|
59
59
|
def join
|
60
|
-
HPC::BATCH_MODULE.wait_for_job(@batch_job_dir)
|
60
|
+
HPC::BATCH_MODULE.wait_for_job(@batch_job_dir) unless done?
|
61
61
|
end
|
62
62
|
|
63
63
|
def run(no_load = true)
|
@@ -9,7 +9,7 @@ require 'time'
|
|
9
9
|
|
10
10
|
rbbt_options = SOPT::GOT_OPTIONS
|
11
11
|
|
12
|
-
$
|
12
|
+
$batch_options = SOPT.get <<EOF
|
13
13
|
-dr--dry_run Print only the template
|
14
14
|
-cj--clean_job Clean job
|
15
15
|
--drbbt* Use development version of rbbt
|
@@ -17,9 +17,9 @@ $slurm_options = SOPT.get <<EOF
|
|
17
17
|
-si--singularity_img* Singularity image to use
|
18
18
|
-sm--singularity_mounts* Singularity image to use
|
19
19
|
-ug--user_group* Use alternative user group for group project directory
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
--contain* Contain in directory (using Singularity)
|
21
|
+
--sync* Contain in directory and sync jobs
|
22
|
+
--exclusive Make exclusive use of the node
|
23
23
|
-hm--highmem Make use of highmem cores
|
24
24
|
-wc--wipe_container* Wipe the jobs from the contain directory
|
25
25
|
-pd--purge_deps Purge job dependencies
|
@@ -45,11 +45,14 @@ $slurm_options = SOPT.get <<EOF
|
|
45
45
|
-OR--orchestration_rules* Orchestration rules
|
46
46
|
EOF
|
47
47
|
|
48
|
-
batch_system = $
|
48
|
+
batch_system = $batch_options.delete :batch_system
|
49
49
|
batch_system ||= 'auto'
|
50
|
+
$batch_options[:log] = rbbt_options[:log]
|
51
|
+
$batch_options[:config_keys] = rbbt_options[:config_keys]
|
50
52
|
|
51
53
|
HPC::BATCH_MODULE = HPC.batch_system batch_system
|
52
54
|
|
55
|
+
|
53
56
|
raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
|
54
57
|
|
55
58
|
class Step
|
@@ -60,7 +63,7 @@ class Step
|
|
60
63
|
else
|
61
64
|
begin
|
62
65
|
Log.debug "Issuing BATCH job for #{self.path}"
|
63
|
-
HPC::BATCH_MODULE.run_job(self, $
|
66
|
+
HPC::BATCH_MODULE.run_job(self, $batch_options)
|
64
67
|
rescue HPC::BATCH_DRY_RUN
|
65
68
|
end
|
66
69
|
end
|
@@ -70,7 +73,7 @@ end
|
|
70
73
|
module RemoteStep::SSH
|
71
74
|
|
72
75
|
def _run
|
73
|
-
RemoteWorkflow::SSH.run_slurm_job(File.join(base_url, task.to_s), @input_id, @base_name, $
|
76
|
+
RemoteWorkflow::SSH.run_slurm_job(File.join(base_url, task.to_s), @input_id, @base_name, $batch_options)
|
74
77
|
end
|
75
78
|
|
76
79
|
end
|
@@ -206,7 +206,6 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
206
206
|
require 'rbbt/workflow'
|
207
207
|
step_path = step_line.split(": ").last.strip
|
208
208
|
step = Step.new step_path
|
209
|
-
step.load_dependencies_from_info
|
210
209
|
has_bar = false
|
211
210
|
[step].reverse.each do |j|
|
212
211
|
next if j.done?
|
@@ -218,6 +217,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
218
217
|
prog_rep << [rep]
|
219
218
|
end
|
220
219
|
end
|
220
|
+
prog_rep = [Log.color(step.status, step.status)] if prog_rep.empty?
|
221
221
|
end
|
222
222
|
end
|
223
223
|
workflow, task, name = step_path.split("/")[-3..-1]
|
@@ -321,7 +321,7 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
321
321
|
if tail && File.exist?(File.join(dir, 'std.err'))
|
322
322
|
if exit_status && exit_status != 0
|
323
323
|
puts Log.color(:magenta, "First error or exception found: ")
|
324
|
-
puts CMD.cmd("grep -i
|
324
|
+
puts CMD.cmd("grep -i 'error\\|exception' #{File.join(dir, 'std.err')} -A #{tail.to_i} |head -n #{tail.to_i}", :no_fail => true).read
|
325
325
|
elsif exit_status
|
326
326
|
puts Log.color(:magenta, "Completed jobs: ")
|
327
327
|
puts CMD.cmd("grep -i -w 'Completed step' #{File.join(dir, 'std.err')} | grep -v 'Retrying dep.' | tail -n #{tail.to_i}", :no_fail => true).read
|
@@ -337,7 +337,6 @@ workdir.glob("**/command.batch").sort_by{|f| File.mtime(f)}.each do |fcmd|
|
|
337
337
|
require 'rbbt/workflow'
|
338
338
|
step_path = step_line.split(": ").last.strip
|
339
339
|
step = Step.new step_path
|
340
|
-
step.load_dependencies_from_info
|
341
340
|
has_bar = false
|
342
341
|
(step.rec_dependencies + [step]).reverse.each do |j|
|
343
342
|
next if j.done?
|
@@ -18,9 +18,9 @@ $slurm_options = SOPT.get <<EOF
|
|
18
18
|
-si--singularity_img* Singularity image to use
|
19
19
|
-sm--singularity_mounts* Singularity image to use
|
20
20
|
-ug--user_group* Use alternative user group for group project directory
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
--contain* Contain in directory (using Singularity)
|
22
|
+
--sync* Contain in directory and sync jobs
|
23
|
+
--exclusive Make exclusive use of the node
|
24
24
|
-hm--highmem Make use of highmem cores
|
25
25
|
-wc--wipe_container* Wipe the jobs from the contain directory
|
26
26
|
-pd--purge_deps Purge job dependencies
|
@@ -57,7 +57,7 @@ raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint
|
|
57
57
|
|
58
58
|
class Step
|
59
59
|
def join
|
60
|
-
HPC::BATCH_MODULE.wait_for_job(@batch_job_dir)
|
60
|
+
HPC::BATCH_MODULE.wait_for_job(@batch_job_dir) unless done?
|
61
61
|
end
|
62
62
|
|
63
63
|
def run(no_load = true)
|
@@ -9,7 +9,7 @@ require 'time'
|
|
9
9
|
|
10
10
|
rbbt_options = SOPT::GOT_OPTIONS
|
11
11
|
|
12
|
-
$
|
12
|
+
$batch_options = SOPT.get <<EOF
|
13
13
|
-dr--dry_run Print only the template
|
14
14
|
-cj--clean_job Clean job
|
15
15
|
--drbbt* Use development version of rbbt
|
@@ -17,9 +17,9 @@ $slurm_options = SOPT.get <<EOF
|
|
17
17
|
-si--singularity_img* Singularity image to use
|
18
18
|
-sm--singularity_mounts* Singularity image to use
|
19
19
|
-ug--user_group* Use alternative user group for group project directory
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
--contain* Contain in directory (using Singularity)
|
21
|
+
--sync* Contain in directory and sync jobs
|
22
|
+
--exclusive Make exclusive use of the node
|
23
23
|
-hm--highmem Make use of highmem cores
|
24
24
|
-wc--wipe_container* Wipe the jobs from the contain directory
|
25
25
|
-pd--purge_deps Purge job dependencies
|
@@ -45,11 +45,14 @@ $slurm_options = SOPT.get <<EOF
|
|
45
45
|
-OR--orchestration_rules* Orchestration rules
|
46
46
|
EOF
|
47
47
|
|
48
|
-
batch_system = $
|
48
|
+
batch_system = $batch_options.delete :batch_system
|
49
49
|
batch_system ||= 'auto'
|
50
|
+
$batch_options[:log] = rbbt_options[:log]
|
51
|
+
$batch_options[:config_keys] = rbbt_options[:config_keys]
|
50
52
|
|
51
53
|
HPC::BATCH_MODULE = HPC.batch_system batch_system
|
52
54
|
|
55
|
+
|
53
56
|
raise ParameterException.new("Could not detect batch_system: #{Misc.fingerprint batch_system}") if HPC::BATCH_MODULE.nil?
|
54
57
|
|
55
58
|
class Step
|
@@ -60,7 +63,7 @@ class Step
|
|
60
63
|
else
|
61
64
|
begin
|
62
65
|
Log.debug "Issuing BATCH job for #{self.path}"
|
63
|
-
HPC::BATCH_MODULE.run_job(self, $
|
66
|
+
HPC::BATCH_MODULE.run_job(self, $batch_options)
|
64
67
|
rescue HPC::BATCH_DRY_RUN
|
65
68
|
end
|
66
69
|
end
|
@@ -70,7 +73,7 @@ end
|
|
70
73
|
module RemoteStep::SSH
|
71
74
|
|
72
75
|
def _run
|
73
|
-
RemoteWorkflow::SSH.run_slurm_job(File.join(base_url, task.to_s), @input_id, @base_name, $
|
76
|
+
RemoteWorkflow::SSH.run_slurm_job(File.join(base_url, task.to_s), @input_id, @base_name, $batch_options)
|
74
77
|
end
|
75
78
|
|
76
79
|
end
|
@@ -22,7 +22,7 @@ Specify workflow '.' and no task to examine the jobs of the current directory (u
|
|
22
22
|
-d--dirty Clean dirty jobs
|
23
23
|
-h--help Print this help
|
24
24
|
EOF
|
25
|
-
|
25
|
+
scout_usage and exit 0 if options[:help]
|
26
26
|
|
27
27
|
workflow, task = ARGV
|
28
28
|
|
@@ -98,7 +98,7 @@ TSV.traverse jobs do |file,i|
|
|
98
98
|
else
|
99
99
|
info = begin
|
100
100
|
Open.open(i[:info_file]) do |f|
|
101
|
-
Step
|
101
|
+
Step.load_info(f)
|
102
102
|
end
|
103
103
|
rescue
|
104
104
|
{:status => :noinfo}
|
@@ -136,9 +136,9 @@ TSV.traverse jobs do |file,i|
|
|
136
136
|
end
|
137
137
|
|
138
138
|
if (force && status !~ /done/) or
|
139
|
-
|
140
|
-
|
141
|
-
|
139
|
+
status =~ /\b(old|dirty|nopid|error|missing|aborted|dead|sync|waiting)$/ or
|
140
|
+
(status == "noinfo" and not done) or
|
141
|
+
status == ""
|
142
142
|
|
143
143
|
puts " Removing #{ file } - #{status}"
|
144
144
|
Step.clean(file)
|
@@ -74,7 +74,7 @@ end
|
|
74
74
|
def input_msg(file, inputs)
|
75
75
|
|
76
76
|
str = ""
|
77
|
-
job_inputs =
|
77
|
+
job_inputs = Step.new(file).recursive_inputs.to_hash
|
78
78
|
IndiferentHash.setup(job_inputs)
|
79
79
|
|
80
80
|
inputs.each do |input|
|
@@ -187,9 +187,10 @@ workflows.sort.each do |workflow,tasks|
|
|
187
187
|
if info_fields and info_fields.any?
|
188
188
|
info = begin
|
189
189
|
Open.open(i[:info_file]) do |f|
|
190
|
-
Step
|
190
|
+
Step.load_info(f)
|
191
191
|
end
|
192
192
|
rescue
|
193
|
+
Log.exception $!
|
193
194
|
{:status => :noinfo}
|
194
195
|
end
|
195
196
|
IndiferentHash.setup(info)
|
@@ -198,10 +199,9 @@ workflows.sort.each do |workflow,tasks|
|
|
198
199
|
else
|
199
200
|
info = begin
|
200
201
|
Open.open(i[:info_file]) do |f|
|
201
|
-
Step
|
202
|
+
Step.load_info(f)
|
202
203
|
end
|
203
204
|
rescue
|
204
|
-
#Log.exception $!
|
205
205
|
{:status => :noinfo}
|
206
206
|
end
|
207
207
|
IndiferentHash.setup(info)
|
@@ -219,7 +219,7 @@ workflows.sort.each do |workflow,tasks|
|
|
219
219
|
end
|
220
220
|
end
|
221
221
|
str << " #{ Step.prov_status_msg status }"
|
222
|
-
str << " (dirty)" if status == 'done' &&
|
222
|
+
str << " (dirty)" if status == 'done' && Step.new(file).dirty?
|
223
223
|
|
224
224
|
if inputs and inputs.any?
|
225
225
|
str << input_msg(file, inputs)
|
data/share/rbbt_commands/tsv/get
CHANGED
@@ -78,11 +78,10 @@ if TSV === tsv
|
|
78
78
|
exit
|
79
79
|
end
|
80
80
|
|
81
|
-
parser = TSV::Parser.new tsv,
|
81
|
+
parser = TSV::Parser.new tsv, **options
|
82
82
|
fields ||= parser.fields
|
83
|
-
|
84
83
|
i = 0
|
85
|
-
TSV.traverse(parser) do |k,v|
|
84
|
+
TSV.traverse(parser, :key_field => key_field, :fields => fields, :type => options[:type]) do |k,v|
|
86
85
|
if key== "#{i}"
|
87
86
|
key = k.first
|
88
87
|
elsif key.nil?
|
@@ -14,10 +14,7 @@ Display summary information. Works with Tokyocabinet HDB and BDB as well.
|
|
14
14
|
|
15
15
|
-tch--tokyocabinet File is a TC HDB
|
16
16
|
-tcb--tokyocabinet_bd File is a TC BDB
|
17
|
-
-t--type* Type of tsv (single, list, double, flat)
|
18
17
|
-hh--header_hash* Change the character used to mark the header line (defaults to #)
|
19
|
-
-k--key_field* Change the key field
|
20
|
-
-f--fields* Change the fields to load
|
21
18
|
-fp--fingerprint Fingerprint values
|
22
19
|
-s--sep* Change the fields separator (default TAB)
|
23
20
|
-h--help Help
|
@@ -32,8 +29,8 @@ file = STDIN if file == '-'
|
|
32
29
|
raise ParameterException, "Please specify the tsv file as argument" if file.nil?
|
33
30
|
|
34
31
|
options[:fields] = options[:fields].split(/[,\|]/) if options[:fields]
|
35
|
-
|
36
|
-
options
|
32
|
+
|
33
|
+
options.keys_to_sym!
|
37
34
|
|
38
35
|
case
|
39
36
|
when options[:tokyocabinet]
|
@@ -43,16 +40,16 @@ when options[:tokyocabinet_bd]
|
|
43
40
|
tsv = Persist.open_tokyocabinet(file, false, nil, TokyoCabinet::BDB)
|
44
41
|
puts tsv.summary
|
45
42
|
else
|
46
|
-
|
43
|
+
options, key_field, fields, first_line = TSV.parse_header(Open.open(file, :nocache => true), **options)
|
47
44
|
|
48
45
|
puts "File: #{ file }"
|
49
|
-
puts "Type: #{
|
50
|
-
puts "Namespace: #{
|
51
|
-
puts "Key: #{Log.color :yellow,
|
46
|
+
puts "Type: #{options[:type]}"
|
47
|
+
puts "Namespace: #{options[:namespace]}"
|
48
|
+
puts "Key: #{Log.color :yellow, key_field}"
|
52
49
|
puts "Fields: "
|
53
|
-
if
|
50
|
+
if fields.nil?
|
54
51
|
else
|
55
|
-
|
52
|
+
fields.each_with_index do |f,i|
|
56
53
|
puts " - #{Log.color :cyan, i + 1}: " << Log.color(:yellow, f)
|
57
54
|
end
|
58
55
|
end
|
@@ -71,9 +68,9 @@ else
|
|
71
68
|
|
72
69
|
puts "Rows: #{Log.color :blue, rows}"
|
73
70
|
parts = []
|
74
|
-
|
71
|
+
first_line.split(options[:sep] || "\t", -1).each_with_index do |p,i|
|
75
72
|
p.strip!
|
76
|
-
p = Misc.fingerprint p.split("|") if %w(double flat).include?(
|
73
|
+
p = Misc.fingerprint p.split("|") if %w(double flat).include?(options[:type].to_s) && options[:fingerprint]
|
77
74
|
parts << (Log.color(:cyan, "(#{i}) ") << p.strip)
|
78
75
|
end
|
79
76
|
puts parts * "\t"
|
@@ -37,22 +37,26 @@ when options[:tokyocabinet_bd]
|
|
37
37
|
exit
|
38
38
|
end
|
39
39
|
|
40
|
-
parser = TSV::Parser.new TSV.get_stream(file)
|
40
|
+
parser = TSV::Parser.new TSV.get_stream(file)
|
41
41
|
|
42
42
|
options[:merge] = false if options[:merge] == "false"
|
43
43
|
|
44
|
-
|
45
|
-
bar = Log::ProgressBar.new
|
46
|
-
while line
|
47
|
-
bar.tick
|
48
|
-
|
49
|
-
line = Misc.fixutf8(line)
|
50
|
-
line = parser.process line
|
51
|
-
raise SKIP_LINE if line.empty?
|
52
|
-
parts = parser.chop_line line
|
53
|
-
key, values = parser.get_values parts
|
54
|
-
values = parser.cast_values values if parser.cast?
|
55
|
-
|
44
|
+
parser.traverse fields: [] do |key,v|
|
56
45
|
puts key
|
57
|
-
line = parser.stream.gets
|
58
46
|
end
|
47
|
+
|
48
|
+
#line = parser.first_line
|
49
|
+
#bar = Log::ProgressBar.new
|
50
|
+
#while line
|
51
|
+
# bar.tick
|
52
|
+
#
|
53
|
+
# line = Misc.fixutf8(line)
|
54
|
+
# line = parser.traverse line
|
55
|
+
# raise SKIP_LINE if line.empty?
|
56
|
+
# parts = parser.chop_line line
|
57
|
+
# key, values = parser.get_values parts
|
58
|
+
# values = parser.cast_values values if parser.cast?
|
59
|
+
#
|
60
|
+
# puts key
|
61
|
+
# line = parser.stream.gets
|
62
|
+
#end
|
@@ -35,7 +35,7 @@ file = case file
|
|
35
35
|
fields = options[:fields]
|
36
36
|
raise ParameterException, "Please specify the fields to slice" if fields.nil?
|
37
37
|
|
38
|
-
options
|
38
|
+
options.keys_to_sym!
|
39
39
|
|
40
40
|
case
|
41
41
|
when options[:tokyocabinet]
|
@@ -45,7 +45,7 @@ when options[:tokyocabinet_bd]
|
|
45
45
|
tsv = Persist.open_tokyocabinet(file, false, nil, TokyoCabinet::BDB)
|
46
46
|
puts tsv.summary
|
47
47
|
else
|
48
|
-
stream = TSV.traverse file, options.merge(:into => :stream, :type => :list, :fields => fields.split(","), :unnamed => true) do |k,fields,names|
|
48
|
+
stream = TSV.traverse file, **options.merge(:into => :stream, :type => :list, :fields => fields.split(","), :unnamed => true) do |k,fields,names|
|
49
49
|
[k,fields].flatten * "\t"
|
50
50
|
end
|
51
51
|
puts stream.read
|
@@ -32,9 +32,13 @@ file = case file
|
|
32
32
|
raise ParameterException, "Please specify the tsv file as argument" if file.nil?
|
33
33
|
end
|
34
34
|
|
35
|
-
field = options[:field]
|
36
35
|
|
37
|
-
options[:header_hash]
|
36
|
+
options[:header_hash] ||= options.delete "header_hash"
|
37
|
+
options.delete :header_hash if options[:header_hash].nil?
|
38
|
+
|
39
|
+
field = options.delete :field
|
40
|
+
|
41
|
+
options.keys_to_sym!
|
38
42
|
|
39
43
|
case
|
40
44
|
when options[:tokyocabinet]
|
@@ -77,8 +77,8 @@ if options[:original]
|
|
77
77
|
exit 0
|
78
78
|
end
|
79
79
|
|
80
|
+
inputs = step.inputs
|
80
81
|
dependencies = info[:dependencies]
|
81
|
-
inputs = info[:inputs]
|
82
82
|
status = info[:status]
|
83
83
|
time = info[:time_elapsed]
|
84
84
|
total_time = info[:total_time_elapsed]
|
@@ -89,6 +89,7 @@ exception = info[:exception]
|
|
89
89
|
rest = info.keys - [:inputs, :dependencies, :status, :time_elapsed, :messages, :backtrace, :exception, :archived_info]
|
90
90
|
|
91
91
|
|
92
|
+
status = :noinfo if status.nil?
|
92
93
|
puts Log.color(:magenta, "File") << ": " << step.path
|
93
94
|
puts Log.color(:magenta, "Status") << ": " << status_msg(status) << ((step.aborted? || step.error?) && step.recoverable_error? ? " (recoverable)" : "" ) << (step.dirty? ? " (dirty)" : "")
|
94
95
|
puts Log.color(:magenta, "Pid") << ": " << pid_msg(pid, status.to_s == "done")
|
@@ -96,17 +97,19 @@ puts Log.color(:magenta, "Time") << ": " << time.to_i.to_s << " sec." if time
|
|
96
97
|
puts Log.color(:magenta, "Total time") << ": " << total_time.to_i.to_s << " sec." if time
|
97
98
|
if inputs and inputs.any?
|
98
99
|
puts Log.color(:magenta, "Inputs")
|
99
|
-
inputs.each do |input,value|
|
100
|
+
inputs.to_hash.each do |input,value|
|
100
101
|
case value
|
101
102
|
when nil
|
102
|
-
puts Misc.format_definition_list_item(" " + input.to_s, 'nil',
|
103
|
+
puts Misc.format_definition_list_item(" " + input.to_s, 'nil', 20, width, color: :blue)
|
103
104
|
when Array
|
104
|
-
puts Misc.format_definition_list_item(" " + input.to_s, (value.length > 6 ? value[0..5]*"\n" << "\n" << "..." : value * "\n" ),
|
105
|
+
puts Misc.format_definition_list_item(" " + input.to_s, (value.length > 6 ? value[0..5]*"\n" << "\n" << "..." : value * "\n" ), 20, width, color: :blue)
|
105
106
|
when TrueClass, FalseClass
|
106
|
-
puts Misc.format_definition_list_item(" " + input.to_s, value.to_s,
|
107
|
+
puts Misc.format_definition_list_item(" " + input.to_s, value.to_s, 20, width, color: :blue)
|
108
|
+
when Step
|
109
|
+
puts Misc.format_definition_list_item(" " << input.to_s, value.short_path, 20, width, color: :blue)
|
107
110
|
else
|
108
111
|
text = value.to_s.split("\n")[0..5].compact * "\n\n"
|
109
|
-
puts Misc.format_definition_list_item(" " + input.to_s, text,
|
112
|
+
puts Misc.format_definition_list_item(" " + input.to_s, text, 20, width, color: :blue)
|
110
113
|
end
|
111
114
|
end
|
112
115
|
end
|
@@ -150,32 +153,25 @@ if all
|
|
150
153
|
end
|
151
154
|
|
152
155
|
if recursive
|
153
|
-
inputs = step.
|
154
|
-
|
155
|
-
|
156
|
-
while deps.any? do
|
157
|
-
dep = deps.shift
|
158
|
-
inputs = {} if inputs.nil?
|
159
|
-
inputs = inputs.merge(dep.info[:inputs] || {})
|
160
|
-
deps = deps.concat dep.dependencies if dep.dependencies
|
161
|
-
end
|
156
|
+
inputs = step.recursive_inputs
|
157
|
+
inputs = NamedArray.setup(inputs.values, inputs.keys)
|
162
158
|
|
163
|
-
inputs = inputs.
|
159
|
+
inputs = inputs.concat step.archived_inputs
|
164
160
|
if inputs.any?
|
165
161
|
puts Log.color(:magenta, "Recursive inputs") << ": "
|
166
|
-
inputs.each do |input,value|
|
162
|
+
inputs.to_hash.each do |input,value|
|
167
163
|
case value
|
168
164
|
when nil
|
169
|
-
puts Misc.format_definition_list_item(" "
|
165
|
+
puts Misc.format_definition_list_item(" " + input.to_s, 'nil', 20, width, color: :blue)
|
170
166
|
when Array
|
171
|
-
puts Misc.format_definition_list_item(" "
|
167
|
+
puts Misc.format_definition_list_item(" " + input.to_s, (value.length > 6 ? value[0..5]*"\n" << "\n" << "..." : value * "\n" ), 20, width, color: :blue)
|
172
168
|
when TrueClass, FalseClass
|
173
|
-
puts Misc.format_definition_list_item(" "
|
169
|
+
puts Misc.format_definition_list_item(" " + input.to_s, value.to_s, 20, width, color: :blue)
|
170
|
+
when Step
|
171
|
+
puts Misc.format_definition_list_item(" " << input.to_s, value.short_path, 20, width, color: :blue)
|
174
172
|
else
|
175
|
-
|
176
|
-
|
177
|
-
text << "\n\n...\n\n" if lines.length > 6
|
178
|
-
puts Misc.format_definition_list_item(" " << input.to_s, text, width, 20, :blue).gsub("\n\n","\n")
|
173
|
+
text = value.to_s.split("\n")[0..5].compact * "\n\n"
|
174
|
+
puts Misc.format_definition_list_item(" " + input.to_s, text, 20, width, color: :blue)
|
179
175
|
end
|
180
176
|
end
|
181
177
|
end
|