X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/17e79aa5b26b8c0b3228247451172999ad81baff..8d37eefb14b5bea1044063affa6e299d8ca92c37:/apps/workbench/app/models/work_unit.rb diff --git a/apps/workbench/app/models/work_unit.rb b/apps/workbench/app/models/work_unit.rb index aea0f1270e..7373bc2423 100644 --- a/apps/workbench/app/models/work_unit.rb +++ b/apps/workbench/app/models/work_unit.rb @@ -1,6 +1,5 @@ class WorkUnit - # This is just an abstract class that documents the WorkUnit interface; a - # class can implement the interface without being a subclass of WorkUnit. + # This is an abstract class that documents the WorkUnit interface def label # returns the label that was assigned when creating the work unit @@ -18,10 +17,18 @@ class WorkUnit # returns uuid of the user who modified this work unit most recently end + def owner_uuid + # returns uuid of the owner of this work unit + end + def created_at # returns created_at timestamp end + def modified_at + # returns modified_at timestamp + end + def started_at # returns started_at timestamp for this work unit end @@ -39,12 +46,12 @@ class WorkUnit end def success? - # returnis true if the work unit finished successfully, + # returns true if the work unit finished successfully, # false if it has a permanent failure, # and nil if the final state is not determined. end - def progress + def progress # returns a number between 0 and 1 end @@ -88,20 +95,28 @@ class WorkUnit # returns if this is nondeterministic end - def output - # returns uuid or pdh of output data, if any + def outputs + # returns array containing uuid or pdh of output data + end + + def child_summary + # summary status of any children of this work unit + end + + def child_summary_str + # textual representation of child summary end def can_cancel? - # returns if this work unit is cancelable + # returns true if this work unit can be canceled end - def uri - # returns the uri for this work unit + def readable? + # is the proxied object readable by current user? end - def child_summary - # summary status of any children of this work unit + def uri + # returns the uri for this work unit end def title @@ -111,4 +126,77 @@ class WorkUnit def has_unreadable_children # accept it if you can't understand your own children end + + # view helper methods + def link_to_log + # display a link to log if present + end + + def walltime + # return walltime for a running or completed work unit + end + + def cputime + # return cputime for a running or completed work unit + end + + def queuedtime + # return queued time if the work unit is queued + end + + def is_running? + # is the work unit in running state? + end + + def is_paused? + # is the work unit in paused state? + end + + def is_finished? + # is the work unit in finished state? + end + + def is_failed? + # is this work unit in failed state? + end + + def command + # command to execute + end + + def cwd + # initial workind directory + end + + def environment + # environment variables + end + + def mounts + # mounts + end + + def output_path + # path to a directory or file to save output + end + + def container_uuid + # 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 + + def render_log + # return partial and locals to be rendered + end + + def template_uuid + # return the uuid of this work unit's template, if one exists + end end