rbbt-util 5.26.167 → 5.26.168

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 723f2dc2ddd485d2e11917918cf610258aec43ef17c1ff2aae15604653bbbe11
4
- data.tar.gz: 4fc26d204c3adb58fcf630e91efb04d55aad70c6f8af3befd8f9585cb73d6b8c
3
+ metadata.gz: e40fba857594d4e21bb57da16268f22032c6d101ebaac110de8094cba38b12a7
4
+ data.tar.gz: 33b4251a885bb44b1ec45aab8e2aa2f96c4066c024e5133f3d28786c9b11aaa3
5
5
  SHA512:
6
- metadata.gz: 5d0228a8bb7350fcb63fb45d20d91d85d7bbf2f26b0293fd02a4090992dda2245a2be33afcf981f527c699c95ac63ad73a232c89ea482d1e91e37ade57d9007e
7
- data.tar.gz: 81b12762a4c0726b8eecdf3d7d1a413dc39a9bc5ca51835f1fdd1925c52d0e0b14b57dbecfdb4b2b7aacfdc3cc6e482cab7a0f87ba91487dd52e37c92673cd5c
6
+ metadata.gz: 0aa7e9832fae143d5cb01fb728aa47d2cc9a78617791202681499bb7d90a6f3c76bb41d8d314c424c144d0ed2ac801acc42e1797d6f2f16781c43589f2e724a9
7
+ data.tar.gz: '084fd15a2fc4cb3513d41d1f5e51623073c713a92970869d0970e232af7ed5c110aab88521451c0706d2b723f0e1a51f4e1fcfdce34dcea6ef3acf9e6e434c5e'
@@ -781,7 +781,6 @@ module Open
781
781
  return nil unless File.exists?(file)
782
782
  File.mtime(file)
783
783
  rescue
784
- Log.exception $!
785
784
  nil
786
785
  end
787
786
  end
@@ -540,12 +540,13 @@ module Workflow
540
540
 
541
541
  def self.__load_step(path)
542
542
  if Open.remote?(path) || Open.ssh?(path)
543
- return RemoteStep.new path
543
+ require 'rbbt/workflow/remote_workflow'
544
+ return RemoteWorkflow.load_path path
544
545
  end
545
546
  step = Step.new path
546
547
  relocated = false
547
548
  step.dependencies = (step.info[:dependencies] || []).collect do |task,name,dep_path|
548
- if Open.exists?(dep_path) || Open.exists?(dep_path + '.info')
549
+ if Open.exists?(dep_path) || Open.exists?(dep_path + '.info') || Open.remote?(dep_path) || Open.ssh?(dep_path)
549
550
  Workflow._load_step dep_path
550
551
  else
551
552
  new_path = relocate(path, dep_path)
@@ -559,6 +560,11 @@ module Workflow
559
560
  end
560
561
 
561
562
  def self.fast_load_step(path)
563
+ if Open.remote?(path) || Open.ssh?(path)
564
+ require 'rbbt/workflow/remote_workflow'
565
+ return RemoteWorkflow.load_path path
566
+ end
567
+
562
568
  step = Step.new path
563
569
  step.dependencies = nil
564
570
  class << step
@@ -618,7 +624,7 @@ module Workflow
618
624
  File.join(workdir, id)
619
625
  end
620
626
  task = task_for path
621
- return remote_tasks[task].load_id(id) if remote_tasks and remote_tasks.include? task
627
+ return remote_tasks[task].load_id(id) if remote_tasks && remote_tasks.include?(task)
622
628
  return Workflow.load_step path
623
629
  end
624
630
 
@@ -630,7 +636,7 @@ module Workflow
630
636
  File.join(workdir, id)
631
637
  end
632
638
  task = task_for path
633
- return remote_tasks[task].load_id(id) if remote_tasks and remote_tasks.include? task
639
+ return remote_tasks[task].load_id(id) if remote_tasks && remote_tasks.include?(task)
634
640
  return Workflow.fast_load_step path
635
641
  end
636
642
 
@@ -57,6 +57,23 @@ class RemoteWorkflow
57
57
  step.result_description = task_info(task)[:result_description]
58
58
  step
59
59
  end
60
+
61
+ def self.load_path(job_url)
62
+ parts = job_url.split("/")
63
+ name = parts.pop.split("?").first
64
+ task = parts.pop
65
+ workflow = parts.last
66
+ url = parts * "/"
67
+
68
+ step = RemoteStep.new url, task, nil
69
+ step.name = name
70
+ step.workflow = workflow
71
+ step.started = true
72
+ step.result_type = step.info[:result_type]
73
+ step.result_description = step.info[:result_description]
74
+
75
+ step
76
+ end
60
77
  end
61
78
 
62
79
  require 'rbbt/workflow/remote_workflow/driver'
@@ -2,7 +2,7 @@ require 'rbbt/workflow'
2
2
 
3
3
  class RemoteStep < Step
4
4
 
5
- attr_accessor :url, :base_url, :task, :base_name, :inputs, :input_types, :result_type, :result_description, :is_exec, :is_stream, :stream_input
5
+ attr_accessor :url, :base_url, :task, :base_name, :inputs, :input_types, :result_type, :result_description, :is_exec, :is_stream, :stream_input, :started
6
6
 
7
7
  def initialize(base_url, task = nil, base_name = nil, inputs = nil, input_types = nil, result_type = nil, result_description = nil, is_exec = false, is_stream = false, stream_input = nil)
8
8
  @base_url, @task, @base_name, @inputs, @input_types, @result_type, @result_description, @is_exec, @is_stream, @stream_input = base_url, task, base_name, inputs, input_types, result_type, result_description, is_exec, is_stream, stream_input
@@ -179,7 +179,7 @@ class RemoteStep < Step
179
179
  end
180
180
 
181
181
  def file(file)
182
- @adaptor.get_raw(File.join(url, 'file', file))
182
+ @adaptor.get_raw(File.join(url, 'file', file.to_s))
183
183
  end
184
184
 
185
185
  def get_stream
@@ -32,10 +32,10 @@ class Step
32
32
 
33
33
  path_mtime = begin
34
34
  Open.mtime(path)
35
- rescue
35
+ rescue Exception
36
36
  nil
37
37
  end
38
- str = if not Open.remote?(path) and (Open.exists?(path) and $main_mtime and path_mtime and ($main_mtime - path_mtime) < -2)
38
+ str = if ! (Open.remote?(path) || Open.ssh?(path)) && (Open.exists?(path) && $main_mtime && path_mtime && ($main_mtime - path_mtime) < -2)
39
39
  prov_status_msg(status.to_s) << " " << [workflow, task, path].compact * " " << " (#{Log.color(:red, "Mtime out of sync") })"
40
40
  else
41
41
  prov_status_msg(status.to_s) << " " << [workflow, task, path].compact * " "
@@ -71,7 +71,7 @@ class Step
71
71
  info[:task_name] = task
72
72
  path = step.path
73
73
  status = info[:status] || :missing
74
- status = "remote" if Open.remote?(path)
74
+ status = "remote" if Open.remote?(path) || Open.ssh?(path)
75
75
  name = info[:name] || File.basename(path)
76
76
  status = :unsync if status == :done and not Open.exist?(path)
77
77
  status = :notfound if status == :noinfo and not Open.exist?(path)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.26.167
4
+ version: 5.26.168
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez