[ARVADOS] updated: 30146198f24c70941d95af714e036ff3c451626c
Git user
git at public.curoverse.com
Tue Apr 25 15:27:28 EDT 2017
Summary of changes:
.../controllers/container_requests_controller.rb | 5 +++
apps/workbench/app/helpers/provenance_helper.rb | 50 +++++++++-------------
2 files changed, 25 insertions(+), 30 deletions(-)
via 30146198f24c70941d95af714e036ff3c451626c (commit)
from 4ccbea9ef440a7e4252b0df5e710dcb767831c60 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 30146198f24c70941d95af714e036ff3c451626c
Author: Lucas Di Pentima <lucas at curoverse.com>
Date: Tue Apr 25 16:26:38 2017 -0300
10111: Added "child" CRs to the graph, and removed container image and requesting container elements.
diff --git a/apps/workbench/app/controllers/container_requests_controller.rb b/apps/workbench/app/controllers/container_requests_controller.rb
index 817f882..ef7665b 100644
--- a/apps/workbench/app/controllers/container_requests_controller.rb
+++ b/apps/workbench/app/controllers/container_requests_controller.rb
@@ -9,6 +9,11 @@ class ContainerRequestsController < ApplicationController
nodes = {}
nodes[cr[:uuid]] = cr
+ if cr[:container_uuid]
+ ContainerRequest.where(requesting_container_uuid: cr[:container_uuid]).each do |child|
+ nodes[child[:uuid]] = child
+ end
+ end
@svg = ProvenanceHelper::create_provenance_graph nodes,
"provenance_svg",
{
diff --git a/apps/workbench/app/helpers/provenance_helper.rb b/apps/workbench/app/helpers/provenance_helper.rb
index 31d0203..38e952a 100644
--- a/apps/workbench/app/helpers/provenance_helper.rb
+++ b/apps/workbench/app/helpers/provenance_helper.rb
@@ -119,32 +119,12 @@ module ProvenanceHelper
end
[
- [true, :requesting_container_uuid, 'requesting_container'],
- [true, :container_image, 'container_image'],
- [false, :output_uuid, 'output'],
- [false, :log_uuid, 'log']
- ].each do |is_input, attr, label|
+ [:output_uuid, 'output'],
+ [:log_uuid, 'log']
+ ].each do |attr, label|
if cr[attr]
- if attr == :container_image && cr[:container_uuid]
- # Extract the container_image's UUID from the CR's container
- cont = Container.find(cr[:container_uuid])
- gr += describe_node(cont[:container_image], {label: cr[attr]})
- # If container_image, then is_input is true
- edge_from = cont[:container_image]
- edge_to = uuid
- else
- # Default case
- gr += describe_node(cr[attr])
-
- if is_input
- edge_from = cr[attr]
- edge_to = uuid
- else
- edge_from = uuid
- edge_to = cr[attr]
- end
- end
- gr += edge(edge_from, edge_to, {label: label})
+ gr += describe_node(cr[attr])
+ gr += edge(uuid, cr[attr], {label: label})
end
end
@@ -233,11 +213,21 @@ module ProvenanceHelper
gr += job_edges job if job
elsif rsc == ContainerRequest
cr = @pdata[uuid]
- gr += cr_edges cr if cr
- gr += describe_node(uuid, {href: {controller: 'container_requests',
- id: uuid},
- label: @pdata[uuid][:name],
- shape: 'oval'})
+ if cr
+ gr += cr_edges cr
+ gr += describe_node(uuid, {href: {controller: 'container_requests',
+ id: uuid},
+ label: @pdata[uuid][:name],
+ shape: 'oval'})
+ # Search for child CRs
+ if cr[:container_uuid]
+ child_crs = ContainerRequest.where(requesting_container_uuid: cr[:container_uuid])
+ child_crs.each do |child|
+ gr += generate_provenance_edges(child[:uuid])
+ gr += edge(uuid, child[:uuid], {label: 'cr'})
+ end
+ end
+ end
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list