EOS
end
-$arvados_api_version = ENV['ARVADOS_API_VERSION'] || 'v1'
-$arvados_api_host = ENV['ARVADOS_API_HOST'] or
- abort "#{$0}: fatal: ARVADOS_API_HOST environment variable not set."
-$arvados_api_token = ENV['ARVADOS_API_TOKEN'] or
- abort "#{$0}: fatal: ARVADOS_API_TOKEN environment variable not set."
-
begin
require 'arvados'
require 'rubygems'
$stderr.puts "#{File.split($0).last} #{$$}: #{message}" if $debuglevel >= verbosity
end
-module Kernel
- def suppress_warnings
- original_verbosity = $VERBOSE
- $VERBOSE = nil
- result = yield
- $VERBOSE = original_verbosity
- return result
- end
-end
-
-if $arvados_api_host.match /local/
- # You probably don't care about SSL certificate checks if you're
- # testing with a dev server.
- suppress_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE }
-end
-
-
# Parse command line options (the kind that control the behavior of
# this program, that is, not the pipeline component parameters).
abort "#{$0}: error: you must supply --run-pipeline-here, --run-jobs-here, or --submit."
end
-# Suppress SSL certificate checks if ARVADOS_API_HOST_INSECURE
-
-module Kernel
- def suppress_warnings
- original_verbosity = $VERBOSE
- $VERBOSE = nil
- result = yield
- $VERBOSE = original_verbosity
- return result
- end
-end
-
-if ENV['ARVADOS_API_HOST_INSECURE']
- suppress_warnings { OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE }
-end
-
# Set up the API client.
$arv = Arvados.new api_version: 'v1'
},
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
j = JSON.parse result.body, :symbolize_names => true
unless j.is_a? Hash and j[:uuid]
},
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
j = JSON.parse result.body, :symbolize_names => true
unless j.is_a? Hash and j[:uuid]
},
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
j = JSON.parse result.body, :symbolize_names => true
unless j.is_a? Hash and j[:uuid]
},
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
@cache[uuid] = JSON.parse result.body, :symbolize_names => true
end
},
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
list = JSON.parse result.body, :symbolize_names => true
if list and list[:items].is_a? Array
:body_object => body,
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
j = JSON.parse result.body, :symbolize_names => true
if j.is_a? Hash and j[:uuid]
},
:authenticated => false,
:headers => {
- authorization: 'OAuth2 '+ENV['ARVADOS_API_TOKEN']
+ authorization: 'OAuth2 '+$arv.config['ARVADOS_API_TOKEN']
})
@template = JSON.parse result.body, :symbolize_names => true
if !@template[:uuid]
if value.nil? and
![false,'false',0,'0'].index parameter[:required]
if parameter[:output_of]
+ if not @components[parameter[:output_of].intern]
+ errors << [componentname, parametername, "output_of refers to nonexistent component '#{parameter[:output_of]}'"]
+ end
next
end
errors << [componentname, parametername, "required parameter is missing"]
end
debuglog "parameter #{componentname}::#{parametername} == #{value}"
- component[:script_parameters][parametername] = value
+
+ component[:script_parameters][parametername] =
+ parameter.dup.merge(value: value)
end
end
if !errors.empty?
my_submit_id = "instance #{@instance[:uuid]} rand #{rand(2**64).to_s(36)}"
job = JobCache.create(@instance, cname, {
:script => c[:script],
- :script_parameters => c[:script_parameters],
+ :script_parameters => Hash[c[:script_parameters].map do |key, spec|
+ [key, spec[:value]]
+ end],
:script_version => c[:script_version],
:repository => c[:repository],
:nondeterministic => c[:nondeterministic],
c2[:script_parameters].each do |pname, p|
if p.is_a? Hash and p[:output_of] == cname.to_s
debuglog "parameter #{c2name}::#{pname} == #{c[:job][:output]}"
- c2[:script_parameters][pname] = c[:job][:output]
+ c2[:script_parameters][pname] = {value: c[:job][:output]}
moretodo = true
end
end