[ARVADOS] created: 8a7a54ed6d3c57f1142ae22ccb082c6cb9f4dd4d

Git user git at public.curoverse.com
Wed Aug 10 14:06:07 EDT 2016


        at  8a7a54ed6d3c57f1142ae22ccb082c6cb9f4dd4d (commit)


commit 8a7a54ed6d3c57f1142ae22ccb082c6cb9f4dd4d
Author: radhika <radhika at curoverse.com>
Date:   Wed Aug 10 14:05:02 2016 -0400

    9678: enhance container log tab display to consider the "combined" object logs.

diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index f915923..4f4c915 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -124,9 +124,13 @@ class ContainerWorkUnit < ProxyWorkUnit
     get_combined(:output_path)
   end
 
+  def log_object_uuids
+    [get_combined(:uuid), get(:uuid)].uniq
+  end
+
   def live_log_lines(limit=2000)
     event_types = ["stdout", "stderr", "arv-mount", "crunch-run"]
-    log_lines = Log.where(event_type: event_types, object_uuid: uuid).order("id DESC").limit(limit)
+    log_lines = Log.where(event_type: event_types, object_uuid: log_object_uuids).order("id DESC").limit(limit)
     log_lines.results.reverse.
       flat_map { |log| log.properties[:text].split("\n") rescue [] }
   end
diff --git a/apps/workbench/app/models/proxy_work_unit.rb b/apps/workbench/app/models/proxy_work_unit.rb
index 53b4908..feab5d8 100644
--- a/apps/workbench/app/models/proxy_work_unit.rb
+++ b/apps/workbench/app/models/proxy_work_unit.rb
@@ -328,6 +328,10 @@ class ProxyWorkUnit < WorkUnit
     resp
   end
 
+  def log_object_uuids
+    [uuid]
+  end
+
   protected
 
   def get key, obj=@proxied
diff --git a/apps/workbench/app/models/work_unit.rb b/apps/workbench/app/models/work_unit.rb
index 7b52365..0d194b8 100644
--- a/apps/workbench/app/models/work_unit.rb
+++ b/apps/workbench/app/models/work_unit.rb
@@ -184,6 +184,10 @@ class WorkUnit
     # container_uuid of a container_request
   end
 
+  def log_object_uuids
+    # object uuids for live log
+  end
+
   def live_log_lines(limit)
     # fetch log entries from logs table for @proxied
   end
diff --git a/apps/workbench/app/views/work_units/_show_log.html.erb b/apps/workbench/app/views/work_units/_show_log.html.erb
index 566da5b..6a0916f 100644
--- a/apps/workbench/app/views/work_units/_show_log.html.erb
+++ b/apps/workbench/app/views/work_units/_show_log.html.erb
@@ -13,7 +13,7 @@
 <h4>Recent logs</h4>
 <div id="event_log_div"
      class="arv-log-event-listener arv-log-event-handler-append-logs arv-job-log-window"
-     data-object-uuid="<%= wu.uuid %>"
+     data-object-uuids="<%= wu.log_object_uuids.join(' ') %>"
   ><%= wu.live_log_lines(Rails.configuration.running_job_log_records_to_fetch).join("\n") %>
 </div>
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list