neptune 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. data/README +4 -0
  2. data/doc/BabelHelper.html +393 -376
  3. data/doc/BadConfigurationException.html +121 -127
  4. data/doc/CommonFunctions.html +237 -265
  5. data/doc/ExodusHelper.html +820 -0
  6. data/doc/ExodusTaskInfo.html +263 -0
  7. data/doc/FileNotFoundException.html +121 -127
  8. data/doc/NeptuneHelper.html +527 -592
  9. data/doc/NeptuneManagerClient.html +696 -0
  10. data/doc/NeptuneManagerException.html +139 -0
  11. data/doc/Object.html +334 -236
  12. data/doc/TaskInfo.html +428 -0
  13. data/doc/created.rid +8 -5
  14. data/doc/images/add.png +0 -0
  15. data/doc/images/delete.png +0 -0
  16. data/doc/images/tag_blue.png +0 -0
  17. data/doc/images/transparent.png +0 -0
  18. data/doc/index.html +74 -142
  19. data/doc/js/darkfish.js +99 -62
  20. data/doc/js/jquery.js +15 -29
  21. data/doc/js/navigation.js +142 -0
  22. data/doc/js/search.js +94 -0
  23. data/doc/js/search_index.js +1 -0
  24. data/doc/js/searcher.js +228 -0
  25. data/doc/table_of_contents.html +226 -0
  26. data/lib/babel.rb +116 -50
  27. data/lib/custom_exceptions.rb +2 -2
  28. data/lib/exodus.rb +311 -0
  29. data/lib/exodus_task_info.rb +36 -0
  30. data/lib/neptune.rb +52 -18
  31. data/lib/{app_controller_client.rb → neptune_manager_client.rb} +54 -38
  32. data/lib/task_info.rb +155 -0
  33. data/test/{unit/test_babel.rb → test_babel.rb} +161 -26
  34. data/test/{unit/test_common_functions.rb → test_common_functions.rb} +1 -1
  35. data/test/test_exodus.rb +687 -0
  36. data/test/{unit/test_neptune.rb → test_neptune.rb} +28 -17
  37. data/test/{unit/test_app_controller_client.rb → test_neptune_manager_client.rb} +15 -16
  38. data/test/test_task_info.rb +32 -0
  39. data/test/{unit/ts_all.rb → ts_all.rb} +3 -1
  40. metadata +30 -34
  41. data/doc/AppControllerClient.html +0 -702
  42. data/doc/AppControllerException.html +0 -145
  43. data/doc/bin/neptune.html +0 -56
  44. data/doc/js/quicksearch.js +0 -114
  45. data/doc/js/thickbox-compressed.js +0 -10
  46. data/doc/lib/app_controller_client_rb.html +0 -60
  47. data/doc/lib/babel_rb.html +0 -68
  48. data/doc/lib/common_functions_rb.html +0 -70
  49. data/doc/lib/custom_exceptions_rb.html +0 -54
  50. data/doc/lib/neptune_rb.html +0 -60
  51. data/test/integration/tc_c.rb +0 -57
  52. data/test/integration/tc_dfsp.rb +0 -37
  53. data/test/integration/tc_dwssa.rb +0 -38
  54. data/test/integration/tc_erlang.rb +0 -183
  55. data/test/integration/tc_mapreduce.rb +0 -282
  56. data/test/integration/tc_mpi.rb +0 -160
  57. data/test/integration/tc_storage.rb +0 -209
  58. data/test/integration/tc_upc.rb +0 -75
  59. data/test/integration/tc_x10.rb +0 -94
  60. data/test/integration/test_helper.rb +0 -135
  61. data/test/integration/ts_neptune.rb +0 -40
@@ -1,178 +1,173 @@
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">
1
+ <!DOCTYPE html>
2
+
3
+ <html>
5
4
  <head>
6
- <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
-
8
- <title>Module: NeptuneHelper</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="module">
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/neptune_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
42
- class="thickbox" title="lib/neptune.rb">lib/neptune.rb</a></li>
43
-
44
- </ul>
45
- </div>
46
- </div>
5
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
47
6
 
48
-
49
- </div>
7
+ <title>module NeptuneHelper - RDoc Documentation</title>
50
8
 
51
- <div id="class-metadata">
9
+ <link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">
52
10
 
53
- <!-- Parent Class -->
54
-
11
+ <script type="text/javascript">
12
+ var rdoc_rel_prefix = "./";
13
+ </script>
55
14
 
56
- <!-- Namespace Contents -->
57
-
15
+ <script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
16
+ <script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
17
+ <script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
18
+ <script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
19
+ <script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
20
+ <script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>
58
21
 
59
- <!-- Method Quickref -->
60
-
61
- <div id="method-list-section" class="section">
62
- <h3 class="section-header">Methods</h3>
63
- <ul class="link-list">
64
-
65
- <li><a href="#method-c-compile_code">::compile_code</a></li>
66
-
67
- <li><a href="#method-c-do_preprocessing">::do_preprocessing</a></li>
68
-
69
- <li><a href="#method-c-get_input">::get_input</a></li>
70
-
71
- <li><a href="#method-c-get_job_data">::get_job_data</a></li>
72
-
73
- <li><a href="#method-c-get_std_out_and_err">::get_std_out_and_err</a></li>
74
-
75
- <li><a href="#method-c-preprocess_babel">::preprocess_babel</a></li>
76
-
77
- <li><a href="#method-c-preprocess_compile">::preprocess_compile</a></li>
78
-
79
- <li><a href="#method-c-preprocess_erlang">::preprocess_erlang</a></li>
80
-
81
- <li><a href="#method-c-preprocess_mpi">::preprocess_mpi</a></li>
82
-
83
- <li><a href="#method-c-preprocess_ssa">::preprocess_ssa</a></li>
84
-
85
- <li><a href="#method-c-require_file_to_exist">::require_file_to_exist</a></li>
86
-
87
- <li><a href="#method-c-require_file_to_not_exist">::require_file_to_not_exist</a></li>
88
-
89
- <li><a href="#method-c-require_param">::require_param</a></li>
90
-
91
- <li><a href="#method-c-run_job">::run_job</a></li>
92
-
93
- <li><a href="#method-c-upload_app_for_cicero">::upload_app_for_cicero</a></li>
94
-
95
- <li><a href="#method-c-validate_storage_params">::validate_storage_params</a></li>
96
-
97
- <li><a href="#method-c-wait_for_compilation_to_finish">::wait_for_compilation_to_finish</a></li>
98
-
99
- </ul>
100
- </div>
101
-
102
22
 
103
- <!-- Included Modules -->
104
-
105
- </div>
23
+ <body id="top" class="module">
24
+ <nav id="metadata">
25
+ <nav id="home-section" class="section">
26
+ <h3 class="section-header">
27
+ <a href="./index.html">Home</a>
28
+ <a href="./table_of_contents.html#classes">Classes</a>
29
+ <a href="./table_of_contents.html#methods">Methods</a>
30
+ </h3>
31
+ </nav>
106
32
 
107
- <div id="project-metadata">
108
-
109
-
110
33
 
111
- <div id="classindex-section" class="section project-section">
112
- <h3 class="section-header">Class/Module Index
113
- <span class="search-toggle"><img src="./images/find.png"
114
- height="16" width="16" alt="[+]"
115
- title="show/hide quicksearch" /></span></h3>
116
- <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
117
- <fieldset>
118
- <legend>Quicksearch</legend>
119
- <input type="text" name="quicksearch" value=""
120
- class="quicksearch-field" />
121
- </fieldset>
122
- </form>
34
+ <nav id="search-section" class="section project-section" class="initially-hidden">
35
+ <form action="#" method="get" accept-charset="utf-8">
36
+ <h3 class="section-header">
37
+ <input type="text" name="search" placeholder="Search" id="search-field"
38
+ title="Type to search, Up and Down to navigate, Enter to load">
39
+ </h3>
40
+ </form>
41
+
42
+ <ul id="search-results" class="initially-hidden"></ul>
43
+ </nav>
123
44
 
124
- <ul class="link-list">
125
-
126
- <li><a href="./AppControllerClient.html">AppControllerClient</a></li>
127
-
128
- <li><a href="./AppControllerException.html">AppControllerException</a></li>
129
-
130
- <li><a href="./BabelHelper.html">BabelHelper</a></li>
131
-
132
- <li><a href="./BadConfigurationException.html">BadConfigurationException</a></li>
133
-
134
- <li><a href="./CommonFunctions.html">CommonFunctions</a></li>
135
-
136
- <li><a href="./FileNotFoundException.html">FileNotFoundException</a></li>
137
-
138
- <li><a href="./NeptuneHelper.html">NeptuneHelper</a></li>
139
-
140
- <li><a href="./Object.html">Object</a></li>
141
-
142
- </ul>
143
- <div id="no-class-search-results" style="display: none;">No matching classes.</div>
144
- </div>
145
45
 
146
-
147
- </div>
46
+ <div id="file-metadata">
47
+ <nav id="file-list-section" class="section">
48
+ <h3 class="section-header">Defined In</h3>
49
+ <ul>
50
+ <li>lib/neptune.rb
51
+ </ul>
52
+ </nav>
53
+
54
+
148
55
  </div>
149
56
 
150
- <div id="documentation">
151
- <h1 class="module">NeptuneHelper</h1>
57
+ <div id="class-metadata">
58
+
59
+
60
+
61
+ <!-- Method Quickref -->
62
+ <nav id="method-list-section" class="section">
63
+ <h3 class="section-header">Methods</h3>
152
64
 
