rbbt-util 5.25.5 → 5.25.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e07b6ec4cc5c33daa9aa1ab26b968c7dd42b1c7d
4
- data.tar.gz: 7a2cbbba275dac3f7981ce794468880faac8e306
3
+ metadata.gz: 6c41dd2cc666f027f12f3f06c3f4bd7752f79622
4
+ data.tar.gz: a58c81c37d6ac31ecdac5b1a4d43979ef6ac6d5e
5
5
  SHA512:
6
- metadata.gz: 9a185e9f04e0be73b6d71b8d8358f4cd6c36669c7c93439e1e75876366a14b3aaf392f22be4fa0d19d363fd1256365d5e5258305e3fb9f3d1506aba862e7afc6
7
- data.tar.gz: 02c0a3c7457da08b7445cfde0ef3e5799b69078a26a59b69f913b7c0f631647cf02e0cbb07ef821d82d193de0fd44a6a31dadda6ccbc3871e524183b78282fb3
6
+ metadata.gz: 5ca7a1b01d8b1d446eda5835d5fd9a1b1a4566385f0f47b50609d3cad1eec934a2faf834aa1da47ff861d4986dd441952f3ab32dcb33614d17eaa66165377f78
7
+ data.tar.gz: f0fb32fb43d1e59e5e6152cde6831c3b63379317f6d82ad48851d82e7c34e561835766efc0794efff0b4d92135ceec1f661f73f09d037da59d090e8378c43247
data/lib/rbbt/persist.rb CHANGED
@@ -351,16 +351,17 @@ module Persist
351
351
 
352
352
  persist_options ||= {}
353
353
  if type == :memory and persist_options[:file] and persist_options[:persist]
354
+ repo = persist_options[:repo] || Persist::MEMORY
354
355
  if persist_options[:persist] == :update || persist_options[:update]
355
- (persist_options[:repo] || Persist::MEMORY).delete persist_options[:file]
356
+ repo.delete persist_options[:file]
356
357
  end
357
- return (persist_options[:repo] || Persist::MEMORY)[persist_options[:file]] ||= yield
358
+ return repo[persist_options[:file]] ||= yield
358
359
  end
359
360
 
360
361
  if FalseClass === persist_options[:persist]
361
362
  yield
362
363
  else
363
- persist_options[:update] ||= true if persist_options[:persist].to_s == "update"
364
+ persist_options[:update] = true if persist_options[:persist].to_s == "update"
364
365
  other_options = Misc.process_options persist_options, :other
365
366
  path = persistence_path(name, persist_options, other_options || {})
366
367
 
@@ -375,6 +376,7 @@ module Persist
375
376
  when type.to_sym == :memory
376
377
  repo = persist_options[:repo] || Persist::MEMORY
377
378
  path = path.find if Path === path
379
+ repo.delete path if persist_options[:update]
378
380
  repo[path] ||= yield
379
381
 
380
382
  when (type.to_sym == :annotations and persist_options.include? :annotation_repo)
@@ -475,8 +477,9 @@ module Persist
475
477
  options = options.dup
476
478
  file = name
477
479
  repo = options.delete :repo if options and options.any?
480
+ update = options.delete :update if options and options.any?
478
481
  file << "_" << (options[:key] ? options[:key] : Misc.hash2md5(options)) if options and options.any?
479
- persist name, :memory, {:repo => repo, :persist => true, :file => file}.merge(options), &block
482
+ persist name, :memory, {:repo => repo, :update => update, :persist => true, :file => file}.merge(options), &block
480
483
  end
481
484
  end
482
485
  end
@@ -128,7 +128,15 @@ class WorkflowRESTClient
128
128
 
129
129
  def info(check_lock=false)
130
130
  @done = @info && @info[:status] && @info[:status].to_sym == :done
