tengine_job 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/Gemfile.lock +78 -48
- data/bin/tengine_job +71 -0
- data/examples/0004_retry_one_layer.rb +10 -7
- data/examples/0027_parallel_ssh_job +9 -0
- data/examples/0027_parallel_ssh_jobs.rb +14 -0
- data/lib/tengine/job.rb +19 -49
- data/lib/tengine/job/dsl.rb +13 -0
- data/lib/tengine/job/{dsl_binder.rb → dsl/binder.rb} +4 -4
- data/lib/tengine/job/{dsl_evaluator.rb → dsl/evaluator.rb} +2 -2
- data/lib/tengine/job/{dsl_loader.rb → dsl/loader.rb} +20 -22
- data/lib/tengine/job/runtime.rb +32 -0
- data/lib/tengine/job/{drivers → runtime/drivers}/job_control_driver.rb +46 -92
- data/lib/tengine/job/{drivers → runtime/drivers}/job_execution_driver.rb +14 -10
- data/lib/tengine/job/runtime/drivers/jobnet_control_driver.rb +240 -0
- data/lib/tengine/job/{drivers → runtime/drivers}/schedule_driver.rb +4 -4
- data/lib/tengine/job/{edge.rb → runtime/edge.rb} +79 -25
- data/lib/tengine/job/{executable.rb → runtime/executable.rb} +35 -15
- data/lib/tengine/job/{execution.rb → runtime/execution.rb} +19 -11
- data/lib/tengine/job/runtime/job_base.rb +5 -0
- data/lib/tengine/job/runtime/jobnet.rb +283 -0
- data/lib/tengine/job/runtime/junction.rb +44 -0
- data/lib/tengine/job/runtime/named_vertex.rb +95 -0
- data/lib/tengine/job/runtime/root_jobnet.rb +81 -0
- data/lib/tengine/job/{signal.rb → runtime/signal.rb} +99 -13
- data/lib/tengine/job/runtime/ssh_job.rb +486 -0
- data/lib/tengine/job/{jobnet → runtime}/state_transition.rb +6 -4
- data/lib/tengine/job/runtime/stoppable.rb +64 -0
- data/lib/tengine/job/runtime/vertex.rb +50 -0
- data/lib/tengine/job/structure.rb +20 -0
- data/lib/tengine/job/{category.rb → structure/category.rb} +9 -5
- data/lib/tengine/job/{jobnet/builder.rb → structure/edge_builder.rb} +11 -7
- data/lib/tengine/job/{element_selector_notation.rb → structure/element_selector_notation.rb} +15 -11
- data/lib/tengine/job/structure/jobnet_builder.rb +83 -0
- data/lib/tengine/job/structure/jobnet_finder.rb +60 -0
- data/lib/tengine/job/{name_path.rb → structure/name_path.rb} +2 -2
- data/lib/tengine/job/structure/tree.rb +20 -0
- data/lib/tengine/job/structure/visitor.rb +67 -0
- data/lib/tengine/job/template.rb +24 -0
- data/lib/tengine/job/template/edge.rb +37 -0
- data/lib/tengine/job/template/expansion.rb +24 -0
- data/lib/tengine/job/template/generator.rb +111 -0
- data/lib/tengine/job/template/jobnet.rb +83 -0
- data/lib/tengine/job/template/junction.rb +14 -0
- data/lib/tengine/job/{job.rb → template/named_vertex.rb} +3 -5
- data/lib/tengine/job/{root_jobnet_template.rb → template/root_jobnet.rb} +12 -26
- data/lib/tengine/job/template/ssh_job.rb +80 -0
- data/lib/tengine/job/template/vertex.rb +97 -0
- metadata +127 -93
- data/lib/tengine/job/connectable.rb +0 -43
- data/lib/tengine/job/drivers/jobnet_control_driver.rb +0 -249
- data/lib/tengine/job/end.rb +0 -32
- data/lib/tengine/job/expansion.rb +0 -37
- data/lib/tengine/job/fork.rb +0 -6
- data/lib/tengine/job/jobnet.rb +0 -184
- data/lib/tengine/job/jobnet/job_state_transition.rb +0 -167
- data/lib/tengine/job/jobnet/jobnet_state_transition.rb +0 -110
- data/lib/tengine/job/jobnet_actual.rb +0 -84
- data/lib/tengine/job/jobnet_template.rb +0 -10
- data/lib/tengine/job/join.rb +0 -6
- data/lib/tengine/job/junction.rb +0 -29
- data/lib/tengine/job/killing.rb +0 -30
- data/lib/tengine/job/mm_compatibility.rb +0 -6
- data/lib/tengine/job/mm_compatibility/connectable.rb +0 -13
- data/lib/tengine/job/root.rb +0 -16
- data/lib/tengine/job/root_jobnet_actual.rb +0 -58
- data/lib/tengine/job/script_executable.rb +0 -235
- data/lib/tengine/job/start.rb +0 -20
- data/lib/tengine/job/stoppable.rb +0 -15
- data/lib/tengine/job/vertex.rb +0 -181
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OGIwMDc3MjQxYzUzMjdiYmEzMmMxMzViZTY4MmI2MmRhNWE2NWRmZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTJlZmE4NjFkNTViMWQ1YmJiYWMwY2NkNjAxMzIxMjRlMTQxYThiMw==
|
7
|
+
!binary "U0hBNTEy":
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MDM2ZGI3ZjJkMDBhMzFkYzQwNGVkZTgzYjgyMTJkNjgzYzY2NDQxN2I4MTZj
|
10
|
+
MGNiMzYzNTk4ZDEzYTE1ODgzZDBkM2I4OGU0NDU5YzQ4NzY2MjU4OTYzMDkw
|
11
|
+
YjM4ZjY0MWM5OTg5MWM4ZmM0YWUwY2E0NTEyYTE2YTFhY2Y3NTc=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MjQ5MDA3NjM0Zjg3ZDZkMzBhZDFkZmZkMmYyYjc1M2U1OGU3MmFkNjY2YjI4
|
14
|
+
MmRkYTdiZmQ4N2UzOTJiNTE0YzZlY2FhMjA3ZGQ5MzJmY2I0NzU1M2M0YmI4
|
15
|
+
YmQ4ZTlhYTNiNGMyNjgwMzA0NTI4N2Q5MmYzMmRjNGI5YmRmOTA=
|
data/Gemfile.lock
CHANGED
@@ -1,51 +1,69 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
tengine_job (1.
|
5
|
-
tengine_core (~> 1.
|
6
|
-
tengine_resource (~> 1.
|
7
|
-
tengine_support (~> 1.
|
4
|
+
tengine_job (1.2.0)
|
5
|
+
tengine_core (~> 1.2.0)
|
6
|
+
tengine_resource (~> 1.2.0)
|
7
|
+
tengine_support (~> 1.2.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: http://rubygems.org/
|
11
11
|
specs:
|
12
|
-
ZenTest (4.
|
13
|
-
activemodel (3.2.
|
14
|
-
activesupport (= 3.2.
|
12
|
+
ZenTest (4.9.1)
|
13
|
+
activemodel (3.2.13)
|
14
|
+
activesupport (= 3.2.13)
|
15
15
|
builder (~> 3.0.0)
|
16
|
-
activesupport (3.2.
|
17
|
-
i18n (
|
16
|
+
activesupport (3.2.13)
|
17
|
+
i18n (= 0.6.1)
|
18
18
|
multi_json (~> 1.0)
|
19
|
-
amq-client (0.
|
20
|
-
amq-protocol (>=
|
19
|
+
amq-client (0.9.12)
|
20
|
+
amq-protocol (>= 1.2.0)
|
21
21
|
eventmachine
|
22
|
-
amq-protocol (
|
23
|
-
amqp (0.
|
24
|
-
amq-client (~> 0.
|
25
|
-
amq-protocol (~>
|
22
|
+
amq-protocol (1.2.0)
|
23
|
+
amqp (0.9.10)
|
24
|
+
amq-client (~> 0.9.12)
|
25
|
+
amq-protocol (~> 1.2.0)
|
26
26
|
eventmachine
|
27
27
|
autotest (4.4.6)
|
28
28
|
ZenTest (>= 4.4.1)
|
29
29
|
builder (3.0.4)
|
30
|
+
coderay (1.0.9)
|
31
|
+
columnize (0.3.6)
|
30
32
|
daemons (1.1.9)
|
33
|
+
debugger (1.5.0)
|
34
|
+
columnize (>= 0.3.1)
|
35
|
+
debugger-linecache (~> 1.2.0)
|
36
|
+
debugger-ruby_core_source (~> 1.2.0)
|
37
|
+
debugger-linecache (1.2.0)
|
38
|
+
debugger-ruby_core_source (1.2.0)
|
31
39
|
diff-lcs (1.1.3)
|
32
|
-
eventmachine (1.0.
|
40
|
+
eventmachine (1.0.3)
|
33
41
|
factory_girl (3.3.0)
|
34
42
|
activesupport (>= 3.0.0)
|
35
43
|
i18n (0.6.1)
|
36
44
|
macaddr (1.6.1)
|
37
45
|
systemu (~> 2.5.0)
|
38
|
-
|
39
|
-
|
40
|
-
|
46
|
+
method_source (0.8.1)
|
47
|
+
mongoid (3.1.3)
|
48
|
+
activemodel (~> 3.2)
|
49
|
+
moped (~> 1.4.2)
|
41
50
|
origin (~> 1.0)
|
42
51
|
tzinfo (~> 0.3.22)
|
43
|
-
moped (1.
|
44
|
-
multi_json (1.
|
52
|
+
moped (1.4.5)
|
53
|
+
multi_json (1.7.2)
|
45
54
|
net-ssh (2.5.2)
|
46
|
-
origin (1.0
|
47
|
-
|
48
|
-
|
55
|
+
origin (1.1.0)
|
56
|
+
pry (0.9.12.1)
|
57
|
+
coderay (~> 1.0.5)
|
58
|
+
method_source (~> 0.8)
|
59
|
+
slop (~> 3.4)
|
60
|
+
pry-debugger (0.2.2)
|
61
|
+
debugger (~> 1.3)
|
62
|
+
pry (~> 0.9.10)
|
63
|
+
pry-doc (0.4.5)
|
64
|
+
pry (>= 0.9)
|
65
|
+
yard (>= 0.8)
|
66
|
+
rake (10.0.4)
|
49
67
|
right_aws (2.1.0)
|
50
68
|
right_http_connection (>= 1.2.5)
|
51
69
|
right_http_connection (1.3.0)
|
@@ -59,49 +77,61 @@ GEM
|
|
59
77
|
rspec-mocks (2.10.1)
|
60
78
|
selectable_attr (0.3.17)
|
61
79
|
i18n
|
62
|
-
simplecov (0.
|
80
|
+
simplecov (0.7.1)
|
63
81
|
multi_json (~> 1.0)
|
64
|
-
simplecov-html (~> 0.
|
65
|
-
simplecov-html (0.
|
82
|
+
simplecov-html (~> 0.7.1)
|
83
|
+
simplecov-html (0.7.1)
|
84
|
+
slop (3.4.4)
|
66
85
|
systemu (2.5.2)
|
67
|
-
tengine_core (1.
|
86
|
+
tengine_core (1.2.0)
|
68
87
|
activemodel (>= 3.1.0)
|
69
88
|
activesupport (>= 3.1.0)
|
70
89
|
daemons (~> 1.1.4)
|
71
|
-
mongoid (
|
90
|
+
mongoid (>= 3.0.22)
|
72
91
|
selectable_attr (~> 0.3.15)
|
73
|
-
tengine_event (~> 1.
|
74
|
-
tengine_support (~> 1.
|
75
|
-
tengine_event (1.
|
92
|
+
tengine_event (~> 1.2.0)
|
93
|
+
tengine_support (~> 1.2.0)
|
94
|
+
tengine_event (1.2.0)
|
76
95
|
activesupport (>= 3.0.0)
|
77
|
-
amqp (~> 0.
|
78
|
-
tengine_support (~> 1.
|
96
|
+
amqp (~> 0.9.10)
|
97
|
+
tengine_support (~> 1.2.0)
|
79
98
|
uuid (~> 2.3.4)
|
80
|
-
|
99
|
+
tengine_job_agent (1.2.0)
|
100
|
+
tengine_event (~> 1.2.0)
|
101
|
+
tengine_support (~> 1.2.0)
|
102
|
+
tengine_resource (1.2.0)
|
81
103
|
net-ssh (~> 2.5.2)
|
82
|
-
tengine_core (~> 1.
|
83
|
-
tengine_support (~> 1.
|
84
|
-
|
104
|
+
tengine_core (~> 1.2.0)
|
105
|
+
tengine_support (~> 1.2.0)
|
106
|
+
text-table (~> 1.2.2)
|
107
|
+
thor (>= 0.14.6)
|
108
|
+
tengine_resource_ec2 (1.2.0)
|
85
109
|
right_aws (~> 2.1.0)
|
86
|
-
tengine_resource (~> 1.
|
87
|
-
tengine_support (1.
|
110
|
+
tengine_resource (~> 1.2.0)
|
111
|
+
tengine_support (1.2.0)
|
88
112
|
activesupport (>= 3.0.0)
|
89
|
-
|
90
|
-
|
113
|
+
text-table (1.2.3)
|
114
|
+
thor (0.18.1)
|
115
|
+
tzinfo (0.3.37)
|
116
|
+
uuid (2.3.7)
|
91
117
|
macaddr (~> 1.0)
|
92
|
-
yard (0.8.
|
118
|
+
yard (0.8.6.1)
|
93
119
|
|
94
120
|
PLATFORMS
|
95
121
|
ruby
|
96
122
|
|
97
123
|
DEPENDENCIES
|
124
|
+
ZenTest (~> 4.9.0)
|
98
125
|
autotest
|
99
126
|
bundler
|
100
127
|
factory_girl (~> 3.3.0)
|
101
|
-
|
102
|
-
|
128
|
+
pry
|
129
|
+
pry-debugger
|
130
|
+
pry-doc
|
131
|
+
rake
|
103
132
|
rspec (~> 2.10.0)
|
104
|
-
simplecov
|
133
|
+
simplecov
|
105
134
|
tengine_job!
|
106
|
-
|
107
|
-
|
135
|
+
tengine_job_agent (~> 1.2.0)
|
136
|
+
tengine_resource_ec2 (~> 1.2.0)
|
137
|
+
yard
|
data/bin/tengine_job
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
|
4
|
+
$LOAD_PATH << File.expand_path('../lib', File.dirname(__FILE__))
|
5
|
+
|
6
|
+
require 'thor'
|
7
|
+
require 'tengine_job'
|
8
|
+
|
9
|
+
class TengineJob < Thor
|
10
|
+
|
11
|
+
private
|
12
|
+
def setup
|
13
|
+
config = Tengine::Core::Config::Core.new.tap do |c|
|
14
|
+
if path = (options[:config] || options["config"])
|
15
|
+
c.load_file(path)
|
16
|
+
else
|
17
|
+
c.load({:db => Tengine::Core::Config::DB::DEFAULT_SETTINGS})
|
18
|
+
end
|
19
|
+
end
|
20
|
+
require 'mongoid'
|
21
|
+
Mongoid.configure do |c|
|
22
|
+
c.send :load_configuration, config[:db]
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
public
|
27
|
+
desc "list", "list RootJobnetTemplate names"
|
28
|
+
method_option :config, type: :string, aliases: '-f', :desc => "config to connect MongoDB and RabbitmQ as same as tengined's config"
|
29
|
+
def list
|
30
|
+
setup
|
31
|
+
require 'text-table'
|
32
|
+
res = [%w[name type category server credential created_at updated_at]]
|
33
|
+
Tengine::Job::Template::RootJobnet.all.order_by({name: 1}).each do |t|
|
34
|
+
res << [
|
35
|
+
t.name,
|
36
|
+
t.jobnet_type_name,
|
37
|
+
t.category ? t.category.name : nil,
|
38
|
+
t.server_name,
|
39
|
+
t.credential_name,
|
40
|
+
t.created_at.iso8601,
|
41
|
+
t.updated_at.iso8601,
|
42
|
+
]
|
43
|
+
end
|
44
|
+
$stdout.puts res.to_table(:first_row_is_head => true)
|
45
|
+
res
|
46
|
+
end
|
47
|
+
|
48
|
+
desc "kick [RootJobnetTemplate name]", "start job"
|
49
|
+
method_option :config, type: :string, aliases: '-f', :desc => "config to connect MongoDB and RabbitmQ as same as tengined's config"
|
50
|
+
def kick(name, *args)
|
51
|
+
setup
|
52
|
+
EM.run {
|
53
|
+
t = Tengine::Job::Template::RootJobnet.where(name: name).first
|
54
|
+
r = t.generate.execute
|
55
|
+
$stdout.puts "#{name} was executed successfully.\n#{r.inspect}"
|
56
|
+
}
|
57
|
+
end
|
58
|
+
|
59
|
+
desc "remove [RootJobnetTemplate name]", "remove job"
|
60
|
+
method_option :config, type: :string, aliases: '-f', :desc => "config to connect MongoDB and RabbitmQ as same as tengined's config"
|
61
|
+
def remove(name, *args)
|
62
|
+
setup
|
63
|
+
t = Tengine::Job::Template::RootJobnet.where(name: name).first
|
64
|
+
t.destroy
|
65
|
+
$stdout.puts "#{name} was removed successfully."
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|
70
|
+
|
71
|
+
TengineJob.start
|
@@ -11,14 +11,17 @@ require 'tengine_job'
|
|
11
11
|
# { }
|
12
12
|
# {[S2]-->[jn0004_f]-->[E2]}
|
13
13
|
# {________________________}
|
14
|
-
#
|
15
|
-
|
14
|
+
#
|
15
|
+
|
16
|
+
base_dir = File.expand_path("..", __FILE__)
|
17
|
+
|
18
|
+
jobnet("jn0004", :server_name => "localhost", :credential_name => "ssh_pk") do
|
16
19
|
boot_jobs("j1")
|
17
|
-
job("j1", "
|
18
|
-
job("j2", "
|
19
|
-
job("j3", "
|
20
|
-
job("j4", "
|
20
|
+
job("j1", "#{base_dir}/0004_retry_one_layer.sh", :to => ["j2", "j3"])
|
21
|
+
job("j2", "#{base_dir}/0004_retry_one_layer.sh", :to => "j4")
|
22
|
+
job("j3", "#{base_dir}/0004_retry_one_layer.sh", :to => "j4")
|
23
|
+
job("j4", "#{base_dir}/0004_retry_one_layer.sh")
|
21
24
|
finally do
|
22
|
-
job("jn0004_f", "
|
25
|
+
job("jn0004_f", "#{base_dir}/0004_retry_one_layer.sh")
|
23
26
|
end
|
24
27
|
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'tengine_job'
|
2
|
+
|
3
|
+
jobnet("rjn0027", job_method: :ssh_job, server_name: "localhost", credential_name: "ssh_pk") do
|
4
|
+
names = (1..20).map{|i| "j%03d" % i }
|
5
|
+
|
6
|
+
boot_jobs(*names)
|
7
|
+
|
8
|
+
filepath = __FILE__.sub(/jobs\.rb/, 'job')
|
9
|
+
|
10
|
+
names.each do |name|
|
11
|
+
job(name, "#{filepath} #{Process.pid} #{name}")
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/lib/tengine/job.rb
CHANGED
@@ -4,56 +4,24 @@ require 'tengine_job'
|
|
4
4
|
require 'active_support/concern'
|
5
5
|
|
6
6
|
module Tengine::Job
|
7
|
-
autoload :
|
8
|
-
autoload :
|
9
|
-
autoload :
|
10
|
-
|
11
|
-
autoload :Signal , 'tengine/job/signal'
|
12
|
-
|
13
|
-
autoload :Execution , "tengine/job/execution"
|
14
|
-
|
15
|
-
autoload :Category , "tengine/job/category"
|
16
|
-
autoload :Edge , "tengine/job/edge"
|
17
|
-
autoload :Vertex , "tengine/job/vertex"
|
18
|
-
|
19
|
-
autoload :Start , "tengine/job/start"
|
20
|
-
autoload :End , "tengine/job/end"
|
21
|
-
autoload :Junction , "tengine/job/junction"
|
22
|
-
autoload :Fork , "tengine/job/fork"
|
23
|
-
autoload :Join , "tengine/job/join"
|
24
|
-
|
25
|
-
autoload :Job , "tengine/job/job"
|
26
|
-
|
27
|
-
autoload :Jobnet , "tengine/job/jobnet"
|
28
|
-
autoload :JobnetActual , "tengine/job/jobnet_actual"
|
29
|
-
autoload :RootJobnetActual , "tengine/job/root_jobnet_actual"
|
30
|
-
autoload :JobnetTemplate , "tengine/job/jobnet_template"
|
31
|
-
autoload :RootJobnetTemplate , "tengine/job/root_jobnet_template"
|
32
|
-
|
33
|
-
autoload :Expansion , "tengine/job/expansion"
|
34
|
-
|
35
|
-
autoload :Root , "tengine/job/root"
|
36
|
-
autoload :NamePath , "tengine/job/name_path"
|
37
|
-
autoload :Executable , "tengine/job/executable"
|
38
|
-
autoload :Stoppable , "tengine/job/stoppable"
|
39
|
-
autoload :Killing , "tengine/job/killing"
|
40
|
-
autoload :Connectable , "tengine/job/connectable"
|
41
|
-
autoload :ScriptExecutable , "tengine/job/script_executable"
|
42
|
-
|
43
|
-
autoload :MmCompatibility , "tengine/job/mm_compatibility"
|
44
|
-
autoload :ElementSelectorNotation, "tengine/job/element_selector_notation"
|
7
|
+
autoload :Structure, "tengine/job/structure"
|
8
|
+
autoload :Template , "tengine/job/template"
|
9
|
+
autoload :Runtime , "tengine/job/runtime"
|
10
|
+
autoload :Dsl , "tengine/job/dsl"
|
45
11
|
|
46
12
|
class << self
|
47
13
|
# tengine_coreからそのプラグインへ通知を受けるための
|
48
14
|
def notify(sender, msg)
|
49
|
-
Tengine::Core.stdout_logger.
|
50
|
-
|
51
|
-
Tengine::Core.stdout_logger.
|
15
|
+
Tengine::Core.stdout_logger.debug("*" * 100)
|
16
|
+
Dir[File.expand_path("job/runtime/drivers/*.rb", File.dirname(__FILE__))].each do |f|
|
17
|
+
Tengine::Core.stdout_logger.debug("#{self.name}.notify #{f}")
|
52
18
|
end
|
53
19
|
# if (msg == :before___evaluate__) # だと、最初にtengine/jobがrequireされる前に実行されるのでフックできません
|
20
|
+
|
21
|
+
Tengine::Core::Driveable.module_eval{ include Tengine::Job::Dsl::Binder }
|
22
|
+
|
54
23
|
if (msg == :after___evaluate__)
|
55
|
-
|
56
|
-
Dir[File.expand_path("job/drivers/*.rb", File.dirname(__FILE__))].each do |f|
|
24
|
+
Dir[File.expand_path("job/runtime/drivers/*.rb", File.dirname(__FILE__))].each do |f|
|
57
25
|
# Tengine::Core.stdout_logger.debug("#{self.name} now evaluating #{f}")
|
58
26
|
# sender.instance_eval(File.read(f), f)
|
59
27
|
load(f)
|
@@ -61,10 +29,17 @@ Tengine::Core.stdout_logger.info("#{self.name}.notify #{f}")
|
|
61
29
|
end
|
62
30
|
if (msg == :after_load_dsl) && sender.respond_to?(:config)
|
63
31
|
# RootJobnetTemplateのdsl_filepathからCategoryを生成します
|
64
|
-
Tengine::Job::Category.update_for(sender.config.dsl_dir_path)
|
32
|
+
Tengine::Job::Structure::Category.update_for(sender.config.dsl_dir_path)
|
65
33
|
end
|
66
34
|
end
|
67
35
|
|
36
|
+
def dsl_loader
|
37
|
+
::Tengine::Job::Dsl::Loader
|
38
|
+
end
|
39
|
+
|
40
|
+
def dsl_binder
|
41
|
+
::Tengine::Job::Dsl::Binder
|
42
|
+
end
|
68
43
|
|
69
44
|
# 自動テストで呼び出しをフックするためのメソッド
|
70
45
|
def test_harness(idx, msg)
|
@@ -84,11 +59,6 @@ Tengine::Core.stdout_logger.info("#{self.name}.notify #{f}")
|
|
84
59
|
Tengine.logger.debug("#{self.name}.test_harness(#{@test_harness_index}, #{msg.inspect})")
|
85
60
|
test_harness(@test_harness_index, msg)
|
86
61
|
end
|
87
|
-
|
88
|
-
end
|
89
|
-
|
90
|
-
# DSLの記述に問題があることを示す例外
|
91
|
-
class DslError < ::Tengine::DslError
|
92
62
|
end
|
93
63
|
|
94
64
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require 'tengine/job'
|
3
|
+
|
4
|
+
module Tengine::Job::Dsl
|
5
|
+
autoload :Binder , 'tengine/job/dsl/binder'
|
6
|
+
autoload :Evaluator , 'tengine/job/dsl/evaluator'
|
7
|
+
autoload :Loader , 'tengine/job/dsl/loader'
|
8
|
+
|
9
|
+
# DSLの記述に問題があることを示す例外
|
10
|
+
class Error < ::Tengine::DslError
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
@@ -1,12 +1,12 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
|
-
require 'tengine/job'
|
2
|
+
require 'tengine/job/dsl'
|
3
3
|
|
4
4
|
# ジョブDSLをロードする際に使用される語彙に関するメソッドを定義するモジュール
|
5
|
-
module Tengine::Job::
|
6
|
-
include Tengine::Job::
|
5
|
+
module Tengine::Job::Dsl::Binder
|
6
|
+
include Tengine::Job::Dsl::Evaluator
|
7
7
|
|
8
8
|
def jobnet(name, *args, &block)
|
9
|
-
Tengine::Job::
|
9
|
+
Tengine::Job::Template::RootJobnet.by_name(name)
|
10
10
|
end
|
11
11
|
|
12
12
|
end
|