153
- <div id="description">
154
-
65
+ <ul class="link-list">
66
+
67
+ <li><a href="#method-c-compile_code">::compile_code</a>
68
+
69
+ <li><a href="#method-c-do_preprocessing">::do_preprocessing</a>
70
+
71
+ <li><a href="#method-c-get_input">::get_input</a>
72
+
73
+ <li><a href="#method-c-get_job_data">::get_job_data</a>
74
+
75
+ <li><a href="#method-c-get_std_out_and_err">::get_std_out_and_err</a>
76
+
77
+ <li><a href="#method-c-preprocess_babel">::preprocess_babel</a>
78
+
79
+ <li><a href="#method-c-preprocess_compile">::preprocess_compile</a>
80
+
81
+ <li><a href="#method-c-preprocess_erlang">::preprocess_erlang</a>
82
+
83
+ <li><a href="#method-c-preprocess_mpi">::preprocess_mpi</a>
84
+
85
+ <li><a href="#method-c-preprocess_ssa">::preprocess_ssa</a>
86
+
87
+ <li><a href="#method-c-require_file_to_exist">::require_file_to_exist</a>
88
+
89
+ <li><a href="#method-c-require_file_to_not_exist">::require_file_to_not_exist</a>
90
+
91
+ <li><a href="#method-c-require_param">::require_param</a>
92
+
93
+ <li><a href="#method-c-run_job">::run_job</a>
94
+
95
+ <li><a href="#method-c-upload_app_for_cicero">::upload_app_for_cicero</a>
96
+
97
+ <li><a href="#method-c-validate_storage_params">::validate_storage_params</a>
98
+
99
+ <li><a href="#method-c-wait_for_compilation_to_finish">::wait_for_compilation_to_finish</a>
100
+
101
+ </ul>
102
+ </nav>
103
+
104
+ </div>
105
+
106
+ <div id="project-metadata">
107
+
108
+ <nav id="classindex-section" class="section project-section">
109
+ <h3 class="section-header">Class and Module Index</h3>
110
+
111
+ <ul class="link-list">
112
+
113
+ <li><a href="./BabelHelper.html">BabelHelper</a>
114
+
115
+ <li><a href="./BadConfigurationException.html">BadConfigurationException</a>
116
+
117
+ <li><a href="./CommonFunctions.html">CommonFunctions</a>
118
+
119
+ <li><a href="./ExodusHelper.html">ExodusHelper</a>
120
+
121
+ <li><a href="./ExodusTaskInfo.html">ExodusTaskInfo</a>
122
+
123
+ <li><a href="./FileNotFoundException.html">FileNotFoundException</a>
124
+
125
+ <li><a href="./NeptuneHelper.html">NeptuneHelper</a>
126
+
127
+ <li><a href="./NeptuneManagerClient.html">NeptuneManagerClient</a>
128
+
129
+ <li><a href="./NeptuneManagerException.html">NeptuneManagerException</a>
130
+
131
+ <li><a href="./Object.html">Object</a>
132
+
133
+ <li><a href="./TaskInfo.html">TaskInfo</a>
134
+
135
+ </ul>
136
+ </nav>
137
+
138
+ </div>
139
+ </nav>
140
+
141
+ <div id="documentation">
142
+ <h1 class="module">module NeptuneHelper</h1>
143
+
144
+ <div id="description" class="description">
145
+
155
146
  <p><a href="NeptuneHelper.html">NeptuneHelper</a> provides methods that are
156
147
  used by neptune() and babel() to validate parameters and run the user’s
157
148
  job.</p>
158
149
 
159
- </div>
150
+ </div><!-- description -->
151
+
152
+
153
+
154
+
155
+ <section id="5Buntitled-5D" class="documentation-section">
156
+
157
+
158
+
160
159
 
161
- <!-- Constants -->
162
160
 
163
161
 
164
- <!-- Attributes -->
165
162
 
166
163
 
167
164
  <!-- Methods -->
168
165
 
169
- <div id="public-class-method-details" class="method-section section">
166
+ <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
170
167
  <h3 class="section-header">Public Class Methods</h3>
171
168
 
172
169
 
173
- <div id="compile_code-method" class="method-detail ">
174
- <a name="method-c-compile_code"></a>
175
-
170
+ <div id="method-c-compile_code" class="method-detail ">
176
171
 
177
172
  <div class="method-heading">
178
173
  <span class="method-name">compile_code</span><span
@@ -190,46 +185,42 @@ indicates whether or not the compilation was successful.</p>
190
185
 
191
186
 
192
187
 
193
- <div class="method-source-code"
194
- id="compile_code-source">
195
- <pre>
196
- <span class="ruby-comment"># File lib/neptune.rb, line 424</span>
197
- def self.compile_code(job_data, ssh_args, shadow_ip)
198
- compiled_location = controller.compile_code(job_data)
199
- copy_to = job_data[<span class="ruby-string">&quot;@copy_to&quot;</span>]
200
- self.wait_for_compilation_to_finish(ssh_args, shadow_ip, compiled_location)
188
+ <div class="method-source-code" id="compile_code-source">
189
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 458</span>
190
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">compile_code</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>)
191
+ <span class="ruby-identifier">compiled_location</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">compile_code</span>(<span class="ruby-identifier">job_data</span>)
192
+ <span class="ruby-identifier">copy_to</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@copy_to&quot;</span>]
193
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">wait_for_compilation_to_finish</span>(<span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">compiled_location</span>)
201
194
 
202
- <span class="ruby-constant">FileUtils</span>.rm_rf(copy_to)
195
+ <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">rm_rf</span>(<span class="ruby-identifier">copy_to</span>)
203
196
 
204
- scp_command = &quot;scp -r #{ssh_args} root@#{shadow_ip}:#{compiled_location} #{copy_to} 2&gt;&amp;1&quot;
197
+ <span class="ruby-identifier">scp_command</span> = <span class="ruby-node">&quot;scp -r #{ssh_args} root@#{shadow_ip}:#{compiled_location} #{copy_to} 2&gt;&amp;1&quot;</span>
205
198
  <span class="ruby-comment"># Kernel.puts scp_command</span>
206
- <span class="ruby-constant">CommonFunctions</span>.shell(scp_command)
199
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-identifier">scp_command</span>)
207
200
 
208
- code = job_data[<span class="ruby-string">&quot;@code&quot;</span>]
209
- dirs = code.split(<span class="ruby-regexp">/\//</span>)
210
- remote_dir = <span class="ruby-string">&quot;/tmp/&quot;</span> + dirs[-1]
201
+ <span class="ruby-identifier">code</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@code&quot;</span>]
202
+ <span class="ruby-identifier">dirs</span> = <span class="ruby-identifier">code</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp">%r\//</span>)
203
+ <span class="ruby-identifier">remote_dir</span> = <span class="ruby-string">&quot;/tmp/&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">dirs</span>[<span class="ruby-value">-1</span>]
211
204
 
212
- [remote_dir, compiled_location].each { |remote_files|
213
- ssh_command = &quot;ssh #{ssh_args} root@#{shadow_ip} 'rm -rf #{remote_files}' 2&gt;&amp;1&quot;
205
+ [<span class="ruby-identifier">remote_dir</span>, <span class="ruby-identifier">compiled_location</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">remote_files</span><span class="ruby-operator">|</span>
206
+ <span class="ruby-identifier">ssh_command</span> = <span class="ruby-node">&quot;ssh #{ssh_args} root@#{shadow_ip} 'rm -rf #{remote_files}' 2&gt;&amp;1&quot;</span>
214
207
  <span class="ruby-comment"># Kernel.puts ssh_command</span>
215
- <span class="ruby-constant">CommonFunctions</span>.shell(ssh_command)
208
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-identifier">ssh_command</span>)
216
209
  }
217
210
 
218
- return get_std_out_and_err(copy_to)
219
- end</pre>
220
- </div>
211
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">get_std_out_and_err</span>(<span class="ruby-identifier">copy_to</span>)
212
+ <span class="ruby-keyword">end</span></pre>
213
+ </div><!-- compile_code-source -->
221
214
 
222
215
  </div>
223
216
 
224
217
 
225
218
 
226
219
 
227
- </div>
220
+ </div><!-- compile_code-method -->
228
221
 
229
222
 
230
- <div id="do_preprocessing-method" class="method-detail ">
231
- <a name="method-c-do_preprocessing"></a>
232
-
223
+ <div id="method-c-do_preprocessing" class="method-detail ">
233
224
 
234
225
  <div class="method-heading">
235
226
  <span class="method-name">do_preprocessing</span><span
@@ -246,34 +237,30 @@ method to use based on the type of the job that the user has asked to run.</p>
246
237
 
247
238
 
248
239
 
249
- <div class="method-source-code"
250
- id="do_preprocessing-source">
251
- <pre>
252
- <span class="ruby-comment"># File lib/neptune.rb, line 87</span>
253
- def self.do_preprocessing(job_data, controller)
254
- job_type = job_data[<span class="ruby-string">&quot;@type&quot;</span>]
255
- if !<span class="ruby-constant">NEED_PREPROCESSING</span>.include?(job_type)
256
- return
257
- end
240
+ <div class="method-source-code" id="do_preprocessing-source">
241
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 114</span>
242
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">do_preprocessing</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
243
+ <span class="ruby-identifier">job_type</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>]
244
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">NEED_PREPROCESSING</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">job_type</span>)
245
+ <span class="ruby-keyword">return</span>
246
+ <span class="ruby-keyword">end</span>
258
247
 
259
248
  <span class="ruby-comment"># Don't worry about adding on the self. prefix - send will resolve</span>
260
249
  <span class="ruby-comment"># it the right way</span>
