rbbt-util 5.32.1 → 5.32.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/hpc/lsf.rb +1 -1
- data/lib/rbbt/persist/tsv/adapter.rb +1 -1
- data/lib/rbbt/tsv/parser.rb +2 -2
- data/lib/rbbt/tsv/stream.rb +1 -0
- data/lib/rbbt/util/misc/pipes.rb +1 -1
- data/lib/rbbt/workflow.rb +10 -6
- data/lib/rbbt/workflow/definition.rb +1 -0
- data/lib/rbbt/workflow/doc.rb +18 -3
- data/lib/rbbt/workflow/util/trace.rb +9 -3
- data/share/rbbt_commands/workflow/forget_deps +17 -5
- 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: 612e1472bae3839b68f143d639025a9bb19294525ecc0e95df99702883af31d3
|
4
|
+
data.tar.gz: bea8c5ec09525363447c5bdc140f899f8a22ccb311d225da061b01d6f68bcf10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0aef55d55b97f40011aeaa3f09450dd623ad6d682b4b3ef5dc3f2df603efeeede2e50b3be2f4f586e502adb6a4a0fd898113d3c5c892212170edb4cde7b7f6a7
|
7
|
+
data.tar.gz: 81261ef8e8da6ada5c1d8e672fdbd31ff6dc67a7a08edb4b6a3dcee10cfc6ed3f7abacf0c3628d604839e2743de043793c5169a147bd9b528c2afd614dca62b9
|
data/lib/rbbt/hpc/lsf.rb
CHANGED
@@ -8,7 +8,7 @@ module HPC
|
|
8
8
|
def self.batch_system_variables
|
9
9
|
<<-EOF
|
10
10
|
let TOTAL_PROCESORS="$(cat /proc/cpuinfo|grep ^processor |wc -l)"
|
11
|
-
let MAX_MEMORY_DEFAULT="$(grep MemTotal /proc/meminfo|grep -o "[[:digit:]]*") / ( (1024 * $TOTAL_PROCESORS) / $
|
11
|
+
let MAX_MEMORY_DEFAULT="$(grep MemTotal /proc/meminfo|grep -o "[[:digit:]]*") / ( (1024 * $TOTAL_PROCESORS) / $LSB_MAX_NUM_PROCESSORS )"
|
12
12
|
[ ! -z $LSB_MAX_MEM_RUSAGE ] && let MAX_MEMORY="$LSB_MAX_MEM_RUSAGE" || MAX_MEMORY="$MAX_MEMORY_DEFAULT"
|
13
13
|
export MAX_MEMORY_DEFAULT
|
14
14
|
export MAX_MEMORY
|
data/lib/rbbt/tsv/parser.rb
CHANGED
@@ -40,7 +40,7 @@ module TSV
|
|
40
40
|
# Process fields line
|
41
41
|
|
42
42
|
preamble << line if line
|
43
|
-
while line
|
43
|
+
while line && (TrueClass === @header_hash || (String === @header_hash && Misc.fixutf8(line) =~ /^#{@header_hash}/ ))
|
44
44
|
@fields = line.split(@sep, -1)
|
45
45
|
@key_field = @fields.shift
|
46
46
|
@key_field = @key_field[(0 + header_hash.length)..-1] if String === @header_hash
|
@@ -49,7 +49,7 @@ module TSV
|
|
49
49
|
line = (@header_hash != "" ? stream.gets : nil)
|
50
50
|
line = Misc.fixutf8 line.chomp if line
|
51
51
|
preamble << line if line
|
52
|
-
@header_hash = false if TrueClass === @header_hash
|
52
|
+
@header_hash = false if TrueClass === @header_hash || @header_hash == ""
|
53
53
|
end
|
54
54
|
|
55
55
|
@preamble = preamble[0..-3] * "\n"
|
data/lib/rbbt/tsv/stream.rb
CHANGED
data/lib/rbbt/util/misc/pipes.rb
CHANGED
data/lib/rbbt/workflow.rb
CHANGED
@@ -187,17 +187,21 @@ module Workflow
|
|
187
187
|
clean_name = wf_name.sub(/::.*/,'')
|
188
188
|
Log.info{"Looking for '#{wf_name}' in '#{clean_name}'"}
|
189
189
|
require_workflow clean_name
|
190
|
-
|
190
|
+
workflow = Misc.string2const Misc.camel_case(wf_name)
|
191
|
+
workflow.load_documentation
|
192
|
+
return workflow
|
191
193
|
end
|
192
194
|
|
193
195
|
Log.high{"Loading workflow #{wf_name}"}
|
194
196
|
require_local_workflow(wf_name) or
|
195
197
|
(Workflow.autoinstall and `rbbt workflow install #{Misc.snake_case(wf_name)} || rbbt workflow install #{wf_name}` and require_local_workflow(wf_name)) or raise("Workflow not found or could not be loaded: #{ wf_name }")
|
196
|
-
begin
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
198
|
+
workflow = begin
|
199
|
+
Misc.string2const Misc.camel_case(wf_name)
|
200
|
+
rescue
|
201
|
+
Workflow.workflows.last || true
|
202
|
+
end
|
203
|
+
workflow.load_documentation
|
204
|
+
workflow
|
201
205
|
end
|
202
206
|
|
203
207
|
attr_accessor :description
|
@@ -74,6 +74,7 @@ module Workflow
|
|
74
74
|
def dep_task(name, workflow, oname, *rest, &block)
|
75
75
|
dep(workflow, oname, *rest, &block)
|
76
76
|
extension workflow.tasks[oname].extension if workflow.tasks.include?(oname) unless @extension
|
77
|
+
returns workflow.tasks[oname].result_description if workflow.tasks.include?(oname) unless @result_description
|
77
78
|
task name do
|
78
79
|
raise RbbtException, "dependency not found in dep_task" if dependencies.empty?
|
79
80
|
dep = dependencies.last
|
data/lib/rbbt/workflow/doc.rb
CHANGED
@@ -45,10 +45,25 @@ module Workflow
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def load_documentation
|
48
|
-
@documentation
|
48
|
+
return if @documentation
|
49
|
+
@documentation ||= Workflow.parse_workflow_doc documentation_markdown
|
49
50
|
@documentation[:tasks].each do |task, description|
|
50
|
-
|
51
|
-
|
51
|
+
if task.include? "#"
|
52
|
+
workflow, task = task.split("#")
|
53
|
+
workflow = begin
|
54
|
+
Kernel.const_get workflow
|
55
|
+
rescue
|
56
|
+
next
|
57
|
+
end
|
58
|
+
else
|
59
|
+
workflow = self
|
60
|
+
end
|
61
|
+
|
62
|
+
if workflow.tasks.include? task.to_sym
|
63
|
+
workflow.tasks[task.to_sym].description = description
|
64
|
+
else
|
65
|
+
Log.low "Documentation for #{ task }, but not a #{ workflow.to_s } task"
|
66
|
+
end
|
52
67
|
end
|
53
68
|
end
|
54
69
|
|
@@ -180,11 +180,17 @@ rbbt.png_plot('#{plot}', 'plot(timeline)', width=#{width}, height=#{height}, poi
|
|
180
180
|
jobs += step.rec_dependencies + [step]
|
181
181
|
step.info[:archived_info].each do |path,ainfo|
|
182
182
|
archived_step = Step.new path
|
183
|
-
|
184
|
-
|
185
|
-
end.define_method :info do
|
183
|
+
|
184
|
+
archived_step.define_singleton_method :info do
|
186
185
|
ainfo
|
187
186
|
end
|
187
|
+
|
188
|
+
#class << archived_step
|
189
|
+
# self
|
190
|
+
#end.define_method :info do
|
191
|
+
# ainfo
|
192
|
+
#end
|
193
|
+
|
188
194
|
jobs << archived_step
|
189
195
|
end if step.info[:archived_info]
|
190
196
|
|
@@ -8,9 +8,11 @@ $0 = "rbbt #{$previous_commands*" "} #{ File.basename(__FILE__) }" if $previous_
|
|
8
8
|
|
9
9
|
options = SOPT.setup <<EOF
|
10
10
|
|
11
|
-
Make a job forget
|
11
|
+
Make a job forget its dependencies and archive their meta-data
|
12
12
|
|
13
|
-
$ #{$0} [options] <job_path>
|
13
|
+
$ #{$0} [options] <job_path> [<task_name>|<workflow>#<task_name>] ...
|
14
|
+
|
15
|
+
Specific dependencies can be specified as . Otherwise, all are forgoten.
|
14
16
|
|
15
17
|
-h--help Print this help
|
16
18
|
-p--purge Purge dependencies
|
@@ -26,7 +28,7 @@ if options[:help]
|
|
26
28
|
exit 0
|
27
29
|
end
|
28
30
|
|
29
|
-
path = ARGV
|
31
|
+
path, *remove = ARGV
|
30
32
|
|
31
33
|
raise ParameterException, "No path given" if path.nil?
|
32
34
|
step = Workflow.load_step path
|
@@ -34,10 +36,20 @@ step = Workflow.load_step path
|
|
34
36
|
step.archive_deps
|
35
37
|
step.copy_files_dir
|
36
38
|
dependencies = step.dependencies
|
37
|
-
step.set_info :dependencies, []
|
38
39
|
|
39
|
-
if
|
40
|
+
if remove && remove.any?
|
41
|
+
remove_paths = dependencies.select do |dep|
|
42
|
+
remove.include?(dep.task_name) || remove.include?([dep.workflow.to_s, dep.task_name] * "#")
|
43
|
+
end.collect{|dep| dep.path }
|
44
|
+
else
|
45
|
+
remove_paths = dependencies.collect{|dep| dep.path }
|
46
|
+
end
|
47
|
+
|
48
|
+
step.set_info :dependencies, step.info[:dependencies].reject{|info| remove_paths.include? info.last}
|
49
|
+
|
50
|
+
if options[:purge] || options[:recursive_purge]
|
40
51
|
dependencies.each do |dependency|
|
52
|
+
next unless remove_paths.include? dependency.path
|
41
53
|
Step.purge(dependency.path, options[:recursive_purge])
|
42
54
|
end
|
43
55
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbbt-util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.32.
|
4
|
+
version: 5.32.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|