[ARVADOS] created: cf6a9fc619a6c65d2bccb563c61b8a448334213c
Git user
git at public.curoverse.com
Wed Dec 7 10:30:27 EST 2016
at cf6a9fc619a6c65d2bccb563c61b8a448334213c (commit)
commit cf6a9fc619a6c65d2bccb563c61b8a448334213c
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Dec 6 17:17:49 2016 -0500
10674: Initialize defaults when creating container request from workflow.
diff --git a/apps/workbench/app/controllers/work_units_controller.rb b/apps/workbench/app/controllers/work_units_controller.rb
index 3b611aa..550bdb7 100644
--- a/apps/workbench/app/controllers/work_units_controller.rb
+++ b/apps/workbench/app/controllers/work_units_controller.rb
@@ -57,7 +57,7 @@ class WorkUnitsController < ApplicationController
workflow = Workflow.find? template_uuid
if workflow.definition
begin
- wf_json = 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}"
@@ -77,11 +77,21 @@ class WorkUnitsController < ApplicationController
attrs['cwd'] = "/var/spool/cwl"
attrs['output_path'] = "/var/spool/cwl"
+ input_defaults = {}
+ if wf_json
+ inputs = get_cwl_inputs(wf_json)
+ inputs.each do |input|
+ if input[:default]
+ input_defaults[cwl_shortname(input[:id])] = input[:default]
+ end
+ end
+ end
+
# mounts
mounts = {
"/var/lib/cwl/cwl.input.json" => {
"kind" => "json",
- "content" => {}
+ "content" => input_defaults
},
"stdout" => {
"kind" => "file",
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list