261
- preprocess = &quot;preprocess_#{job_type}&quot;.to_sym
262
- send(preprocess, job_data, controller)
263
- end</pre>
264
- </div>
250
+ <span class="ruby-identifier">preprocess</span> = <span class="ruby-node">&quot;preprocess_#{job_type}&quot;</span>.<span class="ruby-identifier">to_sym</span>
251
+ <span class="ruby-identifier">send</span>(<span class="ruby-identifier">preprocess</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
252
+ <span class="ruby-keyword">end</span></pre>
253
+ </div><!-- do_preprocessing-source -->
265
254
 
266
255
  </div>
267
256
 
268
257
 
269
258
 
270
259
 
271
- </div>
260
+ </div><!-- do_preprocessing-method -->
272
261
 
273
262
 
274
- <div id="get_input-method" class="method-detail ">
275
- <a name="method-c-get_input"></a>
276
-
263
+ <div id="method-c-get_input" class="method-detail ">
277
264
 
278
265
  <div class="method-heading">
279
266
  <span class="method-name">get_input</span><span
@@ -290,50 +277,46 @@ job succeeded and if it failed, the reason for it.</p>
290
277
 
291
278
 
292
279
 
293
- <div class="method-source-code"
294
- id="get_input-source">
295
- <pre>
296
- <span class="ruby-comment"># File lib/neptune.rb, line 372</span>
297
- def self.get_input(job_data, ssh_args, shadow_ip, controller)
298
- result = {:result =&gt; :success}
280
+ <div class="method-source-code" id="get_input-source">
281
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 406</span>
282
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_input</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">controller</span>)
283
+ <span class="ruby-identifier">result</span> = {<span class="ruby-value">:result</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">:success</span>}
299
284
 
300
- self.require_param(<span class="ruby-string">&quot;@local&quot;</span>, job_data)
285
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@local&quot;</span>, <span class="ruby-identifier">job_data</span>)
301
286
 
302
- local_file = <span class="ruby-constant">File</span>.expand_path(job_data[<span class="ruby-string">&quot;@local&quot;</span>])
303
- if !<span class="ruby-constant">File</span>.exists?(local_file)
304
- reason = &quot;the file you specified to copy, #{local_file}, doesn't exist.&quot; +
287
+ <span class="ruby-identifier">local_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@local&quot;</span>])
288
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">local_file</span>)
289
+ <span class="ruby-identifier">reason</span> = <span class="ruby-node">&quot;the file you specified to copy, #{local_file}, doesn't exist.&quot;</span> <span class="ruby-operator">+</span>
305
290
  <span class="ruby-string">&quot; Please specify a file that exists and try again.&quot;</span>
306
- return {:result =&gt; :failure, :reason =&gt; reason}
307
- end
291
+ <span class="ruby-keyword">return</span> {<span class="ruby-value">:result</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">:failure</span>, <span class="ruby-value">:reason</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">reason</span>}
292
+ <span class="ruby-keyword">end</span>
308
293
 
309
- remote = &quot;/tmp/neptune-input-#{rand(100000)}&quot;
310
- scp_cmd = &quot;scp -r #{ssh_args} #{local_file} root@#{shadow_ip}:#{remote}&quot;
294
+ <span class="ruby-identifier">remote</span> = <span class="ruby-node">&quot;/tmp/neptune-input-#{rand(100000)}&quot;</span>
295
+ <span class="ruby-identifier">scp_cmd</span> = <span class="ruby-node">&quot;scp -r #{ssh_args} #{local_file} root@#{shadow_ip}:#{remote}&quot;</span>
311
296
  <span class="ruby-comment"># Kernel.puts scp_cmd</span>
312
- <span class="ruby-constant">CommonFunctions</span>.shell(scp_cmd)
297
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-identifier">scp_cmd</span>)
313
298
 
314
- job_data[<span class="ruby-string">&quot;@local&quot;</span>] = remote
299
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@local&quot;</span>] = <span class="ruby-identifier">remote</span>
315
300
  <span class="ruby-comment"># Kernel.puts &quot;job data = #{job_data.inspect}&quot;</span>
316
- response = controller.put_input(job_data)
317
- if response
318
- return {:result =&gt; :success}
319
- else
301
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">put_input</span>(<span class="ruby-identifier">job_data</span>)
302
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">response</span>
303
+ <span class="ruby-keyword">return</span> {<span class="ruby-value">:result</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">:success</span>}
304
+ <span class="ruby-keyword">else</span>
320
305
  <span class="ruby-comment"># TODO - expand this to include the reason why it failed</span>
321
- return {:result =&gt; :failure}
322
- end
323
- end</pre>
324
- </div>
306
+ <span class="ruby-keyword">return</span> {<span class="ruby-value">:result</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">:failure</span>}
307
+ <span class="ruby-keyword">end</span>
308
+ <span class="ruby-keyword">end</span></pre>
309
+ </div><!-- get_input-source -->
325
310
 
326
311
  </div>
327
312
 
328
313
 
329
314
 
330
315
 
331
- </div>
316
+ </div><!-- get_input-method -->
332
317
 
333
318
 
334
- <div id="get_job_data-method" class="method-detail ">
335
- <a name="method-c-get_job_data"></a>
336
-
319
+ <div id="method-c-get_job_data" class="method-detail ">
337
320
 
338
321
  <div class="method-heading">
339
322
  <span class="method-name">get_job_data</span><span
@@ -347,74 +330,70 @@ end</pre>
347
330
  <p>This method takes in a hash in the format that users write neptune/babel
348
331
  jobs in {:a =&gt; “b”} and converts it to the legacy format that
349
332
  Neptune used to use {“@a” =&gt; “b”}, and is understood by the
350
- AppController.</p>
333
+ NeptuneManager.</p>
351
334
 
352
335
 
353
336
 
354
- <div class="method-source-code"
355
- id="get_job_data-source">
356
- <pre>
357
- <span class="ruby-comment"># File lib/neptune.rb, line 279</span>
358
- def self.get_job_data(params)
359
- job_data = {}
360
- params.each { |k, v|
361
- key = &quot;@#{k}&quot;
362
- job_data[key] = v
337
+ <div class="method-source-code" id="get_job_data-source">
338
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 313</span>
339
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_job_data</span>(<span class="ruby-identifier">params</span>)
340
+ <span class="ruby-identifier">job_data</span> = {}
341
+ <span class="ruby-identifier">params</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
342
+ <span class="ruby-identifier">key</span> = <span class="ruby-node">&quot;@#{k}&quot;</span>
343
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">v</span>
363
344
  }
364
345
 
365
- job_data.delete(<span class="ruby-string">&quot;@job&quot;</span>)
366
- job_data[<span class="ruby-string">&quot;@keyname&quot;</span>] = params[:keyname] || <span class="ruby-string">&quot;appscale&quot;</span>
346
+ <span class="ruby-identifier">job_data</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;@job&quot;</span>)
347
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@keyname&quot;</span>] = <span class="ruby-identifier">params</span>[<span class="ruby-value">:keyname</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;appscale&quot;</span>
367
348
 
368
- job_data[<span class="ruby-string">&quot;@type&quot;</span>] = job_data[<span class="ruby-string">&quot;@type&quot;</span>].to_s
369
- type = job_data[<span class="ruby-string">&quot;@type&quot;</span>]
349
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>].<span class="ruby-identifier">to_s</span>
350
+ <span class="ruby-identifier">type</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>]
370
351
 
371
- if !<span class="ruby-constant">ALLOWED_JOB_TYPES</span>.include?(type)
372
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-constant">JOB_TYPE_NOT_ALLOWED</span>)
373
- end
352
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">ALLOWED_JOB_TYPES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
353
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">JOB_TYPE_NOT_ALLOWED</span>)
354
+ <span class="ruby-keyword">end</span>
374
355
 
375
- if type == <span class="ruby-string">&quot;upc&quot;</span> or type == <span class="ruby-string">&quot;x10&quot;</span>
376
- job_data[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;mpi&quot;</span>
377
- type = <span class="ruby-string">&quot;mpi&quot;</span>
378
- end
356
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;upc&quot;</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;x10&quot;</span>
357
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;mpi&quot;</span>
358
+ <span class="ruby-identifier">type</span> = <span class="ruby-string">&quot;mpi&quot;</span>
359
+ <span class="ruby-keyword">end</span>
379
360
 
380
361
  <span class="ruby-comment"># kdt jobs also run as mpi jobs, but need to pass along an executable</span>
381
362
  <span class="ruby-comment"># parameter to let mpiexec know to use python to exec it</span>
382
- if type == <span class="ruby-string">&quot;kdt&quot;</span>
383
- job_data[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;mpi&quot;</span>
384
- type = <span class="ruby-string">&quot;mpi&quot;</span>
363
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;kdt&quot;</span>
364
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;mpi&quot;</span>
365
+ <span class="ruby-identifier">type</span> = <span class="ruby-string">&quot;mpi&quot;</span>
385
366
 
386
- job_data[<span class="ruby-string">&quot;@executable&quot;</span>] = <span class="ruby-string">&quot;python&quot;</span>
387
- end
367
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@executable&quot;</span>] = <span class="ruby-string">&quot;python&quot;</span>
368
+ <span class="ruby-keyword">end</span>
388
369
 
389
- if job_data[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>].class == <span class="ruby-constant">Hash</span>
390
- job_data[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>] = job_data[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>].to_a.flatten
391
- end
370
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>].<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Hash</span>
371
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>] = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>].<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">flatten</span>
372
+ <span class="ruby-keyword">end</span>
392
373
 