131
- @info = Persist.memory("RemoteSteps Info", :url => @url, :persist => true, :update => !@done) do
131
+
132
+ if !@done && (@last_info_time.nil? || (Time.now - @last_info_time) > 0.5)
133
+ update = true
134
+ else
135
+ update = false
136
+ end
137
+
138
+ @info = Persist.memory("RemoteSteps Info", :url => @url, :persist => true, :update => update) do
139
+ @last_info_time = Time.now
132
140
  init_job unless @url
133
141
  info = WorkflowRESTClient.get_json(File.join(@url, 'info'))
134
142
  info = WorkflowRESTClient.fix_hash(info)
@@ -140,7 +148,7 @@ class WorkflowRESTClient
140
148
  def status
141
149
  return :done if @done
142
150
  return nil unless url or started?
143
- return :streaming if @streaming
151
+ #return :streaming if @streaming
144
152
  begin
145
153
  status = info[:status]
146
154
  @done = true if status and status.to_sym == :done
@@ -195,6 +203,8 @@ class WorkflowRESTClient
195
203
  def init_job(cache_type = nil, other_params = {})
196
204
  cache_type = :asynchronous if cache_type.nil? and not @is_exec
197
205
  cache_type = :exec if cache_type.nil?
206
+ @last_info_time = nil
207
+ @done = false
198
208
  get_streams
199
209
  @name ||= Persist.memory("RemoteSteps", :workflow => self, :task => task, :jobname => @name, :inputs => inputs, :cache_type => cache_type) do
200
210
  WorkflowRESTClient.post_jobname(File.join(base_url, task.to_s), inputs.merge(other_params).merge(:jobname => @name||@base_name, :_cache_type => cache_type))
@@ -162,6 +162,7 @@ module Workflow
162
162
  end
163
163
 
164
164
  tasks.each do |task|
165
+ Log.high "Task #{task} from #{source.to_s} is already present in #{self.to_s} and will be cloacked" if self.tasks.include? task.to_sym
165
166
  self.tasks[task.to_sym] = source.tasks[task.to_sym] if source.tasks.include? task.to_sym
166
167
  self.task_dependencies[task.to_sym] = source.task_dependencies[task.to_sym] if source.tasks.include? task.to_sym
167
168
  self.task_description[task.to_sym] = source.task_description[task.to_sym] if source.tasks.include? task.to_sym
@@ -94,7 +94,7 @@ TmpFile.with_file do |app_dir|
94
94
  ENV["RBBT_WORKFLOW_TASK_STREAM"] = 'true'
95
95
  end
96
96
 
97
- config_ru_file = File.exist?('./workflow_config.ru') ? './config.ru' : Rbbt.share['workflow_config.ru'].find
97
+ config_ru_file = File.exist?('./workflow_config.ru') ? './workflow_config.ru' : Rbbt.share['workflow_config.ru'].find
98
98
 
99
99
 
100
100
  if options[:options]
@@ -486,6 +486,7 @@ when (defined?(WorkflowRESTClient) and WorkflowRESTClient::RemoteStep)
486
486
  res.join if res.respond_to? :join
487
487
  elsif res.nil?
488
488
  job.join
489
+ raise job.get_exception if job.error? || job.aborted?
489
490
  puts Open.read(job.path, :nocache => true, :nofail => true)
490
491
  else
491
492
  if Array === res
@@ -80,6 +80,9 @@ load_file etc_dir['app.d/post.rb'].find_all
80
80
  #{{{ PRELOAD
81
81
  load_file etc_dir['app.d/preload.rb'].find_all
82
82
 
83
+ #{{{ PRELOAD
84
+ load_file Rbbt.etc['app.d/semaphores.rb'].find_all
85
+
83
86
  if etc_dir['target_workflow_exports'].exists?
84
87
  exports = etc_dir['target_workflow_exports'].read.split("\n")
85
88
  exports.each do |task|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbbt-util
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.25.5
4
+ version: 5.25.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Miguel Vazquez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-14 00:00:00.000000000 Z
11
+ date: 2018-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake