dynflow 0.6.2 → 0.7.0
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.
- data/README.md +34 -14
- data/doc/images/screenshot.png +0 -0
- data/examples/example_helper.rb +47 -0
- data/examples/orchestrate.rb +58 -22
- data/examples/orchestrate_evented.rb +174 -0
- data/examples/remote_executor.rb +76 -0
- data/lib/dynflow.rb +1 -0
- data/lib/dynflow/action.rb +29 -13
- data/lib/dynflow/action/{cancellable_polling.rb → cancellable.rb} +3 -4
- data/lib/dynflow/action/rescue.rb +59 -0
- data/lib/dynflow/errors.rb +28 -0
- data/lib/dynflow/execution_plan.rb +41 -10
- data/lib/dynflow/execution_plan/steps/abstract.rb +14 -3
- data/lib/dynflow/execution_plan/steps/error.rb +6 -1
- data/lib/dynflow/execution_plan/steps/finalize_step.rb +5 -0
- data/lib/dynflow/execution_plan/steps/run_step.rb +20 -2
- data/lib/dynflow/executors/parallel/core.rb +31 -3
- data/lib/dynflow/version.rb +1 -1
- data/lib/dynflow/web_console.rb +13 -1
- data/lib/dynflow/world.rb +4 -2
- data/test/execution_plan_test.rb +15 -2
- data/test/executor_test.rb +1 -1
- data/test/persistance_adapters_test.rb +1 -1
- data/test/rescue_test.rb +164 -0
- data/test/support/code_workflow_example.rb +5 -4
- data/test/support/rescue_example.rb +73 -0
- data/test/test_helper.rb +6 -3
- data/web/assets/stylesheets/application.css +4 -0
- data/web/views/flow_step.erb +5 -1
- data/web/views/show.erb +3 -1
- metadata +13 -6
- data/examples/generate_work_for_daemon.rb +0 -24
- data/examples/run_daemon.rb +0 -17
- data/examples/web_console.rb +0 -29
data/test/test_helper.rb
CHANGED
@@ -16,6 +16,7 @@ require 'pry'
|
|
16
16
|
|
17
17
|
require 'support/code_workflow_example'
|
18
18
|
require 'support/middleware_example'
|
19
|
+
require 'support/rescue_example'
|
19
20
|
|
20
21
|
class TestExecutionLog
|
21
22
|
|
@@ -111,9 +112,11 @@ module WorldInstance
|
|
111
112
|
@adapter ||= Dynflow::LoggerAdapters::Simple.new $stderr, 4
|
112
113
|
end
|
113
114
|
|
114
|
-
def self.create_world
|
115
|
-
|
116
|
-
|
115
|
+
def self.create_world(options = {})
|
116
|
+
options = { logger_adapter: logger_adapter,
|
117
|
+
auto_terminate: false,
|
118
|
+
auto_rescue: false }.merge(options)
|
119
|
+
Dynflow::SimpleWorld.new(options)
|
117
120
|
end
|
118
121
|
|
119
122
|
def self.create_remote_world(world)
|
data/web/views/flow_step.erb
CHANGED
@@ -11,9 +11,13 @@
|
|
11
11
|
[ <%= duration_to_s(step.real_time) %> / <%= duration_to_s(step.execution_time) %> ]
|
12
12
|
<% end %>
|
13
13
|
</span>
|
14
|
-
<% if @plan.state == :paused && step.
|
14
|
+
<% if @plan.state == :paused && step.skippable? %>
|
15
15
|
<a href="<%= url("/#{@plan.id}/skip/#{step.id}") %>" class="postlink">Skip</a>
|
16
16
|
<% end %>
|
17
|
+
<% if step.cancellable? %>
|
18
|
+
<a href="<%= url("/#{@plan.id}/cancel/#{step.id}") %>" class="postlink">Cancel</a>
|
19
|
+
<% end %>
|
20
|
+
|
17
21
|
<div class="action">
|
18
22
|
<% unless @plan.state == :pending %>
|
19
23
|
<p><b>Started at:</b> <%= h(step.started_at) %></p>
|
data/web/views/show.erb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -218,21 +218,24 @@ files:
|
|
218
218
|
- README.md
|
219
219
|
- Rakefile
|
220
220
|
- doc/images/logo.png
|
221
|
+
- doc/images/screenshot.png
|
221
222
|
- dynflow.gemspec
|
222
|
-
- examples/
|
223
|
+
- examples/example_helper.rb
|
223
224
|
- examples/orchestrate.rb
|
224
|
-
- examples/
|
225
|
-
- examples/
|
225
|
+
- examples/orchestrate_evented.rb
|
226
|
+
- examples/remote_executor.rb
|
226
227
|
- lib/dynflow.rb
|
227
228
|
- lib/dynflow/action.rb
|
228
|
-
- lib/dynflow/action/
|
229
|
+
- lib/dynflow/action/cancellable.rb
|
229
230
|
- lib/dynflow/action/format.rb
|
230
231
|
- lib/dynflow/action/missing.rb
|
231
232
|
- lib/dynflow/action/polling.rb
|
232
233
|
- lib/dynflow/action/progress.rb
|
234
|
+
- lib/dynflow/action/rescue.rb
|
233
235
|
- lib/dynflow/action/suspended.rb
|
234
236
|
- lib/dynflow/clock.rb
|
235
237
|
- lib/dynflow/daemon.rb
|
238
|
+
- lib/dynflow/errors.rb
|
236
239
|
- lib/dynflow/execution_plan.rb
|
237
240
|
- lib/dynflow/execution_plan/dependency_graph.rb
|
238
241
|
- lib/dynflow/execution_plan/output_reference.rb
|
@@ -314,8 +317,10 @@ files:
|
|
314
317
|
- test/middleware_test.rb
|
315
318
|
- test/persistance_adapters_test.rb
|
316
319
|
- test/remote_via_socket_test.rb
|
320
|
+
- test/rescue_test.rb
|
317
321
|
- test/support/code_workflow_example.rb
|
318
322
|
- test/support/middleware_example.rb
|
323
|
+
- test/support/rescue_example.rb
|
319
324
|
- test/test_helper.rb
|
320
325
|
- test/testing_test.rb
|
321
326
|
- test/web_console_test.rb
|
@@ -372,8 +377,10 @@ test_files:
|
|
372
377
|
- test/middleware_test.rb
|
373
378
|
- test/persistance_adapters_test.rb
|
374
379
|
- test/remote_via_socket_test.rb
|
380
|
+
- test/rescue_test.rb
|
375
381
|
- test/support/code_workflow_example.rb
|
376
382
|
- test/support/middleware_example.rb
|
383
|
+
- test/support/rescue_example.rb
|
377
384
|
- test/test_helper.rb
|
378
385
|
- test/testing_test.rb
|
379
386
|
- test/web_console_test.rb
|
@@ -1,24 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
root_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
4
|
-
dynflow_path = File.join(root_path, 'lib')
|
5
|
-
$LOAD_PATH << dynflow_path unless $LOAD_PATH.include? dynflow_path
|
6
|
-
|
7
|
-
require 'dynflow'
|
8
|
-
require 'tmpdir'
|
9
|
-
|
10
|
-
socket_path = File.join(Dir.tmpdir, 'dynflow_socket')
|
11
|
-
persistence_adapter = Dynflow::PersistenceAdapters::Sequel.new ARGV[0] || 'sqlite://db.sqlite'
|
12
|
-
|
13
|
-
world = Dynflow::SimpleWorld.new do |world|
|
14
|
-
{ persistence_adapter: persistence_adapter,
|
15
|
-
executor: Dynflow::Executors::RemoteViaSocket.new(world, socket_path) }
|
16
|
-
end
|
17
|
-
|
18
|
-
load File.join(root_path, 'test', 'code_workflow_example.rb')
|
19
|
-
|
20
|
-
loop do
|
21
|
-
world.trigger Dynflow::CodeWorkflowExample::Slow, 1
|
22
|
-
sleep 0.5
|
23
|
-
p 'tick'
|
24
|
-
end
|
data/examples/run_daemon.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
root_path = File.expand_path(File.join(File.dirname(__FILE__), '..'))
|
4
|
-
dynflow_path = File.join(root_path, 'lib')
|
5
|
-
$LOAD_PATH << dynflow_path unless $LOAD_PATH.include? dynflow_path
|
6
|
-
|
7
|
-
require 'dynflow'
|
8
|
-
require 'tmpdir'
|
9
|
-
|
10
|
-
socket = File.join(Dir.tmpdir, 'dynflow_socket')
|
11
|
-
persistence_adapter = Dynflow::PersistenceAdapters::Sequel.new ARGV[0] || 'sqlite://db.sqlite'
|
12
|
-
world = Dynflow::SimpleWorld.new persistence_adapter: persistence_adapter
|
13
|
-
listener = Dynflow::Listeners::Socket.new world, socket
|
14
|
-
|
15
|
-
load File.join(root_path, 'test', 'code_workflow_example.rb')
|
16
|
-
|
17
|
-
Dynflow::Daemon.new(listener, world).run
|
data/examples/web_console.rb
DELETED
@@ -1,29 +0,0 @@
|
|
1
|
-
# Demo for Dynflow web console
|
2
|
-
# usage: ruby web_console.rb
|
3
|
-
|
4
|
-
$:.unshift(File.expand_path('../../lib', __FILE__))
|
5
|
-
|
6
|
-
require 'dynflow'
|
7
|
-
require_relative 'orchestrate'
|
8
|
-
|
9
|
-
world = Dynflow::SimpleWorld.new
|
10
|
-
|
11
|
-
require 'dynflow/web_console'
|
12
|
-
dynflow_console = Dynflow::WebConsole.setup do
|
13
|
-
set :world, world
|
14
|
-
end
|
15
|
-
|
16
|
-
3.times do
|
17
|
-
Thread.new do
|
18
|
-
3.times do
|
19
|
-
world.trigger(Orchestrate::CreateInfrastructure)
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
puts <<MESSAGE
|
25
|
-
=============================================
|
26
|
-
See the console at http://localhost:4567/
|
27
|
-
=============================================
|
28
|
-
MESSAGE
|
29
|
-
dynflow_console.run!
|