cpee 2.1.61 → 2.1.62

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.
@@ -0,0 +1,84 @@
1
+ # This file is part of CPEE.
2
+ #
3
+ # CPEE is free software: you can redistribute it and/or modify it under the terms
4
+ # of the GNU General Public License as published by the Free Software Foundation,
5
+ # either version 3 of the License, or (at your option) any later version.
6
+ #
7
+ # CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
8
+ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
9
+ # PARTICULAR PURPOSE. See the GNU General Public License for more details.
10
+ #
11
+ # You should have received a copy of the GNU General Public License along with
12
+ # CPEE (file COPYING in the main directory). If not, see
13
+ # <http://www.gnu.org/licenses/>.
14
+
15
+ module CPEE
16
+
17
+ module ExecutionHandler
18
+
19
+ module Rubyext
20
+ BACKEND_INSTANCE = 'instance.rb'
21
+ DSL_TO_DSLX_XSL = File.expand_path(File.join(__dir__,'dsl_to_dslx.xsl'))
22
+ BACKEND_RUN = File.expand_path(File.join(__dir__,'backend','run'))
23
+ BACKEND_OPTS = File.expand_path(File.join(__dir__,'backend','opts.yaml'))
24
+ BACKEND_TEMPLATE = File.expand_path(File.join(__dir__,'backend','instance.template'))
25
+
26
+ def self::dslx_to_dsl(dslx) # transpile
27
+ trans = XML::Smart::open_unprotected(ExecutionHandler::Rubyext::DSL_TO_DSLX_XSL)
28
+ dslx.transform_with(trans).to_s
29
+ end
30
+
31
+ def self::prepare(id,opts) # write result to disk
32
+ Dir.mkdir(File.join(opts[:instances],id.to_s)) rescue nil
33
+ FileUtils.copy(ExecutionHandler::Rubyext::BACKEND_RUN,File.join(opts[:instances],id.to_s))
34
+ dsl = CPEE::Persistence::extract_item(id,opts,'dsl')
35
+ hw = CPEE::Persistence::extract_item(id,opts,'executionhandler')
36
+ endpoints = CPEE::Persistence::extract_list(id,opts,'endpoints')
37
+ dataelements = CPEE::Persistence::extract_list(id,opts,'dataelements')
38
+ positions = CPEE::Persistence::extract_set(id,opts,'positions')
39
+ positions.map! do |k, v|
40
+ [ k, v, CPEE::Persistence::extract_item(id,opts,File.join('positions',k,'@passthrough')) ]
41
+ end
42
+ iopts = YAML::load_file(ExecutionHandler::Rubyext::BACKEND_OPTS)
43
+ pp iopts
44
+ iopts[:host] = opts[:host]
45
+ iopts[:url] = opts[:url]
46
+ iopts[:redis_url] = opts[:redis_url]
47
+ iopts[:redis_path] = File.join(opts[:basepath],opts[:redis_path])
48
+ iopts[:redis_db] = opts[:redis_db]
49
+ iopts[:workers] = opts[:workers]
50
+ iopts[:global_executionhandlers] = opts[:global_executionhandlers]
51
+ iopts[:executionhandlers] = opts[:executionhandlers]
52
+ iopts[:executionhandler] = hw
53
+
54
+ File.open(File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Rubyext::BACKEND_OPTS)),'w') do |f|
55
+ YAML::dump(iopts,f)
56
+ end
57
+ template = ERB.new(File.read(ExecutionHandler::Rubyext::BACKEND_TEMPLATE), trim_mode: '-')
58
+ res = template.result_with_hash(dsl: dsl, dataelements: dataelements, endpoints: endpoints, positions: positions)
59
+ File.write(File.join(opts[:instances],id.to_s,ExecutionHandler::Rubyext::BACKEND_INSTANCE),res)
60
+ end
61
+
62
+ def self::run(id,opts)
63
+ exe = File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Rubyext::BACKEND_RUN))
64
+ pid = Kernel.spawn(exe , :pgroup => true, :in => '/dev/null', :out => exe + '.out', :err => exe + '.err')
65
+ Process.detach pid
66
+ File.write(exe + '.pid',pid)
67
+ end
68
+
69
+ def self::stop(id,opts) ### return: bool to tell if manually changing redis is necessary
70
+ exe = File.join(opts[:instances],id.to_s,File.basename(ExecutionHandler::Rubyext::BACKEND_RUN))
71
+ pid = File.read(exe + '.pid') rescue nil
72
+ if pid && (Process.kill(0, pid.to_i) rescue false)
73
+ Process.kill('HUP', pid.to_i) rescue nil
74
+ false
75
+ else # its not running, so clean up
76
+ File.unlink(exe + '.pid') rescue nil
77
+ true
78
+ end
79
+ end
80
+ end
81
+
82
+ end
83
+
84
+ end
@@ -1 +1 @@
1
- 35964
1
+ 1814250
@@ -1 +1 @@
1
- 35982
1
+ 1814272
@@ -1 +1 @@
1
- 35976
1
+ 1814263
@@ -1 +1 @@
1
- 35970
1
+ 1814257
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cpee
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.61
4
+ version: 2.1.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juergen eTM Mangler
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: tools
12
12
  cert_chain: []
