omf_ec 6.1.12 → 6.1.14.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/omf_ec/context/app_context.rb +1 -1
- data/lib/omf_ec/context/group_context.rb +5 -3
- data/lib/omf_ec/experiment.rb +4 -4
- data/lib/omf_ec/graph/graph_description.rb +8 -0
- data/lib/omf_ec/group.rb +8 -1
- data/lib/omf_ec/runner.rb +24 -0
- metadata +8 -17
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
N2ZjMDkyMjEwYjQ1MjExY2U3N2MzMGE5MDViYmY4ZTY4MTgxZWMyMA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTVlMzQxMThkN2U4MDRjMzY2NWNkZDA5YzQ5NDQ4NTlmY2QyNjgzZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
Yjc0ODM1YmY2OGY3MzhkYTE1MTdiNWU0MjVhNmI2MjQ0MWIwODJlMTBjMzAw
|
10
|
+
ODFiYzhkOTkzYzVhODg3Mzk3YzdkM2FmZjQwZTYzMGMyNGVmYjNlMjdmZjkw
|
11
|
+
YTdmYTYwYzZiYWEyMDNlMmZmOGFmZjc1OWI2OThmYzNkODQzYmM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTQzOWUxMTBkY2QxNWE0OGQ1OWIwMDcxYmVjZDI3YjhjZWI0NDRiODBhNjcw
|
14
|
+
ZTg2ODk2NDRhNmI4NWM1NjlkZmUyZGFkMzcyZjNjMTQ4YjQwNWIxMjE1NjFj
|
15
|
+
N2ZmMGNjMjI4ODZmNmM3ZmZkNGMxNzk0YTkyOTQ0NGI2NDc0ZmQ=
|
@@ -47,7 +47,7 @@ module OmfEc::Context
|
|
47
47
|
OmfEc.subscribe_and_monitor(@group.resource_group(:application)) do |topic|
|
48
48
|
p = properties
|
49
49
|
p[:parameters][key.to_sym][:value] = property_value.value
|
50
|
-
topic.configure(p, { guard: { hrn: @name} } )
|
50
|
+
topic.configure(p, { guard: { hrn: @name}, assert: OmfEc.experiment.assertion } )
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
@@ -77,9 +77,11 @@ module OmfEc::Context
|
|
77
77
|
|
78
78
|
case self.operation
|
79
79
|
when :configure
|
80
|
-
topic.configure({ name => value },
|
80
|
+
topic.configure({ name => value },
|
81
|
+
{ guard: self.guard, assert: OmfEc.experiment.assertion })
|
81
82
|
when :request
|
82
|
-
topic.request([:uid, :hrn, name],
|
83
|
+
topic.request([:uid, :hrn, name],
|
84
|
+
{ guard: self.guard, assert: OmfEc.experiment.assertion })
|
83
85
|
when :release
|
84
86
|
topics_to_release = OmfEc.experiment.state.find_all do |res_state|
|
85
87
|
all_equal(self.guard.keys) do |k|
|
@@ -90,7 +92,7 @@ module OmfEc::Context
|
|
90
92
|
topics_to_release.each do |res_state|
|
91
93
|
OmfEc.subscribe_and_monitor(res_state.uid) do |child_topic|
|
92
94
|
OmfEc.subscribe_and_monitor(self.group.id) do |group_topic|
|
93
|
-
group_topic.release(child_topic) if child_topic
|
95
|
+
group_topic.release(child_topic, { assert: OmfEc.experiment.assertion }) if child_topic
|
94
96
|
end
|
95
97
|
end
|
96
98
|
end
|
data/lib/omf_ec/experiment.rb
CHANGED
@@ -16,7 +16,7 @@ module OmfEc
|
|
16
16
|
|
17
17
|
include MonitorMixin
|
18
18
|
|
19
|
-
attr_accessor :name, :sliceID, :oml_uri, :js_url, :ss_url, :job_url, :job_mps, :app_definitions, :property, :cmdline_properties, :show_graph, :nodes
|
19
|
+
attr_accessor :name, :sliceID, :oml_uri, :js_url, :ss_url, :job_url, :job_mps, :app_definitions, :property, :cmdline_properties, :show_graph, :nodes, :assertion
|
20
20
|
attr_reader :groups, :sub_groups, :state
|
21
21
|
|
22
22
|
# MP only used for injecting metadata
|
@@ -97,7 +97,7 @@ module OmfEc
|
|
97
97
|
unless planned_groups.empty?
|
98
98
|
OmfEc.subscribe_and_monitor(name) do |res|
|
99
99
|
info "Config #{name} to join #{planned_groups.map(&:name).join(', ')}"
|
100
|
-
res.configure(membership: planned_groups.map(&:address))
|
100
|
+
res.configure({ membership: planned_groups.map(&:address) }, { assert: OmfEc.experiment.assertion } )
|
101
101
|
end
|
102
102
|
end
|
103
103
|
end
|
@@ -237,7 +237,7 @@ module OmfEc
|
|
237
237
|
)
|
238
238
|
end
|
239
239
|
|
240
|
-
# If EC is launched with --job-service setup, then it needs to
|
240
|
+
# If EC is launched with --job-service setup, then it needs to
|
241
241
|
# create a job entry for this experiment trial
|
242
242
|
# Do nothing if:
|
243
243
|
# - a JobService URL has not been provided, i.e. EC runs without needs to contact JS
|
@@ -312,7 +312,7 @@ module OmfEc
|
|
312
312
|
g.synchronize do
|
313
313
|
g.members[key] = res.address
|
314
314
|
end
|
315
|
-
res.configure(membership: g.address, :
|
315
|
+
res.configure({ membership: g.address, res_index: OmfEc.experiment.nodes.index(key) }, { assert: OmfEc.experiment.assertion })
|
316
316
|
end
|
317
317
|
end
|
318
318
|
end
|
@@ -84,6 +84,10 @@ module OmfEc::Graph
|
|
84
84
|
@caption = text
|
85
85
|
end
|
86
86
|
|
87
|
+
def opts(additional_opts = {})
|
88
|
+
@opts = additional_opts
|
89
|
+
end
|
90
|
+
|
87
91
|
def _report
|
88
92
|
_report_meta
|
89
93
|
info "REPORT:START: #{@name}"
|
@@ -100,6 +104,7 @@ module OmfEc::Graph
|
|
100
104
|
info "REPORT:AXIS: #{URI.encode(@axis.to_json)}"
|
101
105
|
end
|
102
106
|
info "REPORT:CAPTION: #{URI.encode(@caption)}" if @caption
|
107
|
+
info "REPORT:OPTS: #{URI.encode(@opts.to_json)}" if @opts
|
103
108
|
info "REPORT:STOP"
|
104
109
|
end
|
105
110
|
|
@@ -119,6 +124,9 @@ module OmfEc::Graph
|
|
119
124
|
if @axis
|
120
125
|
h[:axis] = @axis
|
121
126
|
end
|
127
|
+
|
128
|
+
h[:opts] = @opts if @opts
|
129
|
+
|
122
130
|
descr = h.to_json
|
123
131
|
OmfEc.experiment.log_metadata(@name, descr, :graph)
|
124
132
|
end
|
data/lib/omf_ec/group.rb
CHANGED
@@ -70,6 +70,12 @@ module OmfEc
|
|
70
70
|
# Resources to be added could be a list of resources, groups, or the mixture of both.
|
71
71
|
def add_resource(*names)
|
72
72
|
names.flatten!
|
73
|
+
|
74
|
+
# When names is array of resource hash
|
75
|
+
if !names.empty? && names[0].kind_of?(Hash)
|
76
|
+
names.map! { |v| v['omf_id'] if v['type'] == 'node' }.compact!
|
77
|
+
end
|
78
|
+
|
73
79
|
synchronize do
|
74
80
|
# Recording membership first, used for ALL_UP event
|
75
81
|
names.each do |name|
|
@@ -107,7 +113,8 @@ module OmfEc
|
|
107
113
|
associate_resource_topic(opts[:type].to_s, res_group)
|
108
114
|
# Send create message to group
|
109
115
|
r_type = opts.delete(:type)
|
110
|
-
@topic.create(r_type, opts.merge(membership: resource_group_name)
|
116
|
+
@topic.create(r_type, opts.merge(membership: resource_group_name),
|
117
|
+
assert: OmfEc.experiment.assertion)
|
111
118
|
end
|
112
119
|
end
|
113
120
|
end
|
data/lib/omf_ec/runner.rb
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
# By downloading or using this software you accept the terms and the liability disclaimer in the License
|
5
5
|
|
6
6
|
require 'hashie'
|
7
|
+
require 'omf_common/auth/assertion'
|
7
8
|
|
8
9
|
module OmfEc
|
9
10
|
class Runner
|
@@ -91,6 +92,11 @@ module OmfEc
|
|
91
92
|
remove_cmd_opts_from_argv("--key", key)
|
92
93
|
end
|
93
94
|
|
95
|
+
op.on("--assertion PATH_TO_ASSERTION_FILE", "Assertion") do |assertion|
|
96
|
+
@cmd_opts[:assertion] = assertion
|
97
|
+
remove_cmd_opts_from_argv("--assertion", assertion)
|
98
|
+
end
|
99
|
+
|
94
100
|
op.on("--name", "--experiment EXPERIMENT_NAME", "Experiment name") do |e_name|
|
95
101
|
@cmd_opts[:experiment_name] = e_name
|
96
102
|
OmfEc.experiment.name = e_name
|
@@ -208,6 +214,24 @@ module OmfEc
|
|
208
214
|
OmfEc.experiment.oml_uri = @config_opts[:oml_uri] if @config_opts[:oml_uri]
|
209
215
|
OmfEc.experiment.show_graph = @config_opts['show-graph']
|
210
216
|
|
217
|
+
# Parse assertion JSON if provided
|
218
|
+
#
|
219
|
+
# It is specified in config file as JSON string but
|
220
|
+
# OmfCommon.load_yaml will turn it to hash (mash)
|
221
|
+
#
|
222
|
+
# OR provided via command line as path to the assertion JSON file
|
223
|
+
#
|
224
|
+
if @config_opts['assertion']
|
225
|
+
case @config_opts['assertion']
|
226
|
+
when Hash
|
227
|
+
assert = @config_opts['assertion'].to_json
|
228
|
+
when String
|
229
|
+
assert = File.read(File.expand_path(@config_opts['assertion']))
|
230
|
+
end
|
231
|
+
|
232
|
+
OmfEc.experiment.assertion = OmfCommon::Auth::Assertion.parse(assert)
|
233
|
+
end
|
234
|
+
|
211
235
|
# Instrument EC
|
212
236
|
if @config_opts[:inst_oml_uri] && @config_opts[:inst_oml_id] && @config_opts[:inst_oml_domain]
|
213
237
|
instrument_ec = OML4R::init(nil, {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omf_ec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.14.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NICTA
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - '='
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: 6.1.
|
89
|
+
version: 6.1.14.pre.1
|
90
90
|
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - '='
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: 6.1.
|
96
|
+
version: 6.1.14.pre.1
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: sequel
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -183,22 +183,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
183
183
|
version: 1.9.3
|
184
184
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
185
185
|
requirements:
|
186
|
-
- - ! '
|
186
|
+
- - ! '>'
|
187
187
|
- !ruby/object:Gem::Version
|
188
|
-
version:
|
188
|
+
version: 1.3.1
|
189
189
|
requirements: []
|
190
190
|
rubyforge_project: omf_ec
|
191
|
-
rubygems_version: 2.
|
191
|
+
rubygems_version: 2.4.2
|
192
192
|
signing_key:
|
193
193
|
specification_version: 4
|
194
194
|
summary: OMF experiment controller
|
195
|
-
test_files:
|
196
|
-
- test/oedls/empty.oedl
|
197
|
-
- test/omf_ec/app_context_spec.rb
|
198
|
-
- test/omf_ec/context_spec.rb
|
199
|
-
- test/omf_ec/dsl_spec.rb
|
200
|
-
- test/omf_ec/experiment_property_spec.rb
|
201
|
-
- test/omf_ec/experiment_spec.rb
|
202
|
-
- test/omf_ec/group_spec.rb
|
203
|
-
- test/omf_ec/runner_spec.rb
|
204
|
-
- test/test_helper.rb
|
195
|
+
test_files: []
|