393
- if !<span class="ruby-constant">NO_OUTPUT_NEEDED</span>.include?(type)
394
- if (job_data[<span class="ruby-string">&quot;@output&quot;</span>].nil? or job_data[<span class="ruby-string">&quot;@output&quot;</span>].empty?)
395
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;Job output must be specified&quot;</span>)
396
- end
374
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">NO_OUTPUT_NEEDED</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">type</span>)
375
+ <span class="ruby-keyword">if</span> (<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@output&quot;</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@output&quot;</span>].<span class="ruby-identifier">empty?</span>)
376
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;Job output must be specified&quot;</span>)
377
+ <span class="ruby-keyword">end</span>
397
378
 
398
- if job_data[<span class="ruby-string">&quot;@output&quot;</span>][0].chr != <span class="ruby-string">&quot;/&quot;</span>
399
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;Job output must begin with a slash ('/')&quot;</span>)
400
- end
401
- end
379
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@output&quot;</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">chr</span> <span class="ruby-operator">!=</span> <span class="ruby-string">&quot;/&quot;</span>
380
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;Job output must begin with a slash ('/')&quot;</span>)
381
+ <span class="ruby-keyword">end</span>
382
+ <span class="ruby-keyword">end</span>
402
383
 
403
- return job_data
404
- end</pre>
405
- </div>
384
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">job_data</span>
385
+ <span class="ruby-keyword">end</span></pre>
386
+ </div><!-- get_job_data-source -->
406
387
 
407
388
  </div>
408
389
 
409
390
 
410
391
 
411
392
 
412
- </div>
393
+ </div><!-- get_job_data-method -->
413
394
 
414
395
 
415
- <div id="get_std_out_and_err-method" class="method-detail ">
416
- <a name="method-c-get_std_out_and_err"></a>
417
-
396
+ <div id="method-c-get_std_out_and_err" class="method-detail ">
418
397
 
419
398
  <div class="method-heading">
420
399
  <span class="method-name">get_std_out_and_err</span><span
@@ -431,40 +410,36 @@ not the job completed successfully (success = no errors).</p>
431
410
 
432
411
 
433
412
 
434
- <div class="method-source-code"
435
- id="get_std_out_and_err-source">
436
- <pre>
437
- <span class="ruby-comment"># File lib/neptune.rb, line 452</span>
438
- def self.get_std_out_and_err(location)
439
- result = {}
413
+ <div class="method-source-code" id="get_std_out_and_err-source">
414
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 486</span>
415
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_std_out_and_err</span>(<span class="ruby-identifier">location</span>)
416
+ <span class="ruby-identifier">result</span> = {}
440
417
 
441
- out = <span class="ruby-constant">File</span>.open(&quot;#{location}/compile_out&quot;) { |f| f.read.chomp! }
442
- result[:out] = out
418
+ <span class="ruby-identifier">out</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-node">&quot;#{location}/compile_out&quot;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>.<span class="ruby-identifier">chomp!</span> }
419
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:out</span>] = <span class="ruby-identifier">out</span>
443
420
 
444
- err = <span class="ruby-constant">File</span>.open(&quot;#{location}/compile_err&quot;) { |f| f.read.chomp! }
445
- result[:err] = err
421
+ <span class="ruby-identifier">err</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-node">&quot;#{location}/compile_err&quot;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span> <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>.<span class="ruby-identifier">chomp!</span> }
422
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:err</span>] = <span class="ruby-identifier">err</span>
446
423
 
447
- if result[:err]
448
- result[:result] = :failure
449
- else
450
- result[:result] = :success
451
- end
424
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">:err</span>]
425
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:result</span>] = <span class="ruby-value">:failure</span>
426
+ <span class="ruby-keyword">else</span>
427
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:result</span>] = <span class="ruby-value">:success</span>
428
+ <span class="ruby-keyword">end</span>
452
429
 
453
- return result
454
- end</pre>
455
- </div>
430
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
431
+ <span class="ruby-keyword">end</span></pre>
432
+ </div><!-- get_std_out_and_err-source -->
456
433
 
457
434
  </div>
458
435
 
459
436
 
460
437
 
461
438
 
462
- </div>
439
+ </div><!-- get_std_out_and_err-method -->
463
440
 
464
441
 
465
- <div id="preprocess_babel-method" class="method-detail ">
466
- <a name="method-c-preprocess_babel"></a>
467
-
442
+ <div id="method-c-preprocess_babel" class="method-detail ">
468
443
 
469
444
  <div class="method-heading">
470
445
  <span class="method-name">preprocess_babel</span><span
@@ -482,66 +457,66 @@ engines can be found by contacting an AppScale node.</p>
482
457
 
483
458
 
484
459
 
485
- <div class="method-source-code"
486
- id="preprocess_babel-source">
487
- <pre>
488
- <span class="ruby-comment"># File lib/neptune.rb, line 231</span>
489
- def self.preprocess_babel(job_data, controller)
490
- self.require_param(<span class="ruby-string">&quot;@code&quot;</span>, job_data)
491
- self.require_param(<span class="ruby-string">&quot;@engine&quot;</span>, job_data)
492
- self.require_param(<span class="ruby-string">&quot;@output&quot;</span>, job_data)
460
+ <div class="method-source-code" id="preprocess_babel-source">
461
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 261</span>
462
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">preprocess_babel</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
463
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@code&quot;</span>, <span class="ruby-identifier">job_data</span>)
464
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@engine&quot;</span>, <span class="ruby-identifier">job_data</span>)
465
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@output&quot;</span>, <span class="ruby-identifier">job_data</span>)
466
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@error&quot;</span>, <span class="ruby-identifier">job_data</span>)
467
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@metadata&quot;</span>, <span class="ruby-identifier">job_data</span>)
493
468
 
494
469
  <span class="ruby-comment"># For most code types, the file's name given is the thing to exec.</span>
495
470
  <span class="ruby-comment"># For Java, the actual file to search for is whatever the user gives</span>
496
471
  <span class="ruby-comment"># us, with a .class extension.</span>
497
- code_file_name = job_data[<span class="ruby-string">&quot;@code&quot;</span>]
498
- if !job_data[<span class="ruby-string">&quot;@executable&quot;</span>].nil? and job_data[<span class="ruby-string">&quot;@executable&quot;</span>] == <span class="ruby-string">&quot;java&quot;</span>
499
- code_file_name += <span class="ruby-string">&quot;.class&quot;</span>
500
- end
501
-
502
- self.require_file_to_exist(code_file_name, job_data, controller)
503
- self.require_file_to_not_exist(job_data[<span class="ruby-string">&quot;@output&quot;</span>], job_data, controller)
504
-
505
- if job_data[<span class="ruby-string">&quot;@argv&quot;</span>]
506
- argv = job_data[<span class="ruby-string">&quot;@argv&quot;</span>]
507
- if argv.class != <span class="ruby-constant">Array</span>
508
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;argv must be an array&quot;</span>)
509
- end
510
-
511
- argv.each { |arg|
512
- if arg =~ <span class="ruby-regexp">/\/.*\/.*/</span>
513
- self.require_file_to_exist(arg, job_data, controller)
514
- end
472
+ <span class="ruby-identifier">code_file_name</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@code&quot;</span>]
473
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@executable&quot;</span>].<span class="ruby-identifier">nil?</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@executable&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-string">&quot;java&quot;</span>
474
+ <span class="ruby-identifier">code_file_name</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot;.class&quot;</span>
475
+ <span class="ruby-keyword">end</span>
476
+
477
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_exist</span>(<span class="ruby-identifier">code_file_name</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
478
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_not_exist</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@output&quot;</span>], <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
479
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_not_exist</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@error&quot;</span>], <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
480
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_not_exist</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@metadata&quot;</span>], <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
481
+
482
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@argv&quot;</span>]
483
+ <span class="ruby-identifier">argv</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@argv&quot;</span>]
484
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Array</span>
485
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;argv must be an array&quot;</span>)
486
+ <span class="ruby-keyword">end</span>
487
+
488
+ <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
489
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%r\/.*\/.*/</span>
490
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_exist</span>(<span class="ruby-identifier">arg</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
491
+ <span class="ruby-keyword">end</span>
515
492
  }
516
- end
493
+ <span class="ruby-keyword">end</span>
517
494
 
518
- if job_data[<span class="ruby-string">&quot;@appcfg_cookies&quot;</span>]
519
- self.require_file_to_exist(job_data[<span class="ruby-string">&quot;@appcfg_cookies&quot;</span>], job_data, controller)
520
- end
495
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@appcfg_cookies&quot;</span>]
496
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_exist</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@appcfg_cookies&quot;</span>], <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
497
+ <span class="ruby-keyword">end</span>
521
498
 
522
- user_specified_engine = job_data[<span class="ruby-string">&quot;@engine&quot;</span>]
499
+ <span class="ruby-identifier">user_specified_engine</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@engine&quot;</span>]
523
500
 
524
501
  <span class="ruby-comment"># validate the engine here</span>
525
- engines = controller.get_supported_babel_engines(job_data)
526
- if !engines.include?(user_specified_engine)
527
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;The engine you specified, &quot;</span> +
528
- &quot;#{user_specified_engine}, is not a supported engine. Supported engines&quot; +
529
- &quot; are: #{engines.join(', ')}&quot;)
530
- end
531
- end</pre>
532
- </div>
502
+ <span class="ruby-identifier">engines</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">get_supported_babel_engines</span>(<span class="ruby-identifier">job_data</span>)
503
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">engines</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">user_specified_engine</span>)
504
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;The engine you specified, &quot;</span> <span class="ruby-operator">+</span>
505
+ <span class="ruby-node">&quot;#{user_specified_engine}, is not a supported engine. Supported engines&quot;</span> <span class="ruby-operator">+</span>
506
+ <span class="ruby-node">&quot; are: #{engines.join(', ')}&quot;</span>)
507
+ <span class="ruby-keyword">end</span>
508
+ <span class="ruby-keyword">end</span></pre>
509
+ </div><!-- preprocess_babel-source -->
533
510
 
