projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
11121: Merge branch 'master' into 11121-crunch-output-collection-owner
[arvados.git]
/
apps
/
workbench
/
app
/
models
/
pipeline_instance_work_unit.rb
diff --git
a/apps/workbench/app/models/pipeline_instance_work_unit.rb
b/apps/workbench/app/models/pipeline_instance_work_unit.rb
index 578e193c6e08315cdec182dc00703435b2838aeb..293a77c099d829ae58e58d07784932ba1e9c5fdf 100644
(file)
--- a/
apps/workbench/app/models/pipeline_instance_work_unit.rb
+++ b/
apps/workbench/app/models/pipeline_instance_work_unit.rb
@@
-1,9
+1,11
@@
class PipelineInstanceWorkUnit < ProxyWorkUnit
def children
class PipelineInstanceWorkUnit < ProxyWorkUnit
def children
+ return @my_children if @my_children
+
items = []
jobs = {}
items = []
jobs = {}
- results = Job.where(uuid:
self.
proxied.job_ids.values).results
+ results = Job.where(uuid:
@
proxied.job_ids.values).results
results.each do |j|
jobs[j.uuid] = j
end
results.each do |j|
jobs[j.uuid] = j
end
@@
-16,45
+18,29
@@
class PipelineInstanceWorkUnit < ProxyWorkUnit
if job[:uuid] and jobs[job[:uuid]]
items << jobs[job[:uuid]].work_unit(name)
else
if job[:uuid] and jobs[job[:uuid]]
items << jobs[job[:uuid]].work_unit(name)
else
- items << JobWorkUnit.new(job, name)
+ items << JobWorkUnit.new(job, name
, uuid
)
end
else
end
else
- items <<
ProxyWorkUnit.new(c, name
)
+ items <<
JobWorkUnit.new(c, name, uuid
)
end
else
end
else
-
self.
unreadable_children = true
+
@
unreadable_children = true
break
end
end
break
end
end
- items
+
@my_children =
items
end
end
- def progress
- state = get(:state)
- if state == 'Complete'
- return 1.0
- end
-
- done = 0
- failed = 0
- todo = 0
- children.each do |c|
- if c.success?.nil?
- todo = todo+1
- elsif c.success?
- done = done+1
- else
- failed = failed+1
+ def outputs
+ items = []
+ components = get(:components)
+ components.each do |name, c|
+ if c.is_a?(Hash)
+ items << c[:output_uuid] if c[:output_uuid]
end
end
end
end
-
- if done + failed + todo > 0
- total = done + failed + todo
- (done+failed).to_f / total
- else
- 0.0
- end
+ items
end
def uri
end
def uri
@@
-65,4
+51,8
@@
class PipelineInstanceWorkUnit < ProxyWorkUnit
def title
"pipeline"
end
def title
"pipeline"
end
+
+ def template_uuid
+ get(:pipeline_template_uuid)
+ end
end
end