rbbt-util 5.34.5 → 5.34.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rbbt/tsv/accessor.rb +3 -0
- data/lib/rbbt/tsv/parallel/traverse.rb +1 -1
- data/lib/rbbt/util/misc/development.rb +17 -12
- data/lib/rbbt/util/open.rb +1 -1
- data/lib/rbbt/workflow/remote_workflow/driver/rest.rb +18 -1
- data/lib/rbbt/workflow/remote_workflow/remote_step/rest.rb +2 -1
- data/lib/rbbt/workflow/step/save_load_inputs.rb +1 -1
- data/lib/rbbt/workflow/step/status.rb +1 -0
- data/share/rbbt_commands/app/start +2 -0
- data/share/rbbt_commands/tsv/view +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec5860171e51e2e53a8383ae8ea1156b79c7f75194d384c5aa2c43efd759e129
|
4
|
+
data.tar.gz: a6ab8a782b3169eae1e475a2029e8a4f0ac2d12f375475ec70de9d97f513f21a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fb6a8ac5abee267891f6bb0736b659f202019de75fa0ecef80e955838a54013eaeabb495c44daff45196a8706821b706bfae75b095ce3ca8b82e8351436d4ef
|
7
|
+
data.tar.gz: ab24e4ab588e75f94adfcd9a02e178511bd4471edadef18c6c49537974353b8b4d83c61438d8fe638acbc26101556637a92d5da325ebc135736da44558971334
|
data/lib/rbbt/tsv/accessor.rb
CHANGED
@@ -389,7 +389,7 @@ module TSV
|
|
389
389
|
when Set
|
390
390
|
traverse_array(obj.to_a, options, &block)
|
391
391
|
when String
|
392
|
-
if Open.remote?(obj)
|
392
|
+
if Open.remote?(obj) || Open.ssh?(obj) || Misc.is_filename?(obj)
|
393
393
|
Open.open(obj) do |s|
|
394
394
|
traverse_obj(s, options, &block)
|
395
395
|
end
|
@@ -135,20 +135,25 @@ def self.add_libdir(dir=nil)
|
|
135
135
|
end
|
136
136
|
|
137
137
|
def self.insist(times = 4, sleep = nil, msg = nil)
|
138
|
-
|
139
|
-
sleep_array = times
|
140
|
-
times = sleep_array.length
|
141
|
-
sleep = sleep_array.shift
|
142
|
-
end
|
143
|
-
try = 0
|
144
|
-
|
145
|
-
if sleep.nil?
|
146
|
-
sleep_array = ([0] + [0.001, 0.01, 0.1, 0.5] * (times / 3)).sort[0..times-1]
|
147
|
-
sleep = sleep_array.shift
|
148
|
-
end
|
138
|
+
sleep_array = nil
|
149
139
|
|
140
|
+
try = 0
|
150
141
|
begin
|
151
|
-
|
142
|
+
begin
|
143
|
+
yield
|
144
|
+
rescue Exception
|
145
|
+
if Array === times
|
146
|
+
sleep_array = times
|
147
|
+
times = sleep_array.length
|
148
|
+
sleep = sleep_array.shift
|
149
|
+
end
|
150
|
+
|
151
|
+
if sleep.nil?
|
152
|
+
sleep_array = ([0] + [0.001, 0.01, 0.1, 0.5] * (times / 3)).sort[0..times-1]
|
153
|
+
sleep = sleep_array.shift
|
154
|
+
end
|
155
|
+
raise $!
|
156
|
+
end
|
152
157
|
rescue TryAgain
|
153
158
|
sleep sleep
|
154
159
|
retry
|
data/lib/rbbt/util/open.rb
CHANGED
@@ -18,7 +18,24 @@ class RemoteWorkflow
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
def self.escape_url(url)
|
22
|
+
base, _sep, query = url.partition("?")
|
23
|
+
protocol, path = base.split("://")
|
24
|
+
path = protocol if path.nil?
|
25
|
+
path = path.split("/").collect{|p| CGI.escape(p) }* "/"
|
26
|
+
base = protocol ? [protocol, path] * "://" : path
|
27
|
+
|
28
|
+
if query && ! query.empty?
|
29
|
+
query = query.split("&").collect{|e| e.split("=").collect{|pe| CGI.escape(pe) } * "=" } * "&"
|
30
|
+
[base, query] * "?"
|
31
|
+
else
|
32
|
+
base
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
21
36
|
def self.encode(url)
|
37
|
+
# ToDo: Check this
|
38
|
+
return escape_url(url)
|
22
39
|
begin
|
23
40
|
URI::DEFAULT_PARSER.escape(url)
|
24
41
|
rescue
|
@@ -135,7 +152,7 @@ class RemoteWorkflow
|
|
135
152
|
|
136
153
|
def self.execute_job(base_url, task, task_params, cache_type)
|
137
154
|
RemoteWorkflow.capture_exception do
|
138
|
-
task_url =
|
155
|
+
task_url = self.escape_url(File.join(base_url, task.to_s))
|
139
156
|
|
140
157
|
sout, sin = Misc.pipe
|
141
158
|
|
@@ -132,7 +132,7 @@ class RemoteStep
|
|
132
132
|
def _run_job(cache_type = :asynchronous)
|
133
133
|
get_streams
|
134
134
|
|
135
|
-
task_url =
|
135
|
+
task_url = RemoteWorkflow::REST.escape_url(File.join(base_url, task.to_s))
|
136
136
|
@adaptor.__prepare_inputs_for_restclient(inputs)
|
137
137
|
task_params = inputs.merge(:_cache_type => cache_type, :jobname => base_name, :_format => [:string, :boolean, :tsv, :annotations].include?(result_type) ? :raw : :json)
|
138
138
|
|
@@ -147,6 +147,7 @@ class RemoteStep
|
|
147
147
|
|
148
148
|
def produce(*args)
|
149
149
|
@started = true
|
150
|
+
init_job
|
150
151
|
_run_job
|
151
152
|
end
|
152
153
|
|
@@ -177,7 +177,7 @@ class Step
|
|
177
177
|
|
178
178
|
Log.debug "Saving job input #{name} (#{type}) into #{path}"
|
179
179
|
|
180
|
-
if value.respond_to?
|
180
|
+
if IO === value && value.respond_to?(:filename) && value.filename
|
181
181
|
Open.write(path, value.filename)
|
182
182
|
elsif IO === value
|
183
183
|
Open.write(path, value)
|
@@ -75,6 +75,7 @@ class Step
|
|
75
75
|
|
76
76
|
def dirty?
|
77
77
|
return true if Open.exists?(pid_file) && ! ( Open.exists?(info_file) || done? )
|
78
|
+
return true if done? && ! (status == :done || status == :noinfo)
|
78
79
|
return false unless done? || status == :done
|
79
80
|
return false unless ENV["RBBT_UPDATE"] == "true"
|
80
81
|
|
@@ -96,6 +96,8 @@ Misc.in_dir(app_dir) do
|
|
96
96
|
system ENV, "env RBBT_LOG=0 passenger start -R '#{config_ru_file}' -p #{options[:Port] || "2887"}"
|
97
97
|
when 'puma_alt'
|
98
98
|
system ENV, "puma '#{config_ru_file}' -p #{options[:Port] || "2887"} -w 3 -t 8:32 --preload"
|
99
|
+
when 'puma_production'
|
100
|
+
CMD.cmd_log("env RBBT_LOG=#{Log.severity.to_s} puma '#{config_ru_file}' -p #{options[:Port] || "2887"} -w 20 -t 10:160 --preload")
|
99
101
|
else
|
100
102
|
options[:config] = config_ru_file
|
101
103
|
options[:threads] = "8:8"
|
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.34.
|
4
|
+
version: 5.34.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|