Module: Executor::GridFTPStorage
- Defined in:
- lib/hyperflow-amqp-executor/gridftp_storage.rb
Instance Method Summary collapse
Instance Method Details
#stage_in ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/hyperflow-amqp-executor/gridftp_storage.rb', line 9 def stage_in @job.inputs.each do |file| local_file_name = @workdir + "/" + file.name url = @job..prefix + "/" + file.name Executor::logger.debug "[#{@id}] Downloading #{url} to #{local_file_name}" stdout, stderr, status = Open3.capture3({'X509_USER_PROXY' => @proxy_file}, 'globus-url-copy', url, local_file_name, chdir: @workdir) unless status == 0 raise Exception, "Failed downloading input from GridFTP, status: #{status}\nstdout:\n#{stdout}\n\n stderr:\n#{stderr}" end end end |
#stage_out ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/hyperflow-amqp-executor/gridftp_storage.rb', line 22 def stage_out @job.outputs.each do |file| local_file_name = @workdir + "/" + file.name url = @job..prefix + "/" + file.name Executor::logger.debug "[#{@id}] Uploading #{file.name} to #{url}" stdout, stderr, status = Open3.capture3({'X509_USER_PROXY' => @proxy_file}, 'globus-url-copy', local_file_name, url, chdir: @workdir) unless status == 0 raise Exception, "Failed uploading input from GridFTP, status: #{status}\nstdout:\n#{stdout}\n\n stderr:\n#{stderr}" end end end |
#storage_init ⇒ Object
4 5 6 7 |
# File 'lib/hyperflow-amqp-executor/gridftp_storage.rb', line 4 def storage_init raise Exception, "Unable to locate user proxy certificate" if Executor::settings.plgdata.proxy.nil? or !File.exists?(Executor::settings.plgdata.proxy) @proxy_file = Executor::settings.gridftp.proxy end |
#workdir(&block) ⇒ Object
35 36 37 |
# File 'lib/hyperflow-amqp-executor/gridftp_storage.rb', line 35 def workdir(&block) Dir::mktmpdir(&block) end |