- when Array
- i = 0
- node = ""
- sp.each do |v|
- if GenerateGraph::collection_uuid(v)
- gr += script_param_edges(job, "#{prefix}[#{i}]", v)
- elsif @opts[:all_script_parameters]
- node += "', '" unless node == ""
- node = "['" if node == ""
- node += "#{v}"
- end
- i += 1
+ end
+ gr
+ end
+
+ def job_edges job, edge_opts={}
+ uuid = job_uuid(job)
+ gr = ""
+
+ ProvenanceHelper::find_collections job[:script_parameters] do |collection_hash, collection_uuid, key|
+ if collection_uuid
+ gr += describe_node(collection_uuid)
+ gr += edge(collection_uuid, uuid, {:label => key})
+ else
+ gr += describe_node(collection_hash)
+ gr += edge(collection_hash, uuid, {:label => key})
+ end
+ end
+
+ if job[:docker_image_locator] and !@opts[:no_docker]
+ gr += describe_node(job[:docker_image_locator], {label: (job[:runtime_constraints].andand[:docker_image] || job[:docker_image_locator])})
+ gr += edge(job[:docker_image_locator], uuid, {label: "docker_image"})
+ end
+
+ if @opts[:script_version_nodes]
+ gr += describe_node(job[:script_version], {:label => "git:#{job[:script_version]}"})
+ gr += edge(job[:script_version], uuid, {:label => "script_version"})
+ end
+
+ if job[:output] and !edge_opts[:no_output]
+ gr += describe_node(job[:output])
+ gr += edge(uuid, job[:output], {label: "output" })
+ end
+
+ if job[:log] and !edge_opts[:no_log]
+ gr += describe_node(job[:log])
+ gr += edge(uuid, job[:log], {label: "log"})
+ end
+
+ gr
+ end
+
+ def cr_edges cont, edge_opts={}
+ uuid = cont[:uuid]
+ gr = ""
+
+ gr += describe_node(cont[:uuid], {href: {controller: 'container_requests',
+ id: cont[:uuid]},
+ shape: 'oval',
+ label: cont[:name]})
+
+ ProvenanceHelper::find_collections cont[:mounts] do |collection_hash, collection_uuid, key|
+ if @opts[:pdh_to_uuid] and @opts[:pdh_to_uuid][collection_hash]
+ collection_uuid = @opts[:pdh_to_uuid][collection_hash].uuid
+ collection_hash = nil