534
511
  </div>
535
512
 
536
513
 
537
514
 
538
515
 
539
- </div>
516
+ </div><!-- preprocess_babel-method -->
540
517
 
541
518
 
542
- <div id="preprocess_compile-method" class="method-detail ">
543
- <a name="method-c-preprocess_compile"></a>
544
-
519
+ <div id="method-c-preprocess_compile" class="method-detail ">
545
520
 
546
521
  <div class="method-heading">
547
522
  <span class="method-name">preprocess_compile</span><span
@@ -558,42 +533,38 @@ copy over libraries as well.</p>
558
533
 
559
534
 
560
535
 
561
- <div class="method-source-code"
562
- id="preprocess_compile-source">
563
- <pre>
564
- <span class="ruby-comment"># File lib/neptune.rb, line 103</span>
565
- def self.preprocess_compile(job_data, controller)
566
- code = <span class="ruby-constant">File</span>.expand_path(job_data[<span class="ruby-string">&quot;@code&quot;</span>])
567
- if !<span class="ruby-constant">File</span>.exists?(code)
568
- raise <span class="ruby-constant">BadConfigurationException</span>.new(&quot;The source file #{code} does not exist.&quot;)
569
- end
536
+ <div class="method-source-code" id="preprocess_compile-source">
537
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 130</span>
538
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">preprocess_compile</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
539
+ <span class="ruby-identifier">code</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@code&quot;</span>])
540
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">code</span>)
541
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;The source file #{code} does not exist.&quot;</span>)
542
+ <span class="ruby-keyword">end</span>
570
543
 
571
- suffix = code.split(<span class="ruby-string">'/'</span>)[-1]
572
- dest = &quot;/tmp/#{suffix}&quot;
573
- keyname = job_data[<span class="ruby-string">&quot;@keyname&quot;</span>]
574
- shadow_ip = <span class="ruby-constant">CommonFunctions</span>.get_from_yaml(keyname, :shadow)
544
+ <span class="ruby-identifier">suffix</span> = <span class="ruby-identifier">code</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'/'</span>)[<span class="ruby-value">-1</span>]
545
+ <span class="ruby-identifier">dest</span> = <span class="ruby-node">&quot;/tmp/#{suffix}&quot;</span>
546
+ <span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@keyname&quot;</span>]
547
+ <span class="ruby-identifier">shadow_ip</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">get_from_yaml</span>(<span class="ruby-identifier">keyname</span>, <span class="ruby-value">:shadow</span>)
575
548
 
576
- ssh_args = &quot;-i ~/.appscale/#{keyname}.key -o StrictHostkeyChecking=no root@#{shadow_ip}&quot;
577
- remove_dir = &quot;ssh #{ssh_args} 'rm -rf #{dest}' 2&gt;&amp;1&quot;
549
+ <span class="ruby-identifier">ssh_args</span> = <span class="ruby-node">&quot;-i ~/.appscale/#{keyname}.key -o StrictHostkeyChecking=no root@#{shadow_ip}&quot;</span>
550
+ <span class="ruby-identifier">remove_dir</span> = <span class="ruby-node">&quot;ssh #{ssh_args} 'rm -rf #{dest}' 2&gt;&amp;1&quot;</span>
578
551
  <span class="ruby-comment"># Kernel.puts remove_dir</span>
579
- <span class="ruby-constant">CommonFunctions</span>.shell(remove_dir)
580
- <span class="ruby-constant">CommonFunctions</span>.scp_to_shadow(code, dest, keyname, is_dir=true)
552
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-identifier">remove_dir</span>)
553
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">scp_to_shadow</span>(<span class="ruby-identifier">code</span>, <span class="ruby-identifier">dest</span>, <span class="ruby-identifier">keyname</span>, <span class="ruby-identifier">is_dir</span>=<span class="ruby-keyword">true</span>)
581
554
 
582
- job_data[<span class="ruby-string">&quot;@code&quot;</span>] = dest
583
- end</pre>
584
- </div>
555
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@code&quot;</span>] = <span class="ruby-identifier">dest</span>
556
+ <span class="ruby-keyword">end</span></pre>
557
+ </div><!-- preprocess_compile-source -->
585
558
 
586
559
  </div>
587
560
 
588
561
 
589
562
 
590
563
 
591
- </div>
564
+ </div><!-- preprocess_compile-method -->
592
565
 
593
566
 
594
- <div id="preprocess_erlang-method" class="method-detail ">
595
- <a name="method-c-preprocess_erlang"></a>
596
-
567
+ <div id="method-c-preprocess_erlang" class="method-detail ">
597
568
 
598
569
  <div class="method-heading">
599
570
  <span class="method-name">preprocess_erlang</span><span
@@ -609,36 +580,32 @@ and copies it over to the AppScale Shadow node.</p>
609
580
 
610
581
 
611
582
 
612
- <div class="method-source-code"
613
- id="preprocess_erlang-source">
614
- <pre>
615
- <span class="ruby-comment"># File lib/neptune.rb, line 126</span>
616
- def self.preprocess_erlang(job_data, controller)
617
- self.require_param(<span class="ruby-string">&quot;@code&quot;</span>, job_data)
583
+ <div class="method-source-code" id="preprocess_erlang-source">
584
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 153</span>
585
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">preprocess_erlang</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
586
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@code&quot;</span>, <span class="ruby-identifier">job_data</span>)
618
587
 
619
- source_code = <span class="ruby-constant">File</span>.expand_path(job_data[<span class="ruby-string">&quot;@code&quot;</span>])
620
- if !<span class="ruby-constant">File</span>.exists?(source_code)
621
- raise <span class="ruby-constant">BadConfigurationException</span>.new(&quot;The specified code, #{job_data['@code']},&quot; +
588
+ <span class="ruby-identifier">source_code</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@code&quot;</span>])
589
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">source_code</span>)
590
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;The specified code, #{job_data['@code']},&quot;</span> <span class="ruby-operator">+</span>
622
591
  <span class="ruby-string">&quot; didn't exist. Please specify one that exists and try again&quot;</span>)
623
- end
624
- dest_code = <span class="ruby-string">&quot;/tmp/&quot;</span>
592
+ <span class="ruby-keyword">end</span>
593
+ <span class="ruby-identifier">dest_code</span> = <span class="ruby-string">&quot;/tmp/&quot;</span>
625
594
 
626
- keyname = job_data[<span class="ruby-string">&quot;@keyname&quot;</span>]
627
- <span class="ruby-constant">CommonFunctions</span>.scp_to_shadow(source_code, dest_code, keyname)
628
- end</pre>
629
- </div>
595
+ <span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@keyname&quot;</span>]
596
+ <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">scp_to_shadow</span>(<span class="ruby-identifier">source_code</span>, <span class="ruby-identifier">dest_code</span>, <span class="ruby-identifier">keyname</span>)
597
+ <span class="ruby-keyword">end</span></pre>
598
+ </div><!-- preprocess_erlang-source -->
630
599
 
631
600
  </div>
632
601
 
633
602
 
634
603
 
635
604
 
636
- </div>
605
+ </div><!-- preprocess_erlang-method -->
637
606
 
638
607
 
639
- <div id="preprocess_mpi-method" class="method-detail ">
640
- <a name="method-c-preprocess_mpi"></a>
641
-
608
+ <div id="method-c-preprocess_mpi" class="method-detail ">
642
609
 
643
610
  <div class="method-heading">
644
611
  <span class="method-name">preprocess_mpi</span><span
@@ -656,50 +623,49 @@ also verify that this value is at least as many as the number of nodes
656
623
 
657
624
 
658
625
 
659
- <div class="method-source-code"
660
- id="preprocess_mpi-source">
661
- <pre>
662
- <span class="ruby-comment"># File lib/neptune.rb, line 145</span>
663
- def self.preprocess_mpi(job_data, controller)
664
- self.require_param(<span class="ruby-string">&quot;@nodes_to_use&quot;</span>, job_data)
665
- self.require_param(<span class="ruby-string">&quot;@procs_to_use&quot;</span>, job_data)
626
+ <div class="method-source-code" id="preprocess_mpi-source">
627
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 172</span>
628
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">preprocess_mpi</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
629
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@nodes_to_use&quot;</span>, <span class="ruby-identifier">job_data</span>)
630
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@procs_to_use&quot;</span>, <span class="ruby-identifier">job_data</span>)
631
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@output&quot;</span>, <span class="ruby-identifier">job_data</span>)
632
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@error&quot;</span>, <span class="ruby-identifier">job_data</span>)
633
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@metadata&quot;</span>, <span class="ruby-identifier">job_data</span>)
666
634
 
667
- if job_data[<span class="ruby-string">&quot;@procs_to_use&quot;</span>]
668
- p = job_data[<span class="ruby-string">&quot;@procs_to_use&quot;</span>]
669
- n = job_data[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>]
670
- if p &lt; n
671
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;:procs_to_use must be at least as &quot;</span> +
635
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@procs_to_use&quot;</span>]
636
+ <span class="ruby-identifier">p</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@procs_to_use&quot;</span>]
637
+ <span class="ruby-identifier">n</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@nodes_to_use&quot;</span>]
638
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">p</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">n</span>
639
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;:procs_to_use must be at least as &quot;</span> <span class="ruby-operator">+</span>
672
640
  <span class="ruby-string">&quot;large as :nodes_to_use.&quot;</span>)
673
- end
674
- end
641
+ <span class="ruby-keyword">end</span>
642
+ <span class="ruby-keyword">end</span>
675
643
 
676
- if job_data[<span class="ruby-string">&quot;@argv&quot;</span>]
677
- argv = job_data[<span class="ruby-string">&quot;@argv&quot;</span>]
644
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@argv&quot;</span>]
645
+ <span class="ruby-identifier">argv</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@argv&quot;</span>]
678
646
 
