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(object_uuid: self.uuid).order("created_at DESC")
47 query = query.limit(limit) if limit
51 def stderr_log_lines(limit=2000)
52 stderr_log_query(limit).results.reverse.
53 flat_map { |log| log.properties[:text].split("\n") rescue [] }
56 def work_unit(label=nil)
57 JobWorkUnit.new(self, label)