X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/120a2268606d73317ab2353d79c3046017300f81..ba917d72d48615cdd0c6da87d41b6bd0f9f26666:/apps/workbench/app/models/container_work_unit.rb diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb index 88aab306ce..84fc1f8f09 100644 --- a/apps/workbench/app/models/container_work_unit.rb +++ b/apps/workbench/app/models/container_work_unit.rb @@ -53,6 +53,10 @@ class ContainerWorkUnit < ProxyWorkUnit get(:container_uuid) end + def requesting_container_uuid + get(:requesting_container_uuid) + end + def priority @proxied.priority end @@ -81,8 +85,11 @@ class ContainerWorkUnit < ProxyWorkUnit def state_label ec = exit_code return "Failed" if (ec && ec != 0) + state = get_combined(:state) - return "Ready" if ((priority == 0) and (["Queued", "Locked"].include?(state))) + + return "Queued" if state == "Locked" + return "Cancelled" if ((priority == 0) and (state == "Queued")) state end @@ -99,12 +106,21 @@ class ContainerWorkUnit < ProxyWorkUnit end def log_collection - get_combined(:log) + if @proxied.is_a?(ContainerRequest) + get(:log_uuid) + else + get(:log) + end end def outputs items = [] - items << get_combined(:output) if get_combined(:output) + if @proxied.is_a?(ContainerRequest) + out = get(:output_uuid) + else + out = get(:output) + end + items << out if out items end @@ -154,6 +170,13 @@ class ContainerWorkUnit < ProxyWorkUnit protected def get_combined key - get(key, @container) || get(key, @proxied) + from_container = get(key, @container) + from_proxied = get(key, @proxied) + + if from_container.is_a? Hash or from_container.is_a? Array + if from_container.any? then from_container else from_proxied end + else + from_container || from_proxied + end end end