679
- if argv.class == <span class="ruby-constant">String</span>
680
- job_data[<span class="ruby-string">&quot;@argv&quot;</span>] = argv
681
- elsif argv.class == <span class="ruby-constant">Array</span>
682
- job_data[<span class="ruby-string">&quot;@argv&quot;</span>] = argv.join(<span class="ruby-string">' '</span>)
683
- else
684
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;:argv must be either a String or Array&quot;</span>)
685
- end
686
- end
647
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
648
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@argv&quot;</span>] = <span class="ruby-identifier">argv</span>
649
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Array</span>
650
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@argv&quot;</span>] = <span class="ruby-identifier">argv</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">' '</span>)
651
+ <span class="ruby-keyword">else</span>
652
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;:argv must be either a String or Array&quot;</span>)
653
+ <span class="ruby-keyword">end</span>
654
+ <span class="ruby-keyword">end</span>
687
655
 
688
- return job_data
689
- end</pre>
690
- </div>
656
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">job_data</span>
657
+ <span class="ruby-keyword">end</span></pre>
658
+ </div><!-- preprocess_mpi-source -->
691
659
 
692
660
  </div>
693
661
 
694
662
 
695
663
 
696
664
 
697
- </div>
665
+ </div><!-- preprocess_mpi-method -->
698
666
 
699
667
 
700
- <div id="preprocess_ssa-method" class="method-detail ">
701
- <a name="method-c-preprocess_ssa"></a>
702
-
668
+ <div id="method-c-preprocess_ssa" class="method-detail ">
703
669
 
704
670
  <div class="method-heading">
705
671
  <span class="method-name">preprocess_ssa</span><span
@@ -717,37 +683,33 @@ specify, convert it to be :trajectories.</p>
717
683
 
718
684
 
719
685
 
720
- <div class="method-source-code"
721
- id="preprocess_ssa-source">
722
- <pre>
723
- <span class="ruby-comment"># File lib/neptune.rb, line 178</span>
724
- def self.preprocess_ssa(job_data, controller)
725
- if job_data[<span class="ruby-string">&quot;@simulations&quot;</span>] and job_data[<span class="ruby-string">&quot;@trajectories&quot;</span>]
726
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;:simulations and :trajectories &quot;</span> +
686
+ <div class="method-source-code" id="preprocess_ssa-source">
687
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 208</span>
688
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">preprocess_ssa</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
689
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@simulations&quot;</span>] <span class="ruby-keyword">and</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@trajectories&quot;</span>]
690
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;:simulations and :trajectories &quot;</span> <span class="ruby-operator">+</span>
727
691
  <span class="ruby-string">&quot;not both be specified.&quot;</span>)
728
- end
692
+ <span class="ruby-keyword">end</span>
729
693
 
730
- if job_data[<span class="ruby-string">&quot;@simulations&quot;</span>]
731
- job_data[<span class="ruby-string">&quot;@trajectories&quot;</span>] = job_data[<span class="ruby-string">&quot;@simulations&quot;</span>]
732
- job_data.delete(<span class="ruby-string">&quot;@simulations&quot;</span>)
733
- end
694
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@simulations&quot;</span>]
695
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@trajectories&quot;</span>] = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@simulations&quot;</span>]
696
+ <span class="ruby-identifier">job_data</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-string">&quot;@simulations&quot;</span>)
697
+ <span class="ruby-keyword">end</span>
734
698
 
735
- self.require_param(<span class="ruby-string">&quot;@trajectories&quot;</span>, job_data)
736
- return job_data
737
- end</pre>
738
- </div>
699
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-string">&quot;@trajectories&quot;</span>, <span class="ruby-identifier">job_data</span>)
700
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">job_data</span>
701
+ <span class="ruby-keyword">end</span></pre>
702
+ </div><!-- preprocess_ssa-source -->
739
703
 
740
704
  </div>
741
705
 
742
706
 
743
707
 
744
708
 
745
- </div>
709
+ </div><!-- preprocess_ssa-method -->
746
710
 
747
711
 
748
- <div id="require_file_to_exist-method" class="method-detail ">
749
- <a name="method-c-require_file_to_exist"></a>
750
-
712
+ <div id="method-c-require_file_to_exist" class="method-detail ">
751
713
 
752
714
  <div class="method-heading">
753
715
  <span class="method-name">require_file_to_exist</span><span
@@ -758,35 +720,31 @@ end</pre>
758
720
 
759
721
  <div class="method-description">
760
722
 
761
- <p>This helper method asks the AppController if the named file exists, and if
723
+ <p>This helper method asks the NeptuneManager if the named file exists, and if
762
724
  it does not, throws an exception.</p>
763
725
 
764
726
 
765
727
 
766
- <div class="method-source-code"
767
- id="require_file_to_exist-source">
768
- <pre>
769
- <span class="ruby-comment"># File lib/neptune.rb, line 205</span>
770
- def self.require_file_to_exist(file, job_data, controller)
771
- if controller.does_file_exist?(file, job_data)
772
- return
773
- else
774
- raise <span class="ruby-constant">FileNotFoundException</span>
775
- end
776
- end</pre>
777
- </div>
728
+ <div class="method-source-code" id="require_file_to_exist-source">
729
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 235</span>
730
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_exist</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
731
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">does_file_exist?</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">job_data</span>)
732
+ <span class="ruby-keyword">return</span>
733
+ <span class="ruby-keyword">else</span>
734
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">FileNotFoundException</span>
735
+ <span class="ruby-keyword">end</span>
736
+ <span class="ruby-keyword">end</span></pre>
737
+ </div><!-- require_file_to_exist-source -->
778
738
 
779
739
  </div>
780
740
 
781
741
 
782
742
 
783
743
 
784
- </div>
744
+ </div><!-- require_file_to_exist-method -->
785
745
 
786
746
 
787
- <div id="require_file_to_not_exist-method" class="method-detail ">
788
- <a name="method-c-require_file_to_not_exist"></a>
789
-
747
+ <div id="method-c-require_file_to_not_exist" class="method-detail ">
790
748
 
791
749
  <div class="method-heading">
792
750
  <span class="method-name">require_file_to_not_exist</span><span
@@ -798,37 +756,33 @@ end</pre>
798
756
  <div class="method-description">
799
757
 
800
758
  <p>This helper method performs the opposite function of <a
801
- href="NeptuneHelper.html#method-c-require_file_to_exist">require_file_to_exist</a>,
759
+ href="NeptuneHelper.html#method-c-require_file_to_exist">::require_file_to_exist</a>,
802
760
  raising an exception if the named file does exist.</p>
803
761
 
804
762
 
805
763
 
806
- <div class="method-source-code"
807
- id="require_file_to_not_exist-source">
808
- <pre>
809
- <span class="ruby-comment"># File lib/neptune.rb, line 216</span>
810
- def self.require_file_to_not_exist(file, job_data, controller)
811
- begin
812
- self.require_file_to_exist(file, job_data, controller)
764
+ <div class="method-source-code" id="require_file_to_not_exist-source">
765
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 246</span>
766
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_not_exist</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
767
+ <span class="ruby-keyword">begin</span>
768
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_file_to_exist</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">controller</span>)
813
769
  <span class="ruby-comment"># no exception thrown previously means that the output file exists</span>
814
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">'Output specified already exists'</span>)
815
- rescue <span class="ruby-constant">FileNotFoundException</span>
816
- return
817
- end
818
- end</pre>
819
- </div>
770
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">'Output specified already exists'</span>)
771
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">FileNotFoundException</span>
772
+ <span class="ruby-keyword">return</span>
773
+ <span class="ruby-keyword">end</span>
774
+ <span class="ruby-keyword">end</span></pre>
775
+ </div><!-- require_file_to_not_exist-source -->
820
776
 
821
777
  </div>
822
778
 
823
779
 
824
780
 
825
781
 
826
- </div>
782
+ </div><!-- require_file_to_not_exist-method -->
827
783
 
828
784
 
829
- <div id="require_param-method" class="method-detail ">
830
- <a name="method-c-require_param"></a>
831
-
785
+ <div id="method-c-require_param" class="method-detail ">
832
786
 
833
787
  <div class="method-heading">
834
788
  <span class="method-name">require_param</span><span
@@ -844,28 +798,24 @@ data provided.</p>
844
798
 
845
799
 
846
800
 
847
- <div class="method-source-code"
848
- id="require_param-source">
849
- <pre>
850
- <span class="ruby-comment"># File lib/neptune.rb, line 196</span>
851
- def self.require_param(param, job_data)
852
- if !job_data[param]
853
- raise <span class="ruby-constant">BadConfigurationException</span>.new(&quot;#{param} must be specified&quot;)
854
- end
855
- end</pre>
856
- </div>
801
+ <div class="method-source-code" id="require_param-source">
802
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 226</span>
803
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">require_param</span>(<span class="ruby-identifier">param</span>, <span class="ruby-identifier">job_data</span>)
804
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">job_data</span>[<span class="ruby-identifier">param</span>]
805
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{param} must be specified&quot;</span>)
806
+ <span class="ruby-keyword">end</span>
807
+ <span class="ruby-keyword">end</span></pre>
808
+ </div><!-- require_param-source -->
857
809
 
858
810
  </div>
859
811
 
860
812
 
861
813
 
862
814
 
863
- </div>
815
+ </div><!-- require_param-method -->
864
816
 
865
817
 
866
- <div id="run_job-method" class="method-detail ">
867
- <a name="method-c-run_job"></a>
868
-
818
+ <div id="method-c-run_job" class="method-detail ">
869
819
 
