cpee 2.1.12 → 2.1.13
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 +4 -4
- data/cpee.gemspec +1 -1
- data/lib/cpee/implementation.rb +1 -1
- data/lib/cpee/implementation_notifications.rb +1 -1
- data/lib/cpee/redis.rb +8 -7
- data/server/executionhandlers/ruby/controller.rb +3 -3
- data/server/routing/end.rb +2 -2
- data/server/routing/forward-events.rb +2 -2
- data/server/routing/forward-votes.rb +2 -2
- data/server/routing/persist.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a36325365a950ed863e1d8f225d3d9c0fe955c03d9e8d54ef5a3b92366bffeea
|
4
|
+
data.tar.gz: 2579cb64ec6d53369b89f9ae2bd296422d5a9aafb527cfe4d7b4397702e15571
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 198bfa6332b16087dd108170166e4d91b92e82bb51e9853d72ad1fd2e152a3a5bee856c138a91598f63881a49897dbfed16fa4193732e1d55f7a5484476aa6fd
|
7
|
+
data.tar.gz: a068a5abf6abb788b8759ced41339db138b4775d0ca2c1be4f89e1d191205379632c8c36069b799f6475f04f57b53aac2f646aad8265e2ab6182733200780535
|
data/cpee.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cpee"
|
3
|
-
s.version = "2.1.
|
3
|
+
s.version = "2.1.13"
|
4
4
|
s.platform = Gem::Platform::RUBY
|
5
5
|
s.license = "LGPL-3.0"
|
6
6
|
s.summary = "Preliminary release of cloud process execution engine (cpee.org). If you just need workflow execution, without a rest service exposing it, then use WEEL."
|
data/lib/cpee/implementation.rb
CHANGED
@@ -77,7 +77,7 @@ module CPEE
|
|
77
77
|
opts[:redis_pid] ||= 'redis.pid' # use e.g. /var/run/redis.pid if you do global. Look it up in your redis config
|
78
78
|
opts[:redis_db_name] ||= 'redis.rdb' # use e.g. /var/lib/redis.rdb for global stuff. Look it up in your redis config
|
79
79
|
|
80
|
-
CPEE::redis_connect opts
|
80
|
+
CPEE::redis_connect opts, 'Server Main'
|
81
81
|
|
82
82
|
opts[:sse_keepalive_frequency] ||= 10
|
83
83
|
opts[:sse_connections] = {}
|
@@ -179,7 +179,7 @@ module CPEE
|
|
179
179
|
end #}}}
|
180
180
|
|
181
181
|
def self::sse_distributor(opts) #{{{
|
182
|
-
conn = opts[:redis_dyn].call
|
182
|
+
conn = opts[:redis_dyn].call "Server SSE"
|
183
183
|
conn.psubscribe('forward:*','event:state/change') do |on|
|
184
184
|
on.pmessage do |pat, what, message|
|
185
185
|
if pat == 'forward:*'
|
data/lib/cpee/redis.rb
CHANGED
@@ -15,29 +15,30 @@
|
|
15
15
|
require 'redis'
|
16
16
|
|
17
17
|
module CPEE
|
18
|
-
def self::redis_connect(opts)
|
18
|
+
def self::redis_connect(opts,name=nil)
|
19
19
|
if opts[:redis_cmd].nil?
|
20
20
|
begin
|
21
21
|
if opts[:redis_path]
|
22
|
-
opts[:redis_dyn] = Proc.new { Redis.new(path: opts[:redis_path], db: opts[:redis_db]) }
|
22
|
+
opts[:redis_dyn] = Proc.new { |name| Redis.new(path: opts[:redis_path], db: opts[:redis_db], id: name.gsub(/[^a-zA-Z0-9]/,'-') ) }
|
23
23
|
elsif opts[:redis_url]
|
24
|
-
opts[:redis_dyn] = Proc.new { Redis.new(url: opts[:redis_url], db: opts[:redis_db]) }
|
24
|
+
opts[:redis_dyn] = Proc.new { |name| Redis.new(url: opts[:redis_url], db: opts[:redis_db], id: name.gsub(/[^a-zA-Z0-9]/,'-') ) }
|
25
25
|
else
|
26
26
|
raise
|
27
27
|
end
|
28
|
-
opts[:redis] = opts[:redis_dyn].call
|
28
|
+
opts[:redis] = opts[:redis_dyn].call name.gsub(/[^a-zA-Z0-9]/,'-')
|
29
29
|
opts[:redis].dbsize
|
30
30
|
rescue
|
31
31
|
puts 'can not connect to redis. check if it is running and cpee is configured correctly ...'
|
32
32
|
exit
|
33
33
|
end
|
34
34
|
else # we always assume file socket if redis is startet locally
|
35
|
-
opts[:redis_dyn] = Proc.new { Redis.new(path: File.join(opts[:basepath],opts[:redis_path]), db: opts[:redis_db].to_i) }
|
35
|
+
opts[:redis_dyn] = Proc.new { |name| Redis.new(path: File.join(opts[:basepath],opts[:redis_path]), db: opts[:redis_db].to_i, id: name.gsub(/[^a-zA-Z0-9]/,'-') ) }
|
36
36
|
tried = false
|
37
37
|
begin
|
38
|
-
opts[:redis] = opts[:redis_dyn].call
|
38
|
+
opts[:redis] = opts[:redis_dyn].call name.gsub(/[^a-zA-Z0-9]/,'-')
|
39
39
|
opts[:redis].dbsize
|
40
|
-
rescue
|
40
|
+
rescue => e
|
41
|
+
puts e
|
41
42
|
res = unless tried
|
42
43
|
rcmd = opts[:redis_cmd]
|
43
44
|
rcmd.gsub! /#redis_path#/, File.join(opts[:basepath],opts[:redis_path])
|
@@ -33,7 +33,7 @@ def ⭐(a); ParaStruct.new(a); end
|
|
33
33
|
|
34
34
|
class Controller
|
35
35
|
def initialize(id,dir,opts)
|
36
|
-
CPEE::redis_connect(opts)
|
36
|
+
CPEE::redis_connect(opts,"Instance #{id}")
|
37
37
|
|
38
38
|
@redis = opts[:redis]
|
39
39
|
@votes = []
|
@@ -52,7 +52,7 @@ class Controller
|
|
52
52
|
@loop_guard = {}
|
53
53
|
|
54
54
|
@callback_keys = {}
|
55
|
-
@psredis = @opts[:redis_dyn].call
|
55
|
+
@psredis = @opts[:redis_dyn].call "Instance #{@id} Callback Response"
|
56
56
|
|
57
57
|
Thread.new do
|
58
58
|
@psredis.psubscribe('callback-response:*','callback-end:*') do |on|
|
@@ -163,7 +163,7 @@ class Controller
|
|
163
163
|
|
164
164
|
if votes.length > 0
|
165
165
|
@votes += votes
|
166
|
-
psredis = @opts[:redis_dyn].call
|
166
|
+
psredis = @opts[:redis_dyn].call "Instance #{@id} Vote"
|
167
167
|
collect = []
|
168
168
|
psredis.subscribe(votes.map{|e| ['vote-response:' + e.to_s] }.flatten) do |on|
|
169
169
|
on.message do |what, message|
|
data/server/routing/end.rb
CHANGED
@@ -30,8 +30,8 @@ Daemonite.new do |opts|
|
|
30
30
|
opts[:redis_path] ||= '/tmp/redis.sock'
|
31
31
|
opts[:redis_db] ||= 1
|
32
32
|
|
33
|
-
CPEE::redis_connect opts
|
34
|
-
opts[:pubsubredis] = opts[:redis_dyn].call
|
33
|
+
CPEE::redis_connect opts, 'Server Routing End'
|
34
|
+
opts[:pubsubredis] = opts[:redis_dyn].call 'Server Routing End Sub'
|
35
35
|
end
|
36
36
|
|
37
37
|
run do
|
@@ -30,8 +30,8 @@ Daemonite.new do |opts|
|
|
30
30
|
opts[:redis_path] ||= '/tmp/redis.sock'
|
31
31
|
opts[:redis_db] ||= 1
|
32
32
|
|
33
|
-
CPEE::redis_connect opts
|
34
|
-
opts[:pubsubredis] = opts[:redis_dyn].call
|
33
|
+
CPEE::redis_connect opts, 'Server Routing Forward Events'
|
34
|
+
opts[:pubsubredis] = opts[:redis_dyn].call 'Server Routing Forward Events Sub'
|
35
35
|
end
|
36
36
|
|
37
37
|
run do
|
@@ -56,8 +56,8 @@ Daemonite.new do |opts|
|
|
56
56
|
opts[:redis_path] ||= '/tmp/redis.sock'
|
57
57
|
opts[:redis_db] ||= 1
|
58
58
|
|
59
|
-
CPEE::redis_connect opts
|
60
|
-
opts[:pubsubredis] = opts[:redis_dyn].call
|
59
|
+
CPEE::redis_connect opts, 'Server Routing Forward Votes'
|
60
|
+
opts[:pubsubredis] = opts[:redis_dyn].call 'Server Routing Forward Votes Sub'
|
61
61
|
end
|
62
62
|
|
63
63
|
run do
|
data/server/routing/persist.rb
CHANGED
@@ -45,8 +45,8 @@ Daemonite.new do |opts|
|
|
45
45
|
opts[:redis_path] ||= '/tmp/redis.sock'
|
46
46
|
opts[:redis_db] ||= 1
|
47
47
|
|
48
|
-
CPEE::redis_connect opts
|
49
|
-
opts[:pubsubredis] = opts[:redis_dyn].call
|
48
|
+
CPEE::redis_connect opts, 'Server Routing Persist'
|
49
|
+
opts[:pubsubredis] = opts[:redis_dyn].call 'Server Routing Persist Sub'
|
50
50
|
end
|
51
51
|
|
52
52
|
run do
|