neptune 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README +4 -0
- data/doc/BabelHelper.html +393 -376
- data/doc/BadConfigurationException.html +121 -127
- data/doc/CommonFunctions.html +237 -265
- data/doc/ExodusHelper.html +820 -0
- data/doc/ExodusTaskInfo.html +263 -0
- data/doc/FileNotFoundException.html +121 -127
- data/doc/NeptuneHelper.html +527 -592
- data/doc/NeptuneManagerClient.html +696 -0
- data/doc/NeptuneManagerException.html +139 -0
- data/doc/Object.html +334 -236
- data/doc/TaskInfo.html +428 -0
- data/doc/created.rid +8 -5
- data/doc/images/add.png +0 -0
- data/doc/images/delete.png +0 -0
- data/doc/images/tag_blue.png +0 -0
- data/doc/images/transparent.png +0 -0
- data/doc/index.html +74 -142
- data/doc/js/darkfish.js +99 -62
- data/doc/js/jquery.js +15 -29
- data/doc/js/navigation.js +142 -0
- data/doc/js/search.js +94 -0
- data/doc/js/search_index.js +1 -0
- data/doc/js/searcher.js +228 -0
- data/doc/table_of_contents.html +226 -0
- data/lib/babel.rb +116 -50
- data/lib/custom_exceptions.rb +2 -2
- data/lib/exodus.rb +311 -0
- data/lib/exodus_task_info.rb +36 -0
- data/lib/neptune.rb +52 -18
- data/lib/{app_controller_client.rb → neptune_manager_client.rb} +54 -38
- data/lib/task_info.rb +155 -0
- data/test/{unit/test_babel.rb → test_babel.rb} +161 -26
- data/test/{unit/test_common_functions.rb → test_common_functions.rb} +1 -1
- data/test/test_exodus.rb +687 -0
- data/test/{unit/test_neptune.rb → test_neptune.rb} +28 -17
- data/test/{unit/test_app_controller_client.rb → test_neptune_manager_client.rb} +15 -16
- data/test/test_task_info.rb +32 -0
- data/test/{unit/ts_all.rb → ts_all.rb} +3 -1
- metadata +30 -34
- data/doc/AppControllerClient.html +0 -702
- data/doc/AppControllerException.html +0 -145
- data/doc/bin/neptune.html +0 -56
- data/doc/js/quicksearch.js +0 -114
- data/doc/js/thickbox-compressed.js +0 -10
- data/doc/lib/app_controller_client_rb.html +0 -60
- data/doc/lib/babel_rb.html +0 -68
- data/doc/lib/common_functions_rb.html +0 -70
- data/doc/lib/custom_exceptions_rb.html +0 -54
- data/doc/lib/neptune_rb.html +0 -60
- data/test/integration/tc_c.rb +0 -57
- data/test/integration/tc_dfsp.rb +0 -37
- data/test/integration/tc_dwssa.rb +0 -38
- data/test/integration/tc_erlang.rb +0 -183
- data/test/integration/tc_mapreduce.rb +0 -282
- data/test/integration/tc_mpi.rb +0 -160
- data/test/integration/tc_storage.rb +0 -209
- data/test/integration/tc_upc.rb +0 -75
- data/test/integration/tc_x10.rb +0 -94
- data/test/integration/test_helper.rb +0 -135
- data/test/integration/ts_neptune.rb +0 -40
@@ -1,6 +1,6 @@
|
|
1
1
|
# Programmer: Chris Bunch (cgb@cs.ucsb.edu)
|
2
2
|
|
3
|
-
$:.unshift File.join(File.dirname(__FILE__), "..", "
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
4
4
|
require 'neptune'
|
5
5
|
|
6
6
|
require 'test/unit'
|
@@ -77,50 +77,51 @@ class TestNeptune < Test::Unit::TestCase
|
|
77
77
|
|
78
78
|
def test_preprocess_mpi
|
79
79
|
# not specifying nodes to use or procs to use should throw an error
|
80
|
-
job_data_1 = {
|
80
|
+
job_data_1 = {"@output" => "baz", "@error" => "boo",
|
81
|
+
"@metadata" => "bar"}
|
81
82
|
assert_raise(BadConfigurationException) {
|
82
83
|
NeptuneHelper.preprocess_mpi(job_data_1, nil)
|
83
84
|
}
|
84
85
|
|
85
86
|
# not specifying procs to use should throw an error
|
86
|
-
job_data_2 = {"@nodes_to_use" => 4}
|
87
|
+
job_data_2 = job_data_1.merge({"@nodes_to_use" => 4})
|
87
88
|
assert_raise(BadConfigurationException) {
|
88
89
|
NeptuneHelper.preprocess_mpi(job_data_2, nil)
|
89
90
|
}
|
90
91
|
|
91
92
|
# specifying procs to use == nodes to use should not throw an error
|
92
|
-
job_data_3 = {"@nodes_to_use" => 4, "@procs_to_use" => 4}
|
93
|
+
job_data_3 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 4})
|
93
94
|
assert_equal(job_data_3, NeptuneHelper.preprocess_mpi(job_data_3, nil))
|
94
95
|
|
95
96
|
# specifying procs to use < nodes to use should throw an error
|
96
|
-
job_data_4 = {"@nodes_to_use" => 4, "@procs_to_use" => 1}
|
97
|
+
job_data_4 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 1})
|
97
98
|
assert_raise(BadConfigurationException) {
|
98
99
|
NeptuneHelper.preprocess_mpi(job_data_4, nil)
|
99
100
|
}
|
100
101
|
|
101
102
|
# specifying an empty string for argv should be ok
|
102
|
-
job_data_5 = {"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => ""}
|
103
|
+
job_data_5 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => ""})
|
103
104
|
assert_equal(job_data_5, NeptuneHelper.preprocess_mpi(job_data_5, nil))
|
104
105
|
|
105
106
|
# specifying an empty array for argv should be ok
|
106
|
-
job_data_6 = {"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => []}
|
107
|
+
job_data_6 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => []})
|
107
108
|
expected_job_data_6 = job_data_6.dup
|
108
109
|
expected_job_data_6["@argv"] = ""
|
109
110
|
assert_equal(expected_job_data_6, NeptuneHelper.preprocess_mpi(job_data_6, nil))
|
110
111
|
|
111
112
|
# specifying something that's not a string or array for argv should throw
|
112
113
|
# an error
|
113
|
-
job_data_7 = {"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => 2}
|
114
|
+
job_data_7 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => 2})
|
114
115
|
assert_raise(BadConfigurationException) {
|
115
116
|
NeptuneHelper.preprocess_mpi(job_data_7, nil)
|
116
117
|
}
|
117
118
|
|
118
119
|
# specifying a non-empty string for argv should be ok
|
119
|
-
job_data_8 = {"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => "--file coo"}
|
120
|
+
job_data_8 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => "--file coo"})
|
120
121
|
assert_equal(job_data_8, NeptuneHelper.preprocess_mpi(job_data_8, nil))
|
121
122
|
|
122
123
|
# specifying a non-empty array for argv should be ok
|
123
|
-
job_data_9 = {"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => ["--file", "coo"]}
|
124
|
+
job_data_9 = job_data_1.merge({"@nodes_to_use" => 4, "@procs_to_use" => 4, "@argv" => ["--file", "coo"]})
|
124
125
|
expected_job_data_9 = job_data_9.dup
|
125
126
|
expected_job_data_9["@argv"] = "--file coo"
|
126
127
|
assert_equal(expected_job_data_9, NeptuneHelper.preprocess_mpi(job_data_9, nil))
|
@@ -169,10 +170,11 @@ class TestNeptune < Test::Unit::TestCase
|
|
169
170
|
expected_job_data_5 = {"@type" => "input", "@keyname" => "boo"}
|
170
171
|
assert_equal(expected_job_data_5, NeptuneHelper.get_job_data(params_5))
|
171
172
|
|
173
|
+
nodes = {"cloud1" => 1, "cloud2" => 1}
|
172
174
|
params_6 = {:type => :mpi, :output => "/boo",
|
173
|
-
:nodes_to_use =>
|
175
|
+
:nodes_to_use => nodes}
|
174
176
|
expected_job_data_6 = {"@type" => "mpi", "@output" => "/boo",
|
175
|
-
"@keyname" => "appscale", "@nodes_to_use" =>
|
177
|
+
"@keyname" => "appscale", "@nodes_to_use" => nodes.to_a.flatten}
|
176
178
|
assert_equal(expected_job_data_6, NeptuneHelper.get_job_data(params_6))
|
177
179
|
end
|
178
180
|
|
@@ -227,7 +229,7 @@ class TestNeptune < Test::Unit::TestCase
|
|
227
229
|
}
|
228
230
|
|
229
231
|
@file.should_receive(:exists?).and_return(false)
|
230
|
-
flexmock(
|
232
|
+
flexmock(NeptuneManagerClient).new_instances { |instance|
|
231
233
|
instance.should_receive(:put_input).and_return(true)
|
232
234
|
}
|
233
235
|
|
@@ -241,7 +243,7 @@ class TestNeptune < Test::Unit::TestCase
|
|
241
243
|
shadow_ip = "localhost?"
|
242
244
|
secret = "abcdefg"
|
243
245
|
|
244
|
-
flexmock(
|
246
|
+
flexmock(NeptuneManagerClient).new_instances { |instance|
|
245
247
|
instance.should_receive(:put_input).and_return(true)
|
246
248
|
}
|
247
249
|
|
@@ -266,6 +268,8 @@ class TestNeptune < Test::Unit::TestCase
|
|
266
268
|
def test_babel_job_validation
|
267
269
|
input = "/boo/input.txt"
|
268
270
|
output = "/boo/baz.txt"
|
271
|
+
error = "/boo/baz-err.txt"
|
272
|
+
metadata = "/boo/baz-meta.txt"
|
269
273
|
code = "/boo/code.go"
|
270
274
|
engine = "appscale-sqs"
|
271
275
|
all_engines = [engine]
|
@@ -273,10 +277,11 @@ class TestNeptune < Test::Unit::TestCase
|
|
273
277
|
@commonfunctions.should_receive(:get_from_yaml).and_return("127.0.0.1")
|
274
278
|
@commonfunctions.should_receive(:get_secret_key).and_return("secret")
|
275
279
|
|
276
|
-
flexmock(
|
280
|
+
flexmock(NeptuneManagerClient).new_instances { |instance|
|
277
281
|
instance.should_receive(:start_neptune_job).and_return("babel job is now running")
|
278
282
|
instance.should_receive(:get_supported_babel_engines).and_return(all_engines)
|
279
|
-
|
283
|
+
# code exists - output, error, metadata do not - something else does
|
284
|
+
instance.should_receive(:does_file_exist?).and_return(true, false, false, false, true)
|
280
285
|
}
|
281
286
|
|
282
287
|
# test cases where we don't give all the correct params
|
@@ -293,6 +298,8 @@ class TestNeptune < Test::Unit::TestCase
|
|
293
298
|
|
294
299
|
params = {:type => :babel,
|
295
300
|
:output => output,
|
301
|
+
:error => error,
|
302
|
+
:metadata => metadata,
|
296
303
|
:code => code,
|
297
304
|
:engine => engine,
|
298
305
|
:argv => [input]}
|
@@ -302,6 +309,8 @@ class TestNeptune < Test::Unit::TestCase
|
|
302
309
|
|
303
310
|
def test_babel_where_remote_files_dont_exist
|
304
311
|
output = "/boo/baz.txt"
|
312
|
+
error = "/boo/baz-err.txt"
|
313
|
+
metadata = "/boo/baz-meta.txt"
|
305
314
|
code = "/boo/code.go"
|
306
315
|
engine = "appscale-sqs"
|
307
316
|
all_engines = [engine]
|
@@ -309,7 +318,7 @@ class TestNeptune < Test::Unit::TestCase
|
|
309
318
|
@commonfunctions.should_receive(:get_from_yaml).and_return("127.0.0.1")
|
310
319
|
@commonfunctions.should_receive(:get_secret_key).and_return("secret")
|
311
320
|
|
312
|
-
flexmock(
|
321
|
+
flexmock(NeptuneManagerClient).new_instances { |instance|
|
313
322
|
instance.should_receive(:start_neptune_job).and_return("babel job is now running")
|
314
323
|
instance.should_receive(:get_supported_babel_engines).and_return(all_engines)
|
315
324
|
instance.should_receive(:does_file_exist?).and_return(false)
|
@@ -317,6 +326,8 @@ class TestNeptune < Test::Unit::TestCase
|
|
317
326
|
|
318
327
|
params = {:type => :babel,
|
319
328
|
:output => output,
|
329
|
+
:error => error,
|
330
|
+
:metadata => metadata,
|
320
331
|
:code => code,
|
321
332
|
:engine => engine}
|
322
333
|
assert_raises(FileNotFoundException) { neptune(params) }
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Programmer: Chris Bunch (cgb@cs.ucsb.edu)
|
2
2
|
|
3
|
-
$:.unshift File.join(File.dirname(__FILE__), "..", "
|
4
|
-
require '
|
3
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
4
|
+
require 'neptune_manager_client'
|
5
5
|
|
6
6
|
require 'test/unit'
|
7
7
|
|
@@ -9,9 +9,8 @@ class FakeConnection
|
|
9
9
|
# Since all the methods we're faking take the same arguments and have
|
10
10
|
# the same semantics (return true or abort), just cover it all in one place.
|
11
11
|
def method_missing(id, *args, &block)
|
12
|
-
method_names = ["
|
13
|
-
["
|
14
|
-
["neptune_compile_code"]
|
12
|
+
method_names = ["start_job", "put_input", "get_output", "get_acl"] +
|
13
|
+
["set_acl", "compile_code"]
|
15
14
|
|
16
15
|
if method_names.include?(id.to_s)
|
17
16
|
job_data = args[0]
|
@@ -26,9 +25,9 @@ class FakeConnection
|
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
29
|
-
class
|
28
|
+
class TestNeptuneManagerClient < Test::Unit::TestCase
|
30
29
|
def setup
|
31
|
-
@client =
|
30
|
+
@client = NeptuneManagerClient.new("localhost", "secret")
|
32
31
|
@client.conn = FakeConnection.new()
|
33
32
|
|
34
33
|
@job_data_ok = ["OK"]
|
@@ -41,7 +40,7 @@ class TestAppControllerClient < Test::Unit::TestCase
|
|
41
40
|
no_retry_on_exception = false
|
42
41
|
|
43
42
|
call_number = 0
|
44
|
-
assert_nothing_raised(
|
43
|
+
assert_nothing_raised(NeptuneManagerException) {
|
45
44
|
@client.make_call(no_timeout, retry_on_exception) {
|
46
45
|
call_number += 1
|
47
46
|
case call_number
|
@@ -57,13 +56,13 @@ class TestAppControllerClient < Test::Unit::TestCase
|
|
57
56
|
}
|
58
57
|
}
|
59
58
|
|
60
|
-
assert_raise(
|
59
|
+
assert_raise(NeptuneManagerException) {
|
61
60
|
@client.make_call(no_timeout, no_retry_on_exception) {
|
62
61
|
raise Errno::ECONNREFUSED
|
63
62
|
}
|
64
63
|
}
|
65
64
|
|
66
|
-
assert_raise(
|
65
|
+
assert_raise(NeptuneManagerException) {
|
67
66
|
@client.make_call(no_timeout, no_retry_on_exception) {
|
68
67
|
raise Exception
|
69
68
|
}
|
@@ -76,31 +75,31 @@ class TestAppControllerClient < Test::Unit::TestCase
|
|
76
75
|
# result unless it has 'Error:' in it. If it does, it aborts execution.
|
77
76
|
def test_start_neptune_job
|
78
77
|
assert(@client.start_neptune_job(@job_data_ok))
|
79
|
-
assert_raise(
|
78
|
+
assert_raise(NeptuneManagerException) { @client.start_neptune_job(@job_data_err) }
|
80
79
|
end
|
81
80
|
|
82
81
|
def test_put_input
|
83
82
|
assert(@client.put_input(@job_data_ok))
|
84
|
-
assert_raise(
|
83
|
+
assert_raise(NeptuneManagerException) { @client.put_input(@job_data_err) }
|
85
84
|
end
|
86
85
|
|
87
86
|
def test_get_output
|
88
87
|
assert(@client.get_output(@job_data_ok))
|
89
|
-
assert_raise(
|
88
|
+
assert_raise(NeptuneManagerException) { @client.get_output(@job_data_err) }
|
90
89
|
end
|
91
90
|
|
92
91
|
def test_get_acl
|
93
92
|
assert(@client.get_acl(@job_data_ok))
|
94
|
-
assert_raise(
|
93
|
+
assert_raise(NeptuneManagerException) { @client.get_acl(@job_data_err) }
|
95
94
|
end
|
96
95
|
|
97
96
|
def test_set_acl
|
98
97
|
assert(@client.set_acl(@job_data_ok))
|
99
|
-
assert_raise(
|
98
|
+
assert_raise(NeptuneManagerException) { @client.set_acl(@job_data_err) }
|
100
99
|
end
|
101
100
|
|
102
101
|
def test_compile_code
|
103
102
|
assert(@client.compile_code(@job_data_ok))
|
104
|
-
assert_raise(
|
103
|
+
assert_raise(NeptuneManagerException) { @client.compile_code(@job_data_err) }
|
105
104
|
end
|
106
105
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Programmer: Chris Bunch (cgb@cs.ucsb.edu)
|
2
|
+
|
3
|
+
|
4
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
5
|
+
require 'task_info'
|
6
|
+
|
7
|
+
|
8
|
+
require 'rubygems'
|
9
|
+
require 'flexmock/test_unit'
|
10
|
+
|
11
|
+
|
12
|
+
class TestTaskInfo < Test::Unit::TestCase
|
13
|
+
|
14
|
+
|
15
|
+
def test_init
|
16
|
+
assert_raises(BadConfigurationException) {
|
17
|
+
TaskInfo.new("not a Hash")
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def test_to_from_json
|
23
|
+
job_data = {'a' => 'b', 'c' => 'd'}
|
24
|
+
task = TaskInfo.new(job_data)
|
25
|
+
|
26
|
+
task_as_json = task.to_json
|
27
|
+
task_as_task = TaskInfo.new(task_as_json)
|
28
|
+
assert_equal(task.job_data, task_as_task.job_data)
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
end
|
@@ -5,7 +5,9 @@ require 'flexmock'
|
|
5
5
|
require 'flexmock/test_unit'
|
6
6
|
|
7
7
|
$:.unshift File.join(File.dirname(__FILE__))
|
8
|
-
require 'test_app_controller_client'
|
9
8
|
require 'test_babel'
|
10
9
|
require 'test_common_functions'
|
10
|
+
require 'test_exodus'
|
11
11
|
require 'test_neptune'
|
12
|
+
require 'test_neptune_manager_client'
|
13
|
+
require 'test_task_info'
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neptune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Bunch
|
@@ -15,8 +15,7 @@ autorequire: neptune
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
19
|
-
default_executable: neptune
|
18
|
+
date: 2012-07-31 00:00:00 Z
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: promise
|
@@ -47,21 +46,21 @@ files:
|
|
47
46
|
- bin/neptune
|
48
47
|
- doc/CommonFunctions.html
|
49
48
|
- doc/Object.html
|
49
|
+
- doc/ExodusHelper.html
|
50
|
+
- doc/TaskInfo.html
|
50
51
|
- doc/js/jquery.js
|
52
|
+
- doc/js/searcher.js
|
53
|
+
- doc/js/search_index.js
|
51
54
|
- doc/js/darkfish.js
|
52
|
-
- doc/js/
|
53
|
-
- doc/js/
|
54
|
-
- doc/AppControllerClient.html
|
55
|
-
- doc/AppControllerException.html
|
55
|
+
- doc/js/navigation.js
|
56
|
+
- doc/js/search.js
|
56
57
|
- doc/NeptuneHelper.html
|
58
|
+
- doc/NeptuneManagerClient.html
|
57
59
|
- doc/FileNotFoundException.html
|
58
|
-
- doc/lib/neptune_rb.html
|
59
|
-
- doc/lib/custom_exceptions_rb.html
|
60
|
-
- doc/lib/app_controller_client_rb.html
|
61
|
-
- doc/lib/babel_rb.html
|
62
|
-
- doc/lib/common_functions_rb.html
|
63
60
|
- doc/index.html
|
64
|
-
- doc/
|
61
|
+
- doc/ExodusTaskInfo.html
|
62
|
+
- doc/table_of_contents.html
|
63
|
+
- doc/NeptuneManagerException.html
|
65
64
|
- doc/BabelHelper.html
|
66
65
|
- doc/images/wrench.png
|
67
66
|
- doc/images/loadingAnimation.gif
|
@@ -72,40 +71,38 @@ files:
|
|
72
71
|
- doc/images/brick_link.png
|
73
72
|
- doc/images/page_green.png
|
74
73
|
- doc/images/brick.png
|
74
|
+
- doc/images/delete.png
|
75
75
|
- doc/images/date.png
|
76
|
+
- doc/images/add.png
|
76
77
|
- doc/images/bug.png
|
77
78
|
- doc/images/bullet_black.png
|
78
79
|
- doc/images/page_white_width.png
|
79
80
|
- doc/images/tag_green.png
|
80
81
|
- doc/images/macFFBgHack.png
|
81
82
|
- doc/images/wrench_orange.png
|
83
|
+
- doc/images/transparent.png
|
82
84
|
- doc/images/ruby.png
|
83
85
|
- doc/images/bullet_toggle_plus.png
|
84
86
|
- doc/images/package.png
|
85
87
|
- doc/images/bullet_toggle_minus.png
|
88
|
+
- doc/images/tag_blue.png
|
86
89
|
- doc/created.rid
|
87
90
|
- doc/BadConfigurationException.html
|
88
91
|
- lib/common_functions.rb
|
89
|
-
- lib/
|
92
|
+
- lib/exodus.rb
|
90
93
|
- lib/babel.rb
|
94
|
+
- lib/neptune_manager_client.rb
|
95
|
+
- lib/task_info.rb
|
96
|
+
- lib/exodus_task_info.rb
|
91
97
|
- lib/custom_exceptions.rb
|
92
98
|
- lib/neptune.rb
|
93
|
-
- test/
|
94
|
-
- test/
|
95
|
-
- test/
|
96
|
-
- test/
|
97
|
-
- test/
|
98
|
-
- test/
|
99
|
-
- test/
|
100
|
-
- test/integration/tc_x10.rb
|
101
|
-
- test/integration/tc_upc.rb
|
102
|
-
- test/integration/ts_neptune.rb
|
103
|
-
- test/integration/tc_mapreduce.rb
|
104
|
-
- test/unit/test_app_controller_client.rb
|
105
|
-
- test/unit/test_babel.rb
|
106
|
-
- test/unit/test_neptune.rb
|
107
|
-
- test/unit/test_common_functions.rb
|
108
|
-
- test/unit/ts_all.rb
|
99
|
+
- test/test_babel.rb
|
100
|
+
- test/test_task_info.rb
|
101
|
+
- test/test_exodus.rb
|
102
|
+
- test/test_neptune.rb
|
103
|
+
- test/test_neptune_manager_client.rb
|
104
|
+
- test/test_common_functions.rb
|
105
|
+
- test/ts_all.rb
|
109
106
|
- samples/upc/run_upc_ring.rb
|
110
107
|
- samples/upc/helloworld/HelloWorld.c
|
111
108
|
- samples/upc/helloworld/Makefile
|
@@ -184,7 +181,6 @@ files:
|
|
184
181
|
- samples/mpi/get_mpi_output.rb
|
185
182
|
- README
|
186
183
|
- LICENSE
|
187
|
-
has_rdoc: true
|
188
184
|
homepage: http://neptune-lang.org
|
189
185
|
licenses: []
|
190
186
|
|
@@ -214,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
214
210
|
requirements: []
|
215
211
|
|
216
212
|
rubyforge_project:
|
217
|
-
rubygems_version: 1.
|
213
|
+
rubygems_version: 1.8.24
|
218
214
|
signing_key:
|
219
215
|
specification_version: 3
|
220
216
|
summary: A domain specific language for deploying HPC apps to cloud platforms
|
@@ -1,702 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
-
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
-
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
-
<head>
|
6
|
-
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
-
|
8
|
-
<title>Class: AppControllerClient</title>
|
9
|
-
|
10
|
-
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
-
|
12
|
-
<script src="./js/jquery.js" type="text/javascript"
|
13
|
-
charset="utf-8"></script>
|
14
|
-
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
-
charset="utf-8"></script>
|
16
|
-
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
-
charset="utf-8"></script>
|
18
|
-
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
-
charset="utf-8"></script>
|
20
|
-
|
21
|
-
</head>
|
22
|
-
<body class="class">
|
23
|
-
|
24
|
-
<div id="metadata">
|
25
|
-
<div id="home-metadata">
|
26
|
-
<div id="home-section" class="section">
|
27
|
-
<h3 class="section-header">
|
28
|
-
<a href="./index.html">Home</a>
|
29
|
-
<a href="./index.html#classes">Classes</a>
|
30
|
-
<a href="./index.html#methods">Methods</a>
|
31
|
-
</h3>
|
32
|
-
</div>
|
33
|
-
</div>
|
34
|
-
|
35
|
-
<div id="file-metadata">
|
36
|
-
<div id="file-list-section" class="section">
|
37
|
-
<h3 class="section-header">In Files</h3>
|
38
|
-
<div class="section-body">
|
39
|
-
<ul>
|
40
|
-
|
41
|
-
<li><a href="./lib/app_controller_client_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
-
class="thickbox" title="lib/app_controller_client.rb">lib/app_controller_client.rb</a></li>
|
43
|
-
|
44
|
-
</ul>
|
45
|
-
</div>
|
46
|
-
</div>
|
47
|
-
|
48
|
-
|
49
|
-
</div>
|
50
|
-
|
51
|
-
<div id="class-metadata">
|
52
|
-
|
53
|
-
<!-- Parent Class -->
|
54
|
-
|
55
|
-
<div id="parent-class-section" class="section">
|
56
|
-
<h3 class="section-header">Parent</h3>
|
57
|
-
|
58
|
-
<p class="link"><a href="Object.html">Object</a></p>
|
59
|
-
|
60
|
-
</div>
|
61
|
-
|
62
|
-
|
63
|
-
<!-- Namespace Contents -->
|
64
|
-
|
65
|
-
|
66
|
-
<!-- Method Quickref -->
|
67
|
-
|
68
|
-
<div id="method-list-section" class="section">
|
69
|
-
<h3 class="section-header">Methods</h3>
|
70
|
-
<ul class="link-list">
|
71
|
-
|
72
|
-
<li><a href="#method-c-new">::new</a></li>
|
73
|
-
|
74
|
-
<li><a href="#method-i-compile_code">#compile_code</a></li>
|
75
|
-
|
76
|
-
<li><a href="#method-i-does_file_exist-3F">#does_file_exist?</a></li>
|
77
|
-
|
78
|
-
<li><a href="#method-i-get_acl">#get_acl</a></li>
|
79
|
-
|
80
|
-
<li><a href="#method-i-get_output">#get_output</a></li>
|
81
|
-
|
82
|
-
<li><a href="#method-i-get_supported_babel_engines">#get_supported_babel_engines</a></li>
|
83
|
-
|
84
|
-
<li><a href="#method-i-make_call">#make_call</a></li>
|
85
|
-
|
86
|
-
<li><a href="#method-i-put_input">#put_input</a></li>
|
87
|
-
|
88
|
-
<li><a href="#method-i-set_acl">#set_acl</a></li>
|
89
|
-
|
90
|
-
<li><a href="#method-i-start_neptune_job">#start_neptune_job</a></li>
|
91
|
-
|
92
|
-
</ul>
|
93
|
-
</div>
|
94
|
-
|
95
|
-
|
96
|
-
<!-- Included Modules -->
|
97
|
-
|
98
|
-
</div>
|
99
|
-
|
100
|
-
<div id="project-metadata">
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<div id="classindex-section" class="section project-section">
|
105
|
-
<h3 class="section-header">Class/Module Index
|
106
|
-
<span class="search-toggle"><img src="./images/find.png"
|
107
|
-
height="16" width="16" alt="[+]"
|
108
|
-
title="show/hide quicksearch" /></span></h3>
|
109
|
-
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
110
|
-
<fieldset>
|
111
|
-
<legend>Quicksearch</legend>
|
112
|
-
<input type="text" name="quicksearch" value=""
|
113
|
-
class="quicksearch-field" />
|
114
|
-
</fieldset>
|
115
|
-
</form>
|
116
|
-
|
117
|
-
<ul class="link-list">
|
118
|
-
|
119
|
-
<li><a href="./AppControllerClient.html">AppControllerClient</a></li>
|
120
|
-
|
121
|
-
<li><a href="./AppControllerException.html">AppControllerException</a></li>
|
122
|
-
|
123
|
-
<li><a href="./BabelHelper.html">BabelHelper</a></li>
|
124
|
-
|
125
|
-
<li><a href="./BadConfigurationException.html">BadConfigurationException</a></li>
|
126
|
-
|
127
|
-
<li><a href="./CommonFunctions.html">CommonFunctions</a></li>
|
128
|
-
|
129
|
-
<li><a href="./FileNotFoundException.html">FileNotFoundException</a></li>
|
130
|
-
|
131
|
-
<li><a href="./NeptuneHelper.html">NeptuneHelper</a></li>
|
132
|
-
|
133
|
-
<li><a href="./Object.html">Object</a></li>
|
134
|
-
|
135
|
-
</ul>
|
136
|
-
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
137
|
-
</div>
|
138
|
-
|
139
|
-
|
140
|
-
</div>
|
141
|
-
</div>
|
142
|
-
|
143
|
-
<div id="documentation">
|
144
|
-
<h1 class="class">AppControllerClient</h1>
|
145
|
-
|
146
|
-
<div id="description">
|
147
|
-
|
148
|
-
<p>A client that uses SOAP messages to communicate with the underlying cloud
|
149
|
-
platform (here, AppScale). This client is similar to that used in the
|
150
|
-
AppScale Tools, but with non-Neptune SOAP calls removed.</p>
|
151
|
-
|
152
|
-
</div>
|
153
|
-
|
154
|
-
<!-- Constants -->
|
155
|
-
|
156
|
-
|
157
|
-
<!-- Attributes -->
|
158
|
-
|
159
|
-
<div id="attribute-method-details" class="method-section section">
|
160
|
-
<h3 class="section-header">Attributes</h3>
|
161
|
-
|
162
|
-
|
163
|
-
<div id="conn-attribute-method" class="method-detail">
|
164
|
-
<a name="conn"></a>
|
165
|
-
|
166
|
-
<a name="conn="></a>
|
167
|
-
|
168
|
-
<div class="method-heading attribute-method-heading">
|
169
|
-
<span class="method-name">conn</span><span
|
170
|
-
class="attribute-access-type">[RW]</span>
|
171
|
-
</div>
|
172
|
-
|
173
|
-
<div class="method-description">
|
174
|
-
|
175
|
-
<p>The SOAP client that we use to communicate with the AppController.</p>
|
176
|
-
|
177
|
-
</div>
|
178
|
-
</div>
|
179
|
-
|
180
|
-
<div id="ip-attribute-method" class="method-detail">
|
181
|
-
<a name="ip"></a>
|
182
|
-
|
183
|
-
<a name="ip="></a>
|
184
|
-
|
185
|
-
<div class="method-heading attribute-method-heading">
|
186
|
-
<span class="method-name">ip</span><span
|
187
|
-
class="attribute-access-type">[RW]</span>
|
188
|
-
</div>
|
189
|
-
|
190
|
-
<div class="method-description">
|
191
|
-
|
192
|
-
<p>The IP address of the AppController that we will be connecting to.</p>
|
193
|
-
|
194
|
-
</div>
|
195
|
-
</div>
|
196
|
-
|
197
|
-
<div id="secret-attribute-method" class="method-detail">
|
198
|
-
<a name="secret"></a>
|
199
|
-
|
200
|
-
<a name="secret="></a>
|
201
|
-
|
202
|
-
<div class="method-heading attribute-method-heading">
|
203
|
-
<span class="method-name">secret</span><span
|
204
|
-
class="attribute-access-type">[RW]</span>
|
205
|
-
</div>
|
206
|
-
|
207
|
-
<div class="method-description">
|
208
|
-
|
209
|
-
<p>The secret string that is used to authenticate this client with
|
210
|
-
AppControllers. It is initially generated by appscale-run-instances and can
|
211
|
-
be found on the machine that ran that tool, or on any AppScale machine.</p>
|
212
|
-
|
213
|
-
</div>
|
214
|
-
</div>
|
215
|
-
|
216
|
-
</div>
|
217
|
-
|
218
|
-
|
219
|
-
<!-- Methods -->
|
220
|
-
|
221
|
-
<div id="public-class-method-details" class="method-section section">
|
222
|
-
<h3 class="section-header">Public Class Methods</h3>
|
223
|
-
|
224
|
-
|
225
|
-
<div id="new-method" class="method-detail ">
|
226
|
-
<a name="method-c-new"></a>
|
227
|
-
|
228
|
-
|
229
|
-
<div class="method-heading">
|
230
|
-
<span class="method-name">new</span><span
|
231
|
-
class="method-args">(ip, secret)</span>
|
232
|
-
<span class="method-click-advice">click to toggle source</span>
|
233
|
-
</div>
|
234
|
-
|
235
|
-
|
236
|
-
<div class="method-description">
|
237
|
-
|
238
|
-
<p>A constructor that requires both the IP address of the machine to
|
239
|
-
communicate with as well as the secret (string) needed to perform
|
240
|
-
communication. AppControllers will reject SOAP calls if this secret
|
241
|
-
(basically a password) is not present - it can be found in the user’s
|
242
|
-
.appscale directory, and a helper method is usually present to fetch this
|
243
|
-
for us.</p>
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
<div class="method-source-code"
|
248
|
-
id="new-source">
|
249
|
-
<pre>
|
250
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 41</span>
|
251
|
-
def initialize(ip, secret)
|
252
|
-
<span class="ruby-ivar">@ip</span> = ip
|
253
|
-
<span class="ruby-ivar">@secret</span> = secret
|
254
|
-
|
255
|
-
<span class="ruby-ivar">@conn</span> = <span class="ruby-constant">SOAP</span>::<span class="ruby-constant">RPC</span>::<span class="ruby-constant">Driver</span>.new("https://#{@ip}:17443")
|
256
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_start_job"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
257
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_put_input"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
258
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_get_output"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
259
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_get_acl"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
260
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_set_acl"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
261
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_compile_code"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
262
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_get_supported_babel_engines"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
263
|
-
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_does_file_exist"</span>, <span class="ruby-string">"file"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
264
|
-
end</pre>
|
265
|
-
</div>
|
266
|
-
|
267
|
-
</div>
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
</div>
|
273
|
-
|
274
|
-
|
275
|
-
</div>
|
276
|
-
|
277
|
-
<div id="public-instance-method-details" class="method-section section">
|
278
|
-
<h3 class="section-header">Public Instance Methods</h3>
|
279
|
-
|
280
|
-
|
281
|
-
<div id="compile_code-method" class="method-detail ">
|
282
|
-
<a name="method-i-compile_code"></a>
|
283
|
-
|
284
|
-
|
285
|
-
<div class="method-heading">
|
286
|
-
<span class="method-name">compile_code</span><span
|
287
|
-
class="method-args">(job_data)</span>
|
288
|
-
<span class="method-click-advice">click to toggle source</span>
|
289
|
-
</div>
|
290
|
-
|
291
|
-
|
292
|
-
<div class="method-description">
|
293
|
-
|
294
|
-
<p>Instructs the AppController to fetch the code specified and compile it. The
|
295
|
-
result should then be placed in a location specified in the job data.</p>
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
<div class="method-source-code"
|
300
|
-
id="compile_code-source">
|
301
|
-
<pre>
|
302
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 178</span>
|
303
|
-
def compile_code(job_data)
|
304
|
-
result = <span class="ruby-string">""</span>
|
305
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
306
|
-
result = conn.neptune_compile_code(job_data, <span class="ruby-ivar">@secret</span>)
|
307
|
-
}
|
308
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
309
|
-
return result
|
310
|
-
end</pre>
|
311
|
-
</div>
|
312
|
-
|
313
|
-
</div>
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
</div>
|
319
|
-
|
320
|
-
|
321
|
-
<div id="does_file_exist-3F-method" class="method-detail ">
|
322
|
-
<a name="method-i-does_file_exist-3F"></a>
|
323
|
-
|
324
|
-
|
325
|
-
<div class="method-heading">
|
326
|
-
<span class="method-name">does_file_exist?</span><span
|
327
|
-
class="method-args">(file, job_data)</span>
|
328
|
-
<span class="method-click-advice">click to toggle source</span>
|
329
|
-
</div>
|
330
|
-
|
331
|
-
|
332
|
-
<div class="method-description">
|
333
|
-
|
334
|
-
<p>Asks the AppController to see if the given file exists in the remote
|
335
|
-
datastore. If extra credentials are needed for this operation, they are
|
336
|
-
searched for within the job data.</p>
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
<div class="method-source-code"
|
341
|
-
id="does_file_exist-3F-source">
|
342
|
-
<pre>
|
343
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 203</span>
|
344
|
-
def does_file_exist?(file, job_data)
|
345
|
-
result = false
|
346
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
347
|
-
result = conn.neptune_does_file_exist(file, job_data, <span class="ruby-ivar">@secret</span>)
|
348
|
-
}
|
349
|
-
return result
|
350
|
-
end</pre>
|
351
|
-
</div>
|
352
|
-
|
353
|
-
</div>
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
</div>
|
359
|
-
|
360
|
-
|
361
|
-
<div id="get_acl-method" class="method-detail ">
|
362
|
-
<a name="method-i-get_acl"></a>
|
363
|
-
|
364
|
-
|
365
|
-
<div class="method-heading">
|
366
|
-
<span class="method-name">get_acl</span><span
|
367
|
-
class="method-args">(job_data)</span>
|
368
|
-
<span class="method-click-advice">click to toggle source</span>
|
369
|
-
</div>
|
370
|
-
|
371
|
-
|
372
|
-
<div class="method-description">
|
373
|
-
|
374
|
-
<p>Returns the ACL associated with the named piece of data stored in the
|
375
|
-
underlying cloud platform. Right now, data can only be public or private,
|
376
|
-
but future versions will add individual user support. Input, output, and
|
377
|
-
exceptions mirror that of start_neptune_job.</p>
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
<div class="method-source-code"
|
382
|
-
id="get_acl-source">
|
383
|
-
<pre>
|
384
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 151</span>
|
385
|
-
def get_acl(job_data)
|
386
|
-
result = <span class="ruby-string">""</span>
|
387
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
388
|
-
result = conn.neptune_get_acl(job_data, <span class="ruby-ivar">@secret</span>)
|
389
|
-
}
|
390
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
391
|
-
return result
|
392
|
-
end</pre>
|
393
|
-
</div>
|
394
|
-
|
395
|
-
</div>
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
</div>
|
401
|
-
|
402
|
-
|
403
|
-
<div id="get_output-method" class="method-detail ">
|
404
|
-
<a name="method-i-get_output"></a>
|
405
|
-
|
406
|
-
|
407
|
-
<div class="method-heading">
|
408
|
-
<span class="method-name">get_output</span><span
|
409
|
-
class="method-args">(job_data)</span>
|
410
|
-
<span class="method-click-advice">click to toggle source</span>
|
411
|
-
</div>
|
412
|
-
|
413
|
-
|
414
|
-
<div class="method-description">
|
415
|
-
|
416
|
-
<p>Retrieves the output of a Neptune job, stored in an underlying database.
|
417
|
-
Within AppScale, a special application runs, referred to as the Repository,
|
418
|
-
which provides a key-value interface to Neptune job data. Data is stored as
|
419
|
-
though it were on a file system, therefore output be of the usual form
|
420
|
-
/folder/filename . Currently the contents of the file is returned as a
|
421
|
-
string to the caller, but as this may be inefficient for non-trivial output
|
422
|
-
jobs, the next version of Neptune will add an additional call to directly
|
423
|
-
copy the output to a file on the local filesystem. See <a
|
424
|
-
href="AppControllerClient.html#method-i-start_neptune_job">start_neptune_job</a>
|
425
|
-
for conditions by which this method can raise AppControllerException.new as
|
426
|
-
well as the input format used for job_data.</p>
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
<div class="method-source-code"
|
431
|
-
id="get_output-source">
|
432
|
-
<pre>
|
433
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 136</span>
|
434
|
-
def get_output(job_data)
|
435
|
-
result = <span class="ruby-string">""</span>
|
436
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
437
|
-
result = conn.neptune_get_output(job_data, <span class="ruby-ivar">@secret</span>)
|
438
|
-
}
|
439
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
440
|
-
return result
|
441
|
-
end</pre>
|
442
|
-
</div>
|
443
|
-
|
444
|
-
</div>
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
</div>
|
450
|
-
|
451
|
-
|
452
|
-
<div id="get_supported_babel_engines-method" class="method-detail ">
|
453
|
-
<a name="method-i-get_supported_babel_engines"></a>
|
454
|
-
|
455
|
-
|
456
|
-
<div class="method-heading">
|
457
|
-
<span class="method-name">get_supported_babel_engines</span><span
|
458
|
-
class="method-args">(job_data)</span>
|
459
|
-
<span class="method-click-advice">click to toggle source</span>
|
460
|
-
</div>
|
461
|
-
|
462
|
-
|
463
|
-
<div class="method-description">
|
464
|
-
|
465
|
-
<p>Asks the AppController for a list of all the Babel engines (each of which
|
466
|
-
is a queue to store jobs and something that executes tasks) that are
|
467
|
-
supported for the given credentials.</p>
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
<div class="method-source-code"
|
472
|
-
id="get_supported_babel_engines-source">
|
473
|
-
<pre>
|
474
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 191</span>
|
475
|
-
def get_supported_babel_engines(job_data)
|
476
|
-
result = []
|
477
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
478
|
-
result = conn.neptune_get_supported_babel_engines(job_data, <span class="ruby-ivar">@secret</span>)
|
479
|
-
}
|
480
|
-
return result
|
481
|
-
end</pre>
|
482
|
-
</div>
|
483
|
-
|
484
|
-
</div>
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
</div>
|
490
|
-
|
491
|
-
|
492
|
-
<div id="make_call-method" class="method-detail ">
|
493
|
-
<a name="method-i-make_call"></a>
|
494
|
-
|
495
|
-
|
496
|
-
<div class="method-heading">
|
497
|
-
<span class="method-name">make_call</span><span
|
498
|
-
class="method-args">(time, retry_on_except)</span>
|
499
|
-
<span class="method-click-advice">click to toggle source</span>
|
500
|
-
</div>
|
501
|
-
|
502
|
-
|
503
|
-
<div class="method-description">
|
504
|
-
|
505
|
-
<p>A helper method to make SOAP calls for us. This method is mainly here to
|
506
|
-
reduce code duplication: all SOAP calls expect a certain timeout and can
|
507
|
-
tolerate certain exceptions, so we consolidate this code into this method.
|
508
|
-
Here, the caller specifies the timeout for the SOAP call (or NO_TIMEOUT if
|
509
|
-
an infinite timeout is required) as well as whether the call should be
|
510
|
-
retried in the face of exceptions. Exceptions can occur if the machine is
|
511
|
-
not yet running or is too busy to handle the request, so these exceptions
|
512
|
-
are automatically retried regardless of the retry value. Typically callers
|
513
|
-
set this to false to catch ‘Connection Refused’ exceptions or the like.
|
514
|
-
Finally, the caller must provide a block of code that indicates the SOAP
|
515
|
-
call to make: this is really all that differs between the calling methods.
|
516
|
-
The result of the block is returned to the caller.</p>
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
<div class="method-source-code"
|
521
|
-
id="make_call-source">
|
522
|
-
<pre>
|
523
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 70</span>
|
524
|
-
def make_call(time, retry_on_except)
|
525
|
-
begin
|
526
|
-
<span class="ruby-constant">Timeout</span>::timeout(time) {
|
527
|
-
yield if block_given?
|
528
|
-
}
|
529
|
-
rescue <span class="ruby-constant">Errno</span>::<span class="ruby-constant">ECONNREFUSED</span>
|
530
|
-
if retry_on_except
|
531
|
-
retry
|
532
|
-
else
|
533
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(<span class="ruby-string">"Connection was refused. Is the AppController running?"</span>)
|
534
|
-
end
|
535
|
-
rescue <span class="ruby-constant">OpenSSL</span>::<span class="ruby-constant">SSL</span>::<span class="ruby-constant">SSLError</span>, <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-constant">Timeout</span>::<span class="ruby-constant">Error</span>
|
536
|
-
retry
|
537
|
-
rescue <span class="ruby-constant">Exception</span> => except
|
538
|
-
if retry_on_except
|
539
|
-
retry
|
540
|
-
else
|
541
|
-
raise <span class="ruby-constant">AppControllerException</span>.new("We saw an unexpected error of the type #{except.class} with the following message:\n#{except}.")
|
542
|
-
end
|
543
|
-
end
|
544
|
-
end</pre>
|
545
|
-
</div>
|
546
|
-
|
547
|
-
</div>
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
</div>
|
553
|
-
|
554
|
-
|
555
|
-
<div id="put_input-method" class="method-detail ">
|
556
|
-
<a name="method-i-put_input"></a>
|
557
|
-
|
558
|
-
|
559
|
-
<div class="method-heading">
|
560
|
-
<span class="method-name">put_input</span><span
|
561
|
-
class="method-args">(job_data)</span>
|
562
|
-
<span class="method-click-advice">click to toggle source</span>
|
563
|
-
</div>
|
564
|
-
|
565
|
-
|
566
|
-
<div class="method-description">
|
567
|
-
|
568
|
-
<p>Stores a file stored on the user’s local file system in the underlying
|
569
|
-
database. The user can specify to use either the underlying database that
|
570
|
-
AppScale is using, or alternative storage mechanisms (as of writing, Google
|
571
|
-
Storage, Amazon S3, and Eucalyptus Walrus are supported) via the storage
|
572
|
-
parameter.</p>
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
<div class="method-source-code"
|
577
|
-
id="put_input-source">
|
578
|
-
<pre>
|
579
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 116</span>
|
580
|
-
def put_input(job_data)
|
581
|
-
result = <span class="ruby-string">""</span>
|
582
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
583
|
-
result = conn.neptune_put_input(job_data, <span class="ruby-ivar">@secret</span>)
|
584
|
-
}
|
585
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
586
|
-
return result
|
587
|
-
end</pre>
|
588
|
-
</div>
|
589
|
-
|
590
|
-
</div>
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
</div>
|
596
|
-
|
597
|
-
|
598
|
-
<div id="set_acl-method" class="method-detail ">
|
599
|
-
<a name="method-i-set_acl"></a>
|
600
|
-
|
601
|
-
|
602
|
-
<div class="method-heading">
|
603
|
-
<span class="method-name">set_acl</span><span
|
604
|
-
class="method-args">(job_data)</span>
|
605
|
-
<span class="method-click-advice">click to toggle source</span>
|
606
|
-
</div>
|
607
|
-
|
608
|
-
|
609
|
-
<div class="method-description">
|
610
|
-
|
611
|
-
<p>Sets the ACL of a specified pieces of data stored in the underlying cloud
|
612
|
-
platform. As is the case with <a
|
613
|
-
href="AppControllerClient.html#method-i-get_acl">get_acl</a>, ACLs can be
|
614
|
-
either public or private right now, but this will be expanded upon in the
|
615
|
-
future. As with the other SOAP calls, input, output, and exceptions mirror
|
616
|
-
that of start_neptune_job.</p>
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
<div class="method-source-code"
|
621
|
-
id="set_acl-source">
|
622
|
-
<pre>
|
623
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 166</span>
|
624
|
-
def set_acl(job_data)
|
625
|
-
result = <span class="ruby-string">""</span>
|
626
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
627
|
-
result = conn.neptune_set_acl(job_data, <span class="ruby-ivar">@secret</span>)
|
628
|
-
}
|
629
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
630
|
-
return result
|
631
|
-
end</pre>
|
632
|
-
</div>
|
633
|
-
|
634
|
-
</div>
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
</div>
|
640
|
-
|
641
|
-
|
642
|
-
<div id="start_neptune_job-method" class="method-detail ">
|
643
|
-
<a name="method-i-start_neptune_job"></a>
|
644
|
-
|
645
|
-
|
646
|
-
<div class="method-heading">
|
647
|
-
<span class="method-name">start_neptune_job</span><span
|
648
|
-
class="method-args">(job_data)</span>
|
649
|
-
<span class="method-click-advice">click to toggle source</span>
|
650
|
-
</div>
|
651
|
-
|
652
|
-
|
653
|
-
<div class="method-description">
|
654
|
-
|
655
|
-
<p>Initiates the start of a Neptune job, whether it be a HPC job (MPI, X10, or
|
656
|
-
MapReduce), or a scaling job (e.g., for AppScale itself). This method
|
657
|
-
should not be used for retrieving the output of a job or getting / setting
|
658
|
-
output ACLs, but just for starting new HPC / scaling jobs. This method
|
659
|
-
takes a hash containing the parameters of the job to run, and can raise
|
660
|
-
AppControllerException.new if the AppController it calls returns an error
|
661
|
-
(e.g., if a bad secret is used or the machine isn’t running). Otherwise,
|
662
|
-
the return value of this method is the result returned from the
|
663
|
-
AppController.</p>
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
<div class="method-source-code"
|
668
|
-
id="start_neptune_job-source">
|
669
|
-
<pre>
|
670
|
-
<span class="ruby-comment"># File lib/app_controller_client.rb, line 101</span>
|
671
|
-
def start_neptune_job(job_data)
|
672
|
-
result = <span class="ruby-string">""</span>
|
673
|
-
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
674
|
-
result = conn.neptune_start_job(job_data, <span class="ruby-ivar">@secret</span>)
|
675
|
-
}
|
676
|
-
raise <span class="ruby-constant">AppControllerException</span>.new(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
677
|
-
return result
|
678
|
-
end</pre>
|
679
|
-
</div>
|
680
|
-
|
681
|
-
</div>
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
</div>
|
687
|
-
|
688
|
-
|
689
|
-
</div>
|
690
|
-
|
691
|
-
|
692
|
-
</div>
|
693
|
-
|
694
|
-
<div id="validator-badges">
|
695
|
-
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
696
|
-
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
697
|
-
Rdoc Generator</a> 2</small>.</p>
|
698
|
-
</div>
|
699
|
-
|
700
|
-
</body>
|
701
|
-
</html>
|
702
|
-
|