870
820
  <div class="method-heading">
871
821
  <span class="method-name">run_job</span><span
@@ -881,56 +831,52 @@ as well as information about the node to send the request to.</p>
881
831
 
882
832
 
883
833
 
884
- <div class="method-source-code"
885
- id="run_job-source">
886
- <pre>
887
- <span class="ruby-comment"># File lib/neptune.rb, line 502</span>
888
- def self.run_job(job_data, ssh_args, shadow_ip, secret)
889
- controller = <span class="ruby-constant">AppControllerClient</span>.new(shadow_ip, secret)
834
+ <div class="method-source-code" id="run_job-source">
835
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 536</span>
836
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">run_job</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">secret</span>)
837
+ <span class="ruby-identifier">controller</span> = <span class="ruby-constant">NeptuneManagerClient</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">secret</span>)
890
838
 
891
839
  <span class="ruby-comment"># TODO - right now the job is assumed to succeed in many cases</span>
892
840
  <span class="ruby-comment"># need to investigate the various failure scenarios</span>
893
- result = { :result =&gt; :success }
894
-
895
- case job_data[<span class="ruby-string">&quot;@type&quot;</span>]
896
- when <span class="ruby-string">&quot;input&quot;</span>
897
- result = self.get_input(job_data, ssh_args, shadow_ip, controller)
898
- when <span class="ruby-string">&quot;output&quot;</span>
899
- result[:output] = controller.get_output(job_data)
900
- when <span class="ruby-string">&quot;get-acl&quot;</span>
901
- job_data[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;acl&quot;</span>
902
- result[:acl] = controller.get_acl(job_data)
903
- when <span class="ruby-string">&quot;set-acl&quot;</span>
904
- job_data[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;acl&quot;</span>
905
- result[:acl] = controller.set_acl(job_data)
906
- when <span class="ruby-string">&quot;compile&quot;</span>
907
- result = self.compile_code(job_data, ssh_args, shadow_ip)
908
- when <span class="ruby-string">&quot;cicero&quot;</span>
909
- self.upload_app_for_cicero(job_data)
910
- msg = controller.start_neptune_job(job_data)
911
- result[:msg] = msg
912
- result[:result] = :failure if result[:msg] !~ <span class="ruby-regexp">/job is now running\Z/</span>
913
- else
914
- msg = controller.start_neptune_job(job_data)
915
- result[:msg] = msg
916
- result[:result] = :failure if result[:msg] !~ <span class="ruby-regexp">/job is now running\Z/</span>
917
- end
918
-
919
- return result
920
- end</pre>
921
- </div>
841
+ <span class="ruby-identifier">result</span> = { <span class="ruby-value">:result</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">:success</span> }
842
+
843
+ <span class="ruby-keyword">case</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>]
844
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;input&quot;</span>
845
+ <span class="ruby-identifier">result</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get_input</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">controller</span>)
846
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;output&quot;</span>
847
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:output</span>] = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">get_output</span>(<span class="ruby-identifier">job_data</span>)
848
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;get-acl&quot;</span>
849
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;acl&quot;</span>
850
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:acl</span>] = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">get_acl</span>(<span class="ruby-identifier">job_data</span>)
851
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;set-acl&quot;</span>
852
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@type&quot;</span>] = <span class="ruby-string">&quot;acl&quot;</span>
853
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:acl</span>] = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">set_acl</span>(<span class="ruby-identifier">job_data</span>)
854
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;compile&quot;</span>
855
+ <span class="ruby-identifier">result</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">compile_code</span>(<span class="ruby-identifier">job_data</span>, <span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>)
856
+ <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;cicero&quot;</span>
857
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">upload_app_for_cicero</span>(<span class="ruby-identifier">job_data</span>)
858
+ <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">start_neptune_job</span>(<span class="ruby-identifier">job_data</span>)
859
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:msg</span>] = <span class="ruby-identifier">msg</span>
860
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:result</span>] = <span class="ruby-value">:failure</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">:msg</span>] <span class="ruby-operator">!~</span> <span class="ruby-regexp">%rjob is now running\Z/</span>
861
+ <span class="ruby-keyword">else</span>
862
+ <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">controller</span>.<span class="ruby-identifier">start_neptune_job</span>(<span class="ruby-identifier">job_data</span>)
863
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:msg</span>] = <span class="ruby-identifier">msg</span>
864
+ <span class="ruby-identifier">result</span>[<span class="ruby-value">:result</span>] = <span class="ruby-value">:failure</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">result</span>[<span class="ruby-value">:msg</span>] <span class="ruby-operator">!~</span> <span class="ruby-regexp">%rjob is now running\Z/</span>
865
+ <span class="ruby-keyword">end</span>
866
+
867
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
868
+ <span class="ruby-keyword">end</span></pre>
869
+ </div><!-- run_job-source -->
922
870
 
923
871
  </div>
924
872
 
925
873
 
926
874
 
927
875
 
928
- </div>
876
+ </div><!-- run_job-method -->
929
877
 
930
878
 
931
- <div id="upload_app_for_cicero-method" class="method-detail ">
932
- <a name="method-c-upload_app_for_cicero"></a>
933
-
879
+ <div id="method-c-upload_app_for_cicero" class="method-detail ">
934
880
 
935
881
  <div class="method-heading">
936
882
  <span class="method-name">upload_app_for_cicero</span><span
@@ -946,48 +892,44 @@ with Cicero jobs. It requires the AppScale tools to be installed.</p>
946
892
 
947
893
 
948
894
 
949
- <div class="method-source-code"
950
- id="upload_app_for_cicero-source">
951
- <pre>
952
- <span class="ruby-comment"># File lib/neptune.rb, line 473</span>
953
- def self.upload_app_for_cicero(job_data)
954
- if !job_data[<span class="ruby-string">&quot;@app&quot;</span>]
895
+ <div class="method-source-code" id="upload_app_for_cicero-source">
896
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 507</span>
897
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">upload_app_for_cicero</span>(<span class="ruby-identifier">job_data</span>)
898
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@app&quot;</span>]
955
899
  <span class="ruby-comment"># Kernel.puts &quot;No app specified, not uploading...&quot; </span>
956
- return
957
- end
900
+ <span class="ruby-keyword">return</span>
901
+ <span class="ruby-keyword">end</span>
958
902
 
959
- app_location = <span class="ruby-constant">File</span>.expand_path(job_data[<span class="ruby-string">&quot;@app&quot;</span>])
960
- if !<span class="ruby-constant">File</span>.exists?(app_location)
961
- raise <span class="ruby-constant">BadConfigurationException</span>.new(&quot;The app you specified, #{app_location}, does not exist.&quot; +
903
+ <span class="ruby-identifier">app_location</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@app&quot;</span>])
904
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">exists?</span>(<span class="ruby-identifier">app_location</span>)
905
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;The app you specified, #{app_location}, does not exist.&quot;</span> <span class="ruby-operator">+</span>
962
906
  <span class="ruby-string">&quot;Please specify one that does and try again.&quot;</span>)
963
- end
907
+ <span class="ruby-keyword">end</span>
964
908
 
965
- keyname = job_data[<span class="ruby-string">&quot;@keyname&quot;</span>] || <span class="ruby-string">&quot;appscale&quot;</span>
966
- if job_data[<span class="ruby-string">&quot;@appscale_tools&quot;</span>]
967
- upload_app = <span class="ruby-constant">File</span>.expand_path(job_data[<span class="ruby-string">&quot;@appscale_tools&quot;</span>]) +
968
- <span class="ruby-constant">File</span>::<span class="ruby-constant">SEPARATOR</span> + <span class="ruby-string">&quot;bin&quot;</span> + <span class="ruby-constant">File</span>::<span class="ruby-constant">SEPARATOR</span> + <span class="ruby-string">&quot;appscale-upload-app&quot;</span>
969
- else
970
- upload_app = <span class="ruby-string">&quot;appscale-upload-app&quot;</span>
971
- end
909
+ <span class="ruby-identifier">keyname</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@keyname&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;appscale&quot;</span>
910
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@appscale_tools&quot;</span>]
911
+ <span class="ruby-identifier">upload_app</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@appscale_tools&quot;</span>]) <span class="ruby-operator">+</span>
912
+ <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;bin&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">SEPARATOR</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;appscale-upload-app&quot;</span>
913
+ <span class="ruby-keyword">else</span>
914
+ <span class="ruby-identifier">upload_app</span> = <span class="ruby-string">&quot;appscale-upload-app&quot;</span>
915
+ <span class="ruby-keyword">end</span>
972
916
 
973
917
  <span class="ruby-comment"># Kernel.puts &quot;Uploading AppEngine app at #{app_location}&quot;</span>
974
- upload_command = &quot;#{upload_app} --file #{app_location} --test --keyname #{keyname}&quot;
918
+ <span class="ruby-identifier">upload_command</span> = <span class="ruby-node">&quot;#{upload_app} --file #{app_location} --test --keyname #{keyname}&quot;</span>
975
919
  <span class="ruby-comment"># Kernel.puts upload_command</span>
976
920
  <span class="ruby-comment"># Kernel.puts `#{upload_command}`</span>
977
- end</pre>
978
- </div>
921
+ <span class="ruby-keyword">end</span></pre>
922
+ </div><!-- upload_app_for_cicero-source -->
979
923
 
980
924
  </div>
981
925
 
982
926
 
983
927
 
984
928
 
985
- </div>
929
+ </div><!-- upload_app_for_cicero-method -->
986
930
 
987
931
 
988
- <div id="validate_storage_params-method" class="method-detail ">
989
- <a name="method-c-validate_storage_params"></a>
990
-
932
+ <div id="method-c-validate_storage_params" class="method-detail ">
991
933
 