13
- date: 2024-07-16 00:00:00.000000000 Z
13
+ date: 2024-09-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: riddl
@@ -35,7 +35,7 @@ dependencies:
35
35
  version: '1.99'
36
36
  - - ">="
37
37
  - !ruby/object:Gem::Version
38
- version: 1.99.111
38
+ version: 1.99.121
39
39
  type: :runtime
40
40
  prerelease: false
41
41
  version_requirements: !ruby/object:Gem::Requirement
@@ -45,7 +45,7 @@ dependencies:
45
45
  version: '1.99'
46
46
  - - ">="
47
47
  - !ruby/object:Gem::Version
48
- version: 1.99.111
48
+ version: 1.99.121
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: highline
51
51
  requirement: !ruby/object:Gem::Requirement
@@ -144,6 +144,34 @@ dependencies:
144
144
  - - "~>"
145
145
  - !ruby/object:Gem::Version
146
146
  version: '1.7'
147
+ - !ruby/object:Gem::Dependency
148
+ name: rbtrace
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '0.4'
154
+ type: :runtime
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '0.4'
161
+ - !ruby/object:Gem::Dependency
162
+ name: cpee-eval-ruby
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '1.0'
168
+ type: :runtime
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: '1.0'
147
175
  description: see http://cpee.org
148
176
  email: juergen.mangler@gmail.com
149
177
  executables:
@@ -810,6 +838,14 @@ files:
810
838
  - server/executionhandlers/ruby/controller.rb
811
839
  - server/executionhandlers/ruby/dsl_to_dslx.xsl
812
840
  - server/executionhandlers/ruby/execution.rb
841
+ - server/executionhandlers/rubyext/backend/README.md
842
+ - server/executionhandlers/rubyext/backend/instance.template
843
+ - server/executionhandlers/rubyext/backend/opts.yaml
844
+ - server/executionhandlers/rubyext/backend/run
845
+ - server/executionhandlers/rubyext/connection.rb
846
+ - server/executionhandlers/rubyext/controller.rb
847
+ - server/executionhandlers/rubyext/dsl_to_dslx.xsl
848
+ - server/executionhandlers/rubyext/execution.rb
813
849
  - server/executionhandlers/rust/backend/README.md
814
850
  - server/executionhandlers/rust/backend/compile.sh
815
851
  - server/executionhandlers/rust/backend/opts.yaml
@@ -855,7 +891,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
855
891
  - !ruby/object:Gem::Version
856
892
  version: '0'
857
893
  requirements: []
858
- rubygems_version: 3.5.9
894
+ rubygems_version: 3.5.11
859
895
  signing_key:
860
896
  specification_version: 4
861
897
  summary: The cloud process execution engine (cpee.org). If you just need workflow