X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/fd5d197916b117386fbe872790ff6493326c4ea2..28b6afc1e8ccf652c7a8fd43e22a8ac788febd85:/apps/workbench/app/controllers/work_units_controller.rb diff --git a/apps/workbench/app/controllers/work_units_controller.rb b/apps/workbench/app/controllers/work_units_controller.rb index 0f0033ce49..42dd12a4c2 100644 --- a/apps/workbench/app/controllers/work_units_controller.rb +++ b/apps/workbench/app/controllers/work_units_controller.rb @@ -4,7 +4,7 @@ class WorkUnitsController < ApplicationController skip_around_action :require_thread_api_token, if: proc { |ctrl| - Rails.configuration.anonymous_user_token and + !Rails.configuration.Users.AnonymousUserToken.empty? and 'show_child_component' == ctrl.action_name } @@ -23,14 +23,14 @@ class WorkUnitsController < ApplicationController # get next page of pipeline_instances if PipelineInstance.api_exists?(:index) filters = @filters + [["uuid", "is_a", ["arvados#pipelineInstance"]]] - pipelines = PipelineInstance.limit(@limit).order(["created_at desc"]).filter(filters) + pipelines = PipelineInstance.limit(@limit).order(["created_at desc"]).filter(filters).with_count("none") end if params[:show_children] # get next page of jobs if Job.api_exists?(:index) filters = @filters + [["uuid", "is_a", ["arvados#job"]]] - jobs = Job.limit(@limit).order(["created_at desc"]).filter(filters) + jobs = Job.limit(@limit).order(["created_at desc"]).filter(filters).with_count("none") end end @@ -39,7 +39,7 @@ class WorkUnitsController < ApplicationController if !params[:show_children] filters << ["requesting_container_uuid", "=", nil] end - crs = ContainerRequest.limit(@limit).order(["created_at desc"]).filter(filters) + crs = ContainerRequest.limit(@limit).order(["created_at desc"]).filter(filters).with_count("none") @objects = (jobs.to_a + pipelines.to_a + crs.to_a).sort_by(&:created_at).reverse.first(@limit) if @objects.any? @@ -70,7 +70,7 @@ class WorkUnitsController < ApplicationController workflow = Workflow.find? template_uuid if workflow.definition begin - wf_json = ActiveSupport::HashWithIndifferentAccess.new YAML::load(workflow.definition) + wf_json = ActiveSupport::HashWithIndifferentAccess.new YAML.load(workflow.definition) rescue => e logger.error "Error converting definition yaml to json: #{e.message}" raise ArgumentError, "Error converting definition yaml to json: #{e.message}" @@ -83,6 +83,7 @@ class WorkUnitsController < ApplicationController attrs['properties'] = {'template_uuid' => template_uuid} attrs['priority'] = 1 attrs['state'] = "Uncommitted" + attrs['use_existing'] = false # required attrs['container_image'] = "arvados/jobs" @@ -117,12 +118,16 @@ class WorkUnitsController < ApplicationController if hint[:keep_cache] keep_cache = hint[:keep_cache] end + if hint[:acrContainerImage] + attrs['container_image'] = hint[:acrContainerImage] + end end end end end attrs['command'] = ["arvados-cwl-runner", + "--enable-reuse", "--local", "--api=containers", "--project-uuid=#{params['work_unit']['owner_uuid']}",