before_validation :set_priority
before_validation :update_state_from_old_state_attrs
validate :ensure_script_version_is_commit
- validate :find_arvados_sdk_version
validate :find_docker_image_locator
+ validate :find_arvados_sdk_version
validate :validate_status
validate :validate_state_change
validate :ensure_no_collection_uuids_in_script_params
end
def queue_position
- Job::queue.each_with_index do |job, index|
- if job[:uuid] == self.uuid
- return index
- end
- end
- nil
+ # We used to report this accurately, but the implementation made queue
+ # API requests O(n**2) for the size of the queue. See #8800.
+ # We've soft-disabled it because it's not clear we even want this
+ # functionality: now that we have Node Manager with support for multiple
+ # node sizes, "queue position" tells you very little about when a job will
+ # run.
+ state == Queued ? 0 : nil
end
def self.running
end
def find_docker_image_locator
+ runtime_constraints['docker_image'] =
+ Rails.configuration.default_docker_image_for_jobs if ((runtime_constraints.is_a? Hash) and
+ (runtime_constraints['docker_image']).nil? and
+ Rails.configuration.default_docker_image_for_jobs)
resolve_runtime_constraint("docker_image",
:docker_image_locator) do |image_search|
image_tag = runtime_constraints['docker_image_tag']