neptune 0.0.6 → 0.0.7
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 +19 -3
- data/doc/AppControllerClient.html +53 -7
- data/doc/CommonFunctions.html +16 -12
- data/doc/Object.html +200 -39
- data/doc/README.html +55 -17
- data/doc/bin/neptune.html +2 -6
- data/doc/created.rid +6 -6
- data/doc/index.html +6 -2
- data/doc/lib/app_controller_client_rb.html +1 -1
- data/doc/lib/common_functions_rb.html +1 -1
- data/doc/lib/neptune_rb.html +56 -0
- data/lib/common_functions.rb +0 -1
- data/lib/neptune.rb +17 -18
- data/test/tc_c.rb +57 -0
- data/test/tc_dfsp.rb +37 -0
- data/test/tc_dwssa.rb +38 -0
- data/test/tc_erlang.rb +157 -0
- data/test/tc_mapreduce.rb +207 -0
- data/test/tc_mpi.rb +124 -0
- data/test/tc_storage.rb +45 -0
- data/test/tc_upc.rb +75 -0
- data/test/tc_x10.rb +94 -0
- data/test/test_helper.rb +137 -0
- data/test/ts_neptune.rb +41 -0
- metadata +16 -4
data/doc/README.html
CHANGED
@@ -84,25 +84,42 @@
|
|
84
84
|
Platforms</p>
|
85
85
|
|
86
86
|
<p>Neptune provides programmers with a simple interface by which they can
|
87
|
-
deploy MPI, X10, and
|
88
|
-
particulars of the underlying cloud platform. You only need to give
|
89
|
-
your code, tell it how many machines to run on and where to put the
|
90
|
-
Neptune handles everything else. No more writing configuration
|
91
|
-
having to start up NFS on all your machines, yada yada yada. Neptune
|
92
|
-
together with supported cloud platforms (currently AppScale is
|
93
|
-
and can deploy over anything AppScale can - Xen or KVM virtual
|
94
|
-
well as Eucalyptus and Amazon EC2. There’s nothing
|
95
|
-
specific in there, so in theory any machine installed with
|
96
|
-
software should work fine.</p>
|
87
|
+
deploy MPI, X10, MapReduce, UPC, and Erlang jobs to without needing to know
|
88
|
+
the particulars of the underlying cloud platform. You only need to give
|
89
|
+
Neptune your code, tell it how many machines to run on and where to put the
|
90
|
+
output: Neptune handles everything else. No more writing configuration
|
91
|
+
files, having to start up NFS on all your machines, yada yada yada. Neptune
|
92
|
+
works together with supported cloud platforms (currently AppScale is
|
93
|
+
recommended) and can deploy over anything AppScale can - Xen or KVM virtual
|
94
|
+
machines as well as Eucalyptus and Amazon EC2. There’s nothing
|
95
|
+
virtualization specific in there, so in theory any machine installed with
|
96
|
+
the AppScale software should work fine.</p>
|
97
97
|
|
98
98
|
<p>Although Neptune is designed to automate deploying HPC jobs, it also can be
|
99
99
|
used to deploy other types of software. For example, Neptune has support
|
100
100
|
for user-specified scaling of the underlying cloud platform: users can
|
101
101
|
write Neptune jobs that manually add load balancers, application servers,
|
102
|
-
or database servers to a running AppScale deployment
|
103
|
-
|
104
|
-
|
105
|
-
|
102
|
+
or database servers to a running AppScale deployment. Additionally, as of
|
103
|
+
version 0.0.2, remote compiling can also be performed: just give Neptune
|
104
|
+
the path to the directory you want to compile and be sure to include a
|
105
|
+
Makefile in it! Neptune will run ‘make’ on it (you can specify which
|
106
|
+
target to make as well) and return to you a folder containing the standard
|
107
|
+
out and standard error of the make command.</p>
|
108
|
+
|
109
|
+
<p>By default, Neptune jobs store their outputs in the underlying database
|
110
|
+
that AppScale is running over. As of Neptune 0.0.5, job outputs can also be
|
111
|
+
stored in Amazon S3, Eucalyptus Walrus, and Google Storage.</p>
|
112
|
+
|
113
|
+
<p>Sample Neptune job scripts can be found in samples. Test cases can be found
|
114
|
+
in the test folder, with the standard naming convention</p>
|
115
|
+
<ul><li>
|
116
|
+
<p>ts_neptune is the test suite runner, with tc_* containing test</p>
|
117
|
+
</li></ul>
|
118
|
+
|
119
|
+
<p>cases for each type of job that Neptune offers. Before running ts_neptune,
|
120
|
+
you should export the environment variable APPSCALE_HEAD_NODE, which should
|
121
|
+
be set to the IP address of the AppScale machine that runs the Shadow
|
122
|
+
daemon (a.k.a. the Master AppController).</p>
|
106
123
|
|
107
124
|
<p>Developed by Chris Bunch as part of the AppScale project. See <a
|
108
125
|
href="LICENSE.html">LICENSE</a> for the specifics of the New BSD License by
|
@@ -110,9 +127,10 @@ which Neptune is released.</p>
|
|
110
127
|
|
111
128
|
<p>Check us out on the web:</p>
|
112
129
|
|
113
|
-
<p><a href="http://
|
130
|
+
<p><a href="http://neptune-lang.org">neptune-lang.org</a></p>
|
114
131
|
|
115
|
-
<p><a href="http://
|
132
|
+
<p><a href="http://code.google.com/p/appscale">code.google.com/p/appscale</a>
|
133
|
+
<a href="http://appscale.cs.ucsb.edu">appscale.cs.ucsb.edu</a></p>
|
116
134
|
|
117
135
|
<p>Contributors welcome! We would love to add support for other cloud
|
118
136
|
platforms and test out Neptune more on non-virtualized deployments, as well
|
@@ -125,7 +143,27 @@ to that as it becomes available.</p>
|
|
125
143
|
|
126
144
|
<p>Version History:</p>
|
127
145
|
|
128
|
-
<p>
|
146
|
+
<p>April 2, 2001 - 0.0.7 released, adding automatic test suite and many bug
|
147
|
+
fixes for all scenarios. rcov can also be used to generate test coverage
|
148
|
+
information: current coverage stats can be found in coverage directory.
|
149
|
+
mapreduce broken at the moment - will fix in next release</p>
|
150
|
+
|
151
|
+
<p>March 28, 2011 - 0.0.6 released, adding support for input jobs, so users
|
152
|
+
can place data in the datastore without having to run any computation</p>
|
153
|
+
|
154
|
+
<p>March 18, 2011 - 0.0.5 released, adding support for storage outside of
|
155
|
+
AppScale to be used. Tested and working with Amazon S3 and Google Storage</p>
|
156
|
+
|
157
|
+
<p>February 10, 2011 - 0.0.4 released, adding UPC and Erlang support, and
|
158
|
+
restructuring syntax to pass in hashes to method calls instead of passing
|
159
|
+
in blocks</p>
|
160
|
+
|
161
|
+
<p>February 4, 2011 - 0.0.3 released, allowing users to use Neptune properly
|
162
|
+
as a gem within Ruby code</p>
|
163
|
+
|
164
|
+
<p>February 4, 2011 - 0.0.2 released, adding support for remote compiling</p>
|
165
|
+
|
166
|
+
<p>January 27, 2011 - 0.0.1 released, with initial support for MPI, X10, and
|
129
167
|
MapReduce.</p>
|
130
168
|
|
131
169
|
<h1>end</h1>
|
data/doc/bin/neptune.html
CHANGED
@@ -24,18 +24,14 @@
|
|
24
24
|
<div id="metadata">
|
25
25
|
<dl>
|
26
26
|
<dt class="modified-date">Last Modified</dt>
|
27
|
-
<dd class="modified-date">
|
27
|
+
<dd class="modified-date">Fri Feb 04 19:49:21 -0800 2011</dd>
|
28
28
|
|
29
29
|
|
30
30
|
<dt class="requires">Requires</dt>
|
31
31
|
<dd class="requires">
|
32
32
|
<ul>
|
33
33
|
|
34
|
-
<li>
|
35
|
-
|
36
|
-
<li>common_functions</li>
|
37
|
-
|
38
|
-
<li>job</li>
|
34
|
+
<li>neptune</li>
|
39
35
|
|
40
36
|
</ul>
|
41
37
|
</dd>
|
data/doc/created.rid
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
|
2
|
-
./lib/common_functions.rb
|
1
|
+
Sat, 02 Apr 2011 09:03:26 -0700
|
2
|
+
./lib/common_functions.rb Wed, 30 Mar 2011 21:31:10 -0700
|
3
3
|
./LICENSE Thu, 27 Jan 2011 13:24:30 -0800
|
4
|
-
./lib/
|
5
|
-
./lib/
|
6
|
-
./README
|
7
|
-
./bin/neptune
|
4
|
+
./lib/app_controller_client.rb Sun, 27 Mar 2011 23:37:41 -0700
|
5
|
+
./lib/neptune.rb Thu, 31 Mar 2011 10:11:31 -0700
|
6
|
+
./README Sat, 02 Apr 2011 09:03:23 -0700
|
7
|
+
./bin/neptune Fri, 04 Feb 2011 19:49:21 -0800
|
data/doc/index.html
CHANGED
@@ -69,16 +69,20 @@
|
|
69
69
|
|
70
70
|
<li><a href="AppControllerClient.html#method-i-get_output">#get_output — AppControllerClient</a></li>
|
71
71
|
|
72
|
-
<li><a href="Object.html#method-i-job">#job — Object</a></li>
|
73
|
-
|
74
72
|
<li><a href="AppControllerClient.html#method-i-make_call">#make_call — AppControllerClient</a></li>
|
75
73
|
|
74
|
+
<li><a href="Object.html#method-i-neptune">#neptune — Object</a></li>
|
75
|
+
|
76
76
|
<li><a href="Object.html#method-i-preprocess_compile">#preprocess_compile — Object</a></li>
|
77
77
|
|
78
|
+
<li><a href="Object.html#method-i-preprocess_erlang">#preprocess_erlang — Object</a></li>
|
79
|
+
|
78
80
|
<li><a href="Object.html#method-i-preprocess_mapreduce">#preprocess_mapreduce — Object</a></li>
|
79
81
|
|
80
82
|
<li><a href="Object.html#method-i-preprocess_mpi">#preprocess_mpi — Object</a></li>
|
81
83
|
|
84
|
+
<li><a href="AppControllerClient.html#method-i-put_input">#put_input — AppControllerClient</a></li>
|
85
|
+
|
82
86
|
<li><a href="AppControllerClient.html#method-i-set_acl">#set_acl — AppControllerClient</a></li>
|
83
87
|
|
84
88
|
<li><a href="AppControllerClient.html#method-i-start_neptune_job">#start_neptune_job — AppControllerClient</a></li>
|
@@ -0,0 +1,56 @@
|
|
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
|
+
|
5
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
6
|
+
<head>
|
7
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
8
|
+
|
9
|
+
<title>File: neptune.rb [RDoc Documentation]</title>
|
10
|
+
|
11
|
+
<link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
|
12
|
+
|
13
|
+
<script src="../js/jquery.js" type="text/javascript"
|
14
|
+
charset="utf-8"></script>
|
15
|
+
<script src="../js/thickbox-compressed.js" type="text/javascript"
|
16
|
+
charset="utf-8"></script>
|
17
|
+
<script src="../js/quicksearch.js" type="text/javascript"
|
18
|
+
charset="utf-8"></script>
|
19
|
+
<script src="../js/darkfish.js" type="text/javascript"
|
20
|
+
charset="utf-8"></script>
|
21
|
+
</head>
|
22
|
+
|
23
|
+
<body class="file file-popup">
|
24
|
+
<div id="metadata">
|
25
|
+
<dl>
|
26
|
+
<dt class="modified-date">Last Modified</dt>
|
27
|
+
<dd class="modified-date">Thu Mar 31 10:11:31 -0700 2011</dd>
|
28
|
+
|
29
|
+
|
30
|
+
<dt class="requires">Requires</dt>
|
31
|
+
<dd class="requires">
|
32
|
+
<ul>
|
33
|
+
|
34
|
+
<li>app_controller_client</li>
|
35
|
+
|
36
|
+
<li>common_functions</li>
|
37
|
+
|
38
|
+
</ul>
|
39
|
+
</dd>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
</dl>
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="documentation">
|
47
|
+
|
48
|
+
<div class="description">
|
49
|
+
<h2>Description</h2>
|
50
|
+
|
51
|
+
</div>
|
52
|
+
|
53
|
+
</div>
|
54
|
+
</body>
|
55
|
+
</html>
|
56
|
+
|
data/lib/common_functions.rb
CHANGED
@@ -15,7 +15,6 @@ require 'yaml'
|
|
15
15
|
# often needed to determine which machine should be used for computation
|
16
16
|
# or to copy over code and input files.
|
17
17
|
module CommonFunctions
|
18
|
-
|
19
18
|
# Copies a file to the Shadow node (head node) within AppScale.
|
20
19
|
# The caller specifies
|
21
20
|
# the local file location, the destination where the file should be
|
data/lib/neptune.rb
CHANGED
@@ -68,8 +68,8 @@ def preprocess_compile(job_data)
|
|
68
68
|
keyname = job_data["@keyname"]
|
69
69
|
shadow_ip = CommonFunctions.get_from_yaml(keyname, :shadow)
|
70
70
|
|
71
|
-
ssh_args = "-i ~/.appscale/#{keyname}.key -o StrictHostkeyChecking=no
|
72
|
-
remove_dir = "ssh #{ssh_args} 'rm -rf #{dest}'"
|
71
|
+
ssh_args = "-i ~/.appscale/#{keyname}.key -o StrictHostkeyChecking=no root@#{shadow_ip}"
|
72
|
+
remove_dir = "ssh #{ssh_args} 'rm -rf #{dest}' 2>&1"
|
73
73
|
#puts remove_dir
|
74
74
|
`#{remove_dir}`
|
75
75
|
|
@@ -99,9 +99,10 @@ end
|
|
99
99
|
# specified to us to copy over an input file, we do that as well:
|
100
100
|
# AppScale will copy it into HDFS for us.
|
101
101
|
def preprocess_mapreduce(job_data)
|
102
|
-
|
102
|
+
return
|
103
|
+
#items_to_copy = ["@map", "@reduce"] if job_data["@map"] and job_data["@reduce"]
|
103
104
|
items_to_copy = ["@mapreducejar"] if job_data["@mapreducejar"]
|
104
|
-
items_to_copy << "@input" if job_data["@copy_input"]
|
105
|
+
#items_to_copy << "@input" if job_data["@copy_input"]
|
105
106
|
items_to_copy.each { |item|
|
106
107
|
source = File.expand_path(job_data[item])
|
107
108
|
unless File.exists?(source)
|
@@ -150,7 +151,9 @@ def preprocess_mpi(job_data)
|
|
150
151
|
dest_code = "/tmp/thempicode"
|
151
152
|
|
152
153
|
keyname = job_data["@keyname"]
|
154
|
+
puts "Copying over code..."
|
153
155
|
CommonFunctions.scp_to_shadow(source_code, dest_code, keyname)
|
156
|
+
puts "Done copying code!"
|
154
157
|
end
|
155
158
|
|
156
159
|
# TODO: actually use me!
|
@@ -190,6 +193,11 @@ def neptune(params)
|
|
190
193
|
job_data["@keyname"] = keyname || "appscale"
|
191
194
|
type = job_data["@type"]
|
192
195
|
|
196
|
+
if type == "upc" or type == "x10"
|
197
|
+
job_data["@type"] = "mpi"
|
198
|
+
type = "mpi"
|
199
|
+
end
|
200
|
+
|
193
201
|
if job_data["@nodes_to_use"].class == Hash
|
194
202
|
job_data["@nodes_to_use"] = job_data["@nodes_to_use"].to_a.flatten
|
195
203
|
end
|
@@ -232,16 +240,6 @@ def neptune(params)
|
|
232
240
|
end
|
233
241
|
end
|
234
242
|
}
|
235
|
-
|
236
|
-
# the rightscale gems won't take the s3 url if it has http or https on
|
237
|
-
# the front, so rip it off first - it also doesn't like a trailing slash
|
238
|
-
s3_url = job_data["@S3_URL"]
|
239
|
-
puts "s3 url is now #{s3_url}"
|
240
|
-
if s3_url =~ /\Ahttp[s]?:\/\/(.*)\/\Z/
|
241
|
-
s3_url = $1
|
242
|
-
end
|
243
|
-
puts "s3 url is now #{s3_url}"
|
244
|
-
job_data["@S3_URL"] = s3_url
|
245
243
|
end
|
246
244
|
else
|
247
245
|
job_data["@storage"] = "appdb"
|
@@ -257,7 +255,7 @@ def neptune(params)
|
|
257
255
|
|
258
256
|
do_preprocessing(job_data)
|
259
257
|
|
260
|
-
ssh_args = "-i ~/.appscale/#{keyname}.key -o StrictHostkeyChecking=no
|
258
|
+
ssh_args = "-i ~/.appscale/#{keyname}.key -o StrictHostkeyChecking=no "
|
261
259
|
|
262
260
|
if type == "input"
|
263
261
|
# copy file to remote
|
@@ -275,6 +273,7 @@ def neptune(params)
|
|
275
273
|
`#{scp_cmd}`
|
276
274
|
|
277
275
|
job_data["@local"] = remote
|
276
|
+
puts "job data = #{job_data.inspect}"
|
278
277
|
return controller.put_input(job_data)
|
279
278
|
elsif type == "output"
|
280
279
|
return controller.get_output(job_data)
|
@@ -290,7 +289,7 @@ def neptune(params)
|
|
290
289
|
copy_to = job_data["@copy_to"]
|
291
290
|
|
292
291
|
loop {
|
293
|
-
ssh_command = "ssh #{ssh_args} root@#{shadow_ip} 'ls #{compiled_location}'"
|
292
|
+
ssh_command = "ssh #{ssh_args} root@#{shadow_ip} 'ls #{compiled_location}' 2>&1"
|
294
293
|
#puts ssh_command
|
295
294
|
result = `#{ssh_command}`
|
296
295
|
#puts "result was [#{result}]"
|
@@ -307,8 +306,8 @@ def neptune(params)
|
|
307
306
|
#puts rm_local
|
308
307
|
`#{rm_local}`
|
309
308
|
|
310
|
-
scp_command = "scp -r #{ssh_args}:#{compiled_location} #{copy_to}"
|
311
|
-
|
309
|
+
scp_command = "scp -r #{ssh_args} root@#{shadow_ip}:#{compiled_location} #{copy_to} 2>&1"
|
310
|
+
puts scp_command
|
312
311
|
`#{scp_command}`
|
313
312
|
|
314
313
|
out = File.open("#{copy_to}/compile_out") { |f| f.read.chomp! }
|
data/test/tc_c.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
|
2
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
3
|
+
require 'neptune'
|
4
|
+
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "test")
|
6
|
+
require 'test_helper'
|
7
|
+
|
8
|
+
require 'test/unit'
|
9
|
+
|
10
|
+
class TestC < Test::Unit::TestCase
|
11
|
+
# unlike the other language interfaces, we don't run c code yet
|
12
|
+
# just compile it - this may change in the future
|
13
|
+
|
14
|
+
def test_c_compile
|
15
|
+
ring_code = <<BAZ
|
16
|
+
#include <stdio.h>
|
17
|
+
|
18
|
+
int main() {
|
19
|
+
printf("hello world!");
|
20
|
+
return 0;
|
21
|
+
}
|
22
|
+
BAZ
|
23
|
+
|
24
|
+
contents = TestHelper.get_random_alphanumeric(1024)
|
25
|
+
folder = "hello-world-#{TestHelper.get_random_alphanumeric}"
|
26
|
+
source = "HelloWorld.c"
|
27
|
+
|
28
|
+
tmp_folder = "/tmp/#{folder}"
|
29
|
+
FileUtils.mkdir_p(tmp_folder)
|
30
|
+
compiled = "#{tmp_folder}-compiled"
|
31
|
+
compiled_code = "#{compiled}/HelloWorld"
|
32
|
+
|
33
|
+
local = "#{tmp_folder}/#{source}"
|
34
|
+
TestHelper.write_file(local, ring_code)
|
35
|
+
|
36
|
+
output = TestHelper.get_output_location(folder)
|
37
|
+
|
38
|
+
compile_c_code(tmp_folder, source, compiled)
|
39
|
+
|
40
|
+
FileUtils.rm_rf(tmp_folder)
|
41
|
+
FileUtils.rm_rf(compiled)
|
42
|
+
end
|
43
|
+
|
44
|
+
def compile_c_code(location, main_file, compiled)
|
45
|
+
std_out, std_err = TestHelper.compile_code(location, main_file, compiled)
|
46
|
+
|
47
|
+
make = "gcc -o HelloWorld HelloWorld.c -Wall"
|
48
|
+
msg = "The C Hello World code did not compile as expected. It should have " +
|
49
|
+
"compiled with the command [#{make}] instead of [#{std_out}]."
|
50
|
+
assert(std_out.include?(make), msg)
|
51
|
+
|
52
|
+
msg = "The C Hello World code did not compile successfully. It reported " +
|
53
|
+
"the following error: #{std_err}"
|
54
|
+
assert_nil(std_err, msg)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
data/test/tc_dfsp.rb
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
|
2
|
+
class TestDFSP < Test::Unit::TestCase
|
3
|
+
def test_dfsp
|
4
|
+
STORAGE_TYPES.each { |storage|
|
5
|
+
run_dfsp(storage)
|
6
|
+
}
|
7
|
+
end
|
8
|
+
|
9
|
+
def run_dfsp(storage)
|
10
|
+
expected_output = "sim_output"
|
11
|
+
contents = TestHelper.get_random_alphanumeric(1024)
|
12
|
+
folder = "dfsp-#{TestHelper.get_random_alphanumeric}"
|
13
|
+
output = TestHelper.get_output_location(folder, storage)
|
14
|
+
|
15
|
+
start_dfsp_code(output, storage)
|
16
|
+
get_dfsp_output(output, expected_output, storage)
|
17
|
+
end
|
18
|
+
|
19
|
+
def start_dfsp_code(output, storage)
|
20
|
+
params = { :simulations => 10 }
|
21
|
+
status = TestHelper.start_job("dfsp", nil, output, storage, params)
|
22
|
+
|
23
|
+
msg = "Your job was not started successfully. The failure message " +
|
24
|
+
"reported was #{status[:msg]}"
|
25
|
+
assert_equal(status[:result], :success, msg)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_dfsp_output(output, expected, storage)
|
29
|
+
result = TestHelper.get_job_output(output, storage)
|
30
|
+
|
31
|
+
msg = "The DFSP job you ran did not return the expected result. " +
|
32
|
+
"We expected to see [#{expected}] but instead saw [#{result}]"
|
33
|
+
success = result.include?(expected)
|
34
|
+
assert(success, msg)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
data/test/tc_dwssa.rb
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
|
2
|
+
class TestDWSSA < Test::Unit::TestCase
|
3
|
+
def test_dwssa
|
4
|
+
STORAGE_TYPES.each { |storage|
|
5
|
+
run_dwssa(storage)
|
6
|
+
}
|
7
|
+
end
|
8
|
+
|
9
|
+
def run_dwssa(storage)
|
10
|
+
expected_output = ""
|
11
|
+
contents = TestHelper.get_random_alphanumeric(1024)
|
12
|
+
folder = "dwssa-#{TestHelper.get_random_alphanumeric}"
|
13
|
+
output = TestHelper.get_output_location(folder, storage)
|
14
|
+
|
15
|
+
start_dwssa_code(output, storage)
|
16
|
+
get_dwssa_output(output, expected_output, storage)
|
17
|
+
end
|
18
|
+
|
19
|
+
def start_dwssa_code(output, storage)
|
20
|
+
params = { :simulations => 10 }
|
21
|
+
status = TestHelper.start_job("cewssa", nil, output, storage, params)
|
22
|
+
|
23
|
+
msg = "Your job was not started successfully. The failure message " +
|
24
|
+
"reported was #{status[:msg]}"
|
25
|
+
assert_equal(status[:result], :success, msg)
|
26
|
+
end
|
27
|
+
|
28
|
+
def get_dwssa_output(output, expected, storage)
|
29
|
+
result = TestHelper.get_job_output(output, storage)
|
30
|
+
|
31
|
+
msg = "The dwSSA job you ran did not return the expected result. " +
|
32
|
+
"We expected to see [#{expected}] but instead saw [#{result}]"
|
33
|
+
success = result.include?(expected)
|
34
|
+
assert(success, msg)
|
35
|
+
sleep(30) # wait for appscale to free up nodes
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|