1 class Job < ArvadosBase
2 def self.goes_in_projects?
10 def editable_attributes
16 x = "\"#{script}\" job"
21 x += " finished #{finished_at.strftime('%b %-d')}"
23 x += " started #{started_at.strftime('%b %-d')}"
25 x += " submitted #{created_at.strftime('%b %-d')}"
30 arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
34 arvados_api_client.api("jobs/", "queue_size", {"_method"=> "GET"})[:queue_size] rescue 0
38 arvados_api_client.unpack_api_response arvados_api_client.api("jobs/", "queue", {"_method"=> "GET"})
41 def textile_attributes
45 def stderr_log_query(limit=nil)
46 query = Log.where(event_type: "stderr", object_uuid: self.uuid)
48 query = query.limit(limit) if limit
52 def stderr_log_lines(limit=2000)
53 stderr_log_query(limit).results.reverse.
54 flat_map { |log| log.properties[:text].split("\n") rescue [] }
57 def work_unit(label=nil)
58 JobWorkUnit.new(self, label)