992
934
  <div class="method-heading">
993
935
  <span class="method-name">validate_storage_params</span><span
@@ -1005,58 +947,54 @@ parameter is missing.</p>
1005
947
 
1006
948
 
1007
949
 
1008
- <div class="method-source-code"
1009
- id="validate_storage_params-source">
1010
- <pre>
1011
- <span class="ruby-comment"># File lib/neptune.rb, line 332</span>
1012
- def self.validate_storage_params(job_data)
1013
- job_data[<span class="ruby-string">&quot;@storage&quot;</span>] ||= <span class="ruby-string">&quot;appdb&quot;</span>
950
+ <div class="method-source-code" id="validate_storage_params-source">
951
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 366</span>
952
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">validate_storage_params</span>(<span class="ruby-identifier">job_data</span>)
953
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@storage&quot;</span>] <span class="ruby-operator">||=</span> <span class="ruby-string">&quot;appdb&quot;</span>
1014
954
 
1015
- storage = job_data[<span class="ruby-string">&quot;@storage&quot;</span>]
1016
- if !<span class="ruby-constant">ALLOWED_STORAGE_TYPES</span>.include?(storage)
1017
- raise <span class="ruby-constant">BadConfigurationException</span>.new(<span class="ruby-string">&quot;Supported storage types are &quot;</span> +
1018
- &quot;#{ALLOWED_STORAGE_TYPES.join(', ')} - #{storage} is not supported.&quot;)
1019
- end
955
+ <span class="ruby-identifier">storage</span> = <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@storage&quot;</span>]
956
+ <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">ALLOWED_STORAGE_TYPES</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">storage</span>)
957
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;Supported storage types are &quot;</span> <span class="ruby-operator">+</span>
958
+ <span class="ruby-node">&quot;#{ALLOWED_STORAGE_TYPES.join(', ')} - #{storage} is not supported.&quot;</span>)
959
+ <span class="ruby-keyword">end</span>
1020
960
 
1021
961
  <span class="ruby-comment"># Our implementation for storing / retrieving via Google Storage</span>
1022
962
  <span class="ruby-comment"># and Walrus uses</span>
1023
963
  <span class="ruby-comment"># the same library as we do for S3 - so just tell it that it's S3</span>
1024
- if storage == <span class="ruby-string">&quot;gstorage&quot;</span> or storage == <span class="ruby-string">&quot;walrus&quot;</span>
1025
- storage = <span class="ruby-string">&quot;s3&quot;</span>
1026
- job_data[<span class="ruby-string">&quot;@storage&quot;</span>] = <span class="ruby-string">&quot;s3&quot;</span>
1027
- end
1028
-
1029
- if storage == <span class="ruby-string">&quot;s3&quot;</span>
1030
- [<span class="ruby-string">&quot;EC2_ACCESS_KEY&quot;</span>, <span class="ruby-string">&quot;EC2_SECRET_KEY&quot;</span>, <span class="ruby-string">&quot;S3_URL&quot;</span>].each { |item|
1031
- if job_data[&quot;@#{item}&quot;]
964
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">storage</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;gstorage&quot;</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">storage</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;walrus&quot;</span>
965
+ <span class="ruby-identifier">storage</span> = <span class="ruby-string">&quot;s3&quot;</span>
966
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-string">&quot;@storage&quot;</span>] = <span class="ruby-string">&quot;s3&quot;</span>
967
+ <span class="ruby-keyword">end</span>
968
+
969
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">storage</span> <span class="ruby-operator">==</span> <span class="ruby-string">&quot;s3&quot;</span>
970
+ [<span class="ruby-string">&quot;EC2_ACCESS_KEY&quot;</span>, <span class="ruby-string">&quot;EC2_SECRET_KEY&quot;</span>, <span class="ruby-string">&quot;S3_URL&quot;</span>].<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
971
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">job_data</span>[<span class="ruby-node">&quot;@#{item}&quot;</span>]
1032
972
  <span class="ruby-comment"># Kernel.puts &quot;Using specified #{item}&quot;</span>
1033
- else
1034
- if <span class="ruby-constant">ENV</span>[item]
973
+ <span class="ruby-keyword">else</span>
974
+ <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">item</span>]
1035
975
  <span class="ruby-comment"># Kernel.puts &quot;Using #{item} from environment&quot;</span>
1036
- job_data[&quot;@#{item}&quot;] = <span class="ruby-constant">ENV</span>[item]
1037
- else
1038
- raise <span class="ruby-constant">BadConfigurationException</span>.new(&quot;When storing data to S3, #{item} must be specified or be in &quot; +
976
+ <span class="ruby-identifier">job_data</span>[<span class="ruby-node">&quot;@#{item}&quot;</span>] = <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">item</span>]
977
+ <span class="ruby-keyword">else</span>
978
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">BadConfigurationException</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;When storing data to S3, #{item} must be specified or be in &quot;</span> <span class="ruby-operator">+</span>
1039
979
  <span class="ruby-string">&quot;your environment. Please do so and try again.&quot;</span>)
1040
- end
1041
- end
980
+ <span class="ruby-keyword">end</span>
981
+ <span class="ruby-keyword">end</span>
1042
982
  }
1043
- end
983
+ <span class="ruby-keyword">end</span>
1044
984
 
1045
- return job_data
1046
- end</pre>
1047
- </div>
985
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">job_data</span>
986
+ <span class="ruby-keyword">end</span></pre>
987
+ </div><!-- validate_storage_params-source -->
1048
988
 
1049
989
  </div>
1050
990
 
1051
991
 
1052
992
 
1053
993
 
1054
- </div>
994
+ </div><!-- validate_storage_params-method -->
1055
995
 
1056
996
 
1057
- <div id="wait_for_compilation_to_finish-method" class="method-detail ">
1058
- <a name="method-c-wait_for_compilation_to_finish"></a>
1059
-
997
+ <div id="method-c-wait_for_compilation_to_finish" class="method-detail ">
1060
998
 
1061
999
  <div class="method-heading">
1062
1000
  <span class="method-name">wait_for_compilation_to_finish</span><span
@@ -1073,46 +1011,43 @@ location.</p>
1073
1011
 
1074
1012
 
1075
1013
 
1076
- <div class="method-source-code"
1077
- id="wait_for_compilation_to_finish-source">
1078
- <pre>
1079
- <span class="ruby-comment"># File lib/neptune.rb, line 403</span>
1080
- def self.wait_for_compilation_to_finish(ssh_args, shadow_ip, compiled_location)
1081
- loop {
1082
- ssh_command = &quot;ssh #{ssh_args} root@#{shadow_ip} 'ls #{compiled_location}' 2&gt;&amp;1&quot;
1014
+ <div class="method-source-code" id="wait_for_compilation_to_finish-source">
1015
+ <pre><span class="ruby-comment"># File lib/neptune.rb, line 437</span>
1016
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">wait_for_compilation_to_finish</span>(<span class="ruby-identifier">ssh_args</span>, <span class="ruby-identifier">shadow_ip</span>, <span class="ruby-identifier">compiled_location</span>)
1017
+ <span class="ruby-identifier">loop</span> {
1018
+ <span class="ruby-identifier">ssh_command</span> = <span class="ruby-node">&quot;ssh #{ssh_args} root@#{shadow_ip} 'ls #{compiled_location}' 2&gt;&amp;1&quot;</span>
1083
1019
  <span class="ruby-comment"># Kernel.puts ssh_command</span>
1084
- ssh_result = <span class="ruby-constant">CommonFunctions</span>.shell(ssh_command)
1020
+ <span class="ruby-identifier">ssh_result</span> = <span class="ruby-constant">CommonFunctions</span>.<span class="ruby-identifier">shell</span>(<span class="ruby-identifier">ssh_command</span>)
1085
1021
  <span class="ruby-comment"># Kernel.puts &quot;result was [#{ssh_result}]&quot;</span>
1086
- if ssh_result =~ <span class="ruby-regexp">/No such file or directory/</span>
1022
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">ssh_result</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">%rNo such file or directory/</span>
1087
1023
  <span class="ruby-comment"># Kernel.puts &quot;Still waiting for code to be compiled...&quot;</span>
1088
- else
1024
+ <span class="ruby-keyword">else</span>
1089
1025
  <span class="ruby-comment"># Kernel.puts &quot;compilation complete! Copying compiled code to #{copy_to}&quot;</span>
1090
- return
1091
- end
1092
- sleep(5)
1026
+ <span class="ruby-keyword">return</span>
1027
+ <span class="ruby-keyword">end</span>
1028
+ <span class="ruby-identifier">sleep</span>(<span class="ruby-value">5</span>)
1093
1029
  }
1094
- end</pre>
1095
- </div>
1030
+ <span class="ruby-keyword">end</span></pre>
1031
+ </div><!-- wait_for_compilation_to_finish-source -->
1096
1032
 
1097
1033
  </div>
1098
1034
 
1099
1035
 
1100
1036
 
1101
1037
 
1102
- </div>
1038
+ </div><!-- wait_for_compilation_to_finish-method -->
1103
1039
 
1104
1040
 
1105
- </div>
1041
+ </section><!-- public-class-method-details -->
1106
1042
 
1043
+ </section><!-- 5Buntitled-5D -->
1107
1044
 
1108
- </div>
1045
+ </div><!-- documentation -->
1109
1046
 
1110
- <div id="validator-badges">
1111
- <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
1112
- <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
1113
- Rdoc Generator</a> 2</small>.</p>
1114
- </div>
1115
1047
 
1116
- </body>
1117
- </html>
1048
+ <footer id="validator-badges">
1049
+ <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
1050
+ <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
1051
+ <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
1052
+ </footer>
1118
1053