rbbt-util 5.13.21 → 5.13.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: abdf8f28beb9196592b55ba4bce0a36931c8f880
4
- data.tar.gz: eaacc6b9157a3edafe34c6b3b2db9435c9d9dd08
3
+ metadata.gz: 3a19d56208ed15434da77c5823b332526972ac70
4
+ data.tar.gz: 0d1296b74615471612be8717e6530c1cdf687147
5
5
  SHA512:
6
- metadata.gz: c832c458e7434da05bdd203097e787815e35b444c12faf1d6e6de423b2d282528c2a9ed4c379be8580c65b6d71fa01d8595ebf313e59de0dddc1ef3ba2e4ce5a
7
- data.tar.gz: f37553cde0d158988bde704bb73f014d4e8e2d311447d37f87ee61bae7bd314d8e54263438dfce9d22aabf3258b862b87d3fbf910ec4d2f61eb066e75f41d30d
6
+ metadata.gz: 2a409449bb5de7f586d78b4b99306a94fef4a4613da789a06175586e4c16800c6094e797fc2caeab057b9ea2c45ddba173a8bd79e0f341e80733fd8fa515f6d6
7
+ data.tar.gz: 5da483b8a7179b5fd9e9f9b49c1eed1024a7d3d78af15df4cc28f6af66472f8572e4de0840ca2b2bbca24f624abf1d8002e019330d42b304cea03f4cf1543481
data/lib/rbbt/workflow.rb CHANGED
@@ -239,7 +239,7 @@ module Workflow
239
239
  persist = false
240
240
  key = Path === step_path ? step_path.find : step_path
241
241
  step = Persist.memory("Step", :key => key, :repo => step_cache, :persist => persist) do
242
- step = Step.new step_path, task, input_values, dependencies
242
+ step = Step.new step_path, task, input_values, dependencies
243
243
 
244
244
  helpers.each do |name, block|
245
245
  (class << step; self; end).instance_eval do
@@ -270,7 +270,15 @@ module Workflow
270
270
 
271
271
  dependencies = real_dependencies(task, jobname, inputs, task_dependencies[taskname] || [])
272
272
 
273
- if inputs.empty?
273
+ real_inputs = {}
274
+ task_inputs = task_info(taskname)[:inputs]
275
+ defaults = task_info(taskname)[:input_defaults]
276
+
277
+ inputs.each do |k,v|
278
+ real_inputs[k] = v if task_inputs.include?(k) and defaults[k].to_s != v.to_s and not (FalseClass === v and defaults[k].nil?)
279
+ end
280
+
281
+ if real_inputs.empty?
274
282
  step_path = step_path taskname, jobname, [], [], task.extension
275
283
  input_values = task.take_input_values(inputs)
276
284
  else
@@ -445,8 +445,8 @@ class Step
445
445
  pid = nil
446
446
  dependencies.each{|dep| dep.join }
447
447
  end
448
- self
449
448
  sleep 1 until path.exists?
449
+ self
450
450
  ensure
451
451
  set_info :joined, true
452
452
  end
@@ -18,12 +18,12 @@ workflow = ARGV.first
18
18
 
19
19
  YAML::ENGINE.yamler = 'syck' if defined? YAML::ENGINE and YAML::ENGINE.respond_to? :yamler
20
20
 
21
- Workflow.require_workflow workflow
21
+ wf = Workflow.require_workflow workflow
22
22
 
23
23
  class WorkflowRest < Sinatra::Base
24
- get '/' do
25
- redirect to(File.join('/', Workflow.workflows.last.to_s))
26
- end
24
+ self
25
+ end.get '/' do
26
+ redirect to(File.join('/', wf.to_s))
27
27
  end
28
28
 
29
29
  ENV["RACK_ENV"] = options[:environment] if options.include?(:environment)
@@ -60,7 +60,7 @@ class WorkflowRest < Sinatra::Base
60
60
  use Rack::Deflater
61
61
  end
62
62
 
63
- WorkflowRest.add_workflow Workflow.workflows.last, true
63
+ WorkflowRest.add_workflow wf, true
64
64
 
65
65
  WorkflowRest.port = options[:port] || 4567
66
66
  WorkflowRest.bind = options[:bind] || "0.0.0.0"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.13.21
4
+ version: 5.13.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
@@ -264,7 +264,6 @@ files:
264
264
  - share/rbbt_commands/workflow/list
265
265
  - share/rbbt_commands/workflow/monitor
266
266
  - share/rbbt_commands/workflow/prov
267
- - share/rbbt_commands/workflow/provenance
268
267
  - share/rbbt_commands/workflow/remote/add
269
268
  - share/rbbt_commands/workflow/remote/list
270
269
  - share/rbbt_commands/workflow/remote/remove
@@ -1,87 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'rbbt/workflow'
4
-
5
-
6
-
7
- require 'rbbt-util'
8
- require 'fileutils'
9
- require 'rbbt/util/simpleopt'
10
- require 'rbbt/workflow/step'
11
- require 'rbbt/util/misc'
12
-
13
- $workdir = Path.setup(File.expand_path(ARGV[0] || '.'))
14
-
15
- def info_files
16
- $workdir.glob(Step.info_file('**/*'))
17
- end
18
-
19
- def running?(info)
20
- Misc.pid_exists? info[:pid]
21
- end
22
-
23
- def job_str(file, info, severity_color = nil)
24
- clean_file = file.sub('./','').sub('.info','').gsub('/', Term::ANSIColor.blue(' => '))
25
- if $name
26
- clean_file
27
- else
28
- info ||= {:status => :missing_info_file}
29
- str = [clean_file, info[:status].to_s] * "\t\t\t[ STATUS = " + " ]"
30
- if info[:status] != :error and info[:status] != :aborted and not info[:status] == :done
31
- str += " (#{running?(info)? :running : :dead} #{info[:pid]})" if info[:pid]
32
- str += " (children: #{info[:children_pids].collect{|pid| [pid, Misc.pid_exists?(pid) ? "R" : "D"] * ":"} * ", "})" if info.include? :children_pids
33
- end
34
-
35
- if severity_color
36
- "#{severity_color}" << str << "\033[0m"
37
- else
38
- str
39
- end
40
- end
41
- end
42
-
43
- file = ARGV[0]
44
-
45
- deps = {}
46
-
47
- $done = []
48
- def print(file, offset = 1)
49
- if not $done.include? file
50
- putc "*"
51
- end
52
-
53
- step = Step.new file.sub('.info','')
54
-
55
- info = step.info
56
- dependencies = info[:dependencies] || []
57
- color = case
58
- when (not info)
59
- nil
60
- when info[:status] == :error
61
- :red
62
- when info[:status] == :aborted
63
- :red
64
- when (info[:status] != :done and info[:pid] and not running? info)
65
- :green
66
- end
67
-
68
- puts (" " * offset * 2) << Log.color(color, step.path)
69
- $done << file
70
- root = File.dirname(File.dirname(file))
71
- main_parts = step.path.split "/"
72
- dependencies.each do |task,new_file|
73
- new_file = File.join(root, task.to_s, new_file)
74
- parts = new_file.split "/"
75
- common ||= begin
76
- i = 0
77
- parts.each do |p|
78
- break unless main_parts[i] == p
79
- i += 1
80
- end
81
- i
82
- end
83
- print(new_file[common-1..-1], offset+1)
84
- end
85
- end
86
-
87
- print(file)