neptune 0.1.4 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,13 +24,15 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">Sun May 15 22:52:56 -0700 2011</dd>
27
+ <dd class="modified-date">Fri Feb 10 19:53:13 -0800 2012</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
31
31
  <dd class="requires">
32
32
  <ul>
33
33
 
34
+ <li>babel</li>
35
+
34
36
  <li>neptune</li>
35
37
 
36
38
  </ul>
@@ -1,5 +1,7 @@
1
- Tue, 06 Dec 2011 14:24:38 -0800
2
- bin/neptune Sun, 15 May 2011 22:52:56 -0700
3
- lib/neptune.rb Tue, 06 Dec 2011 13:21:57 -0800
4
- lib/app_controller_client.rb Tue, 25 Oct 2011 23:47:47 -0700
5
- lib/common_functions.rb Wed, 26 Oct 2011 10:37:34 -0700
1
+ Sat, 11 Feb 2012 13:24:19 -0800
2
+ bin/neptune Fri, 10 Feb 2012 19:53:13 -0800
3
+ lib/babel.rb Sat, 11 Feb 2012 13:20:56 -0800
4
+ lib/neptune.rb Sat, 11 Feb 2012 11:16:25 -0800
5
+ lib/custom_exceptions.rb Sat, 31 Dec 2011 13:13:50 -0800
6
+ lib/app_controller_client.rb Wed, 25 Jan 2012 12:07:13 -0800
7
+ lib/common_functions.rb Sat, 11 Feb 2012 13:20:31 -0800
@@ -33,9 +33,17 @@
33
33
 
34
34
  <li class="class"><a href="AppControllerClient.html">AppControllerClient</a></li>
35
35
 
36
+ <li class="class"><a href="AppControllerException.html">AppControllerException</a></li>
37
+
38
+ <li class="module"><a href="BabelHelper.html">BabelHelper</a></li>
39
+
40
+ <li class="class"><a href="BadConfigurationException.html">BadConfigurationException</a></li>
41
+
36
42
  <li class="module"><a href="CommonFunctions.html">CommonFunctions</a></li>
37
43
 
38
- <li class="module"><a href="Kernel.html">Kernel</a></li>
44
+ <li class="class"><a href="FileNotFoundException.html">FileNotFoundException</a></li>
45
+
46
+ <li class="module"><a href="NeptuneHelper.html">NeptuneHelper</a></li>
39
47
 
40
48
  <li class="class"><a href="Object.html">Object</a></li>
41
49
 
@@ -44,59 +52,99 @@
44
52
  <h2 id="methods">Methods</h2>
45
53
  <ul>
46
54
 
55
+ <li><a href="NeptuneHelper.html#method-c-compile_code">::compile_code &mdash; NeptuneHelper</a></li>
56
+
57
+ <li><a href="BabelHelper.html#method-c-convert_from_neptune_params">::convert_from_neptune_params &mdash; BabelHelper</a></li>
58
+
59
+ <li><a href="BabelHelper.html#method-c-convert_to_neptune_params">::convert_to_neptune_params &mdash; BabelHelper</a></li>
60
+
61
+ <li><a href="NeptuneHelper.html#method-c-do_preprocessing">::do_preprocessing &mdash; NeptuneHelper</a></li>
62
+
63
+ <li><a href="BabelHelper.html#method-c-ensure_output_does_not_exist">::ensure_output_does_not_exist &mdash; BabelHelper</a></li>
64
+
65
+ <li><a href="BabelHelper.html#method-c-generate_output_location">::generate_output_location &mdash; BabelHelper</a></li>
66
+
67
+ <li><a href="BabelHelper.html#method-c-get_appcontroller">::get_appcontroller &mdash; BabelHelper</a></li>
68
+
69
+ <li><a href="BabelHelper.html#method-c-get_bucket_for_local_data">::get_bucket_for_local_data &mdash; BabelHelper</a></li>
70
+
47
71
  <li><a href="CommonFunctions.html#method-c-get_from_yaml">::get_from_yaml &mdash; CommonFunctions</a></li>
48
72
 
73
+ <li><a href="NeptuneHelper.html#method-c-get_input">::get_input &mdash; NeptuneHelper</a></li>
74
+
75
+ <li><a href="NeptuneHelper.html#method-c-get_job_data">::get_job_data &mdash; NeptuneHelper</a></li>
76
+
77
+ <li><a href="CommonFunctions.html#method-c-get_random_alphanumeric">::get_random_alphanumeric &mdash; CommonFunctions</a></li>
78
+
49
79
  <li><a href="CommonFunctions.html#method-c-get_secret_key">::get_secret_key &mdash; CommonFunctions</a></li>
50
80
 
81
+ <li><a href="NeptuneHelper.html#method-c-get_std_out_and_err">::get_std_out_and_err &mdash; NeptuneHelper</a></li>
82
+
51
83
  <li><a href="AppControllerClient.html#method-c-new">::new &mdash; AppControllerClient</a></li>
52
84
 
53
- <li><a href="CommonFunctions.html#method-c-scp_file">::scp_file &mdash; CommonFunctions</a></li>
85
+ <li><a href="NeptuneHelper.html#method-c-preprocess_babel">::preprocess_babel &mdash; NeptuneHelper</a></li>
54
86
 
55
- <li><a href="CommonFunctions.html#method-c-scp_to_shadow">::scp_to_shadow &mdash; CommonFunctions</a></li>
87
+ <li><a href="NeptuneHelper.html#method-c-preprocess_compile">::preprocess_compile &mdash; NeptuneHelper</a></li>
56
88
 
57
- <li><a href="Object.html#method-i-compile_code">#compile_code &mdash; Object</a></li>
89
+ <li><a href="NeptuneHelper.html#method-c-preprocess_erlang">::preprocess_erlang &mdash; NeptuneHelper</a></li>
58
90
 
59
- <li><a href="AppControllerClient.html#method-i-compile_code">#compile_code &mdash; AppControllerClient</a></li>
91
+ <li><a href="NeptuneHelper.html#method-c-preprocess_mpi">::preprocess_mpi &mdash; NeptuneHelper</a></li>
60
92
 
61
- <li><a href="Object.html#method-i-do_preprocessing">#do_preprocessing &mdash; Object</a></li>
93
+ <li><a href="NeptuneHelper.html#method-c-preprocess_ssa">::preprocess_ssa &mdash; NeptuneHelper</a></li>
62
94
 
63
- <li><a href="AppControllerClient.html#method-i-get_acl">#get_acl &mdash; AppControllerClient</a></li>
95
+ <li><a href="BabelHelper.html#method-c-put_code">::put_code &mdash; BabelHelper</a></li>
64
96
 
65
- <li><a href="Object.html#method-i-get_input">#get_input &mdash; Object</a></li>
97
+ <li><a href="BabelHelper.html#method-c-put_file">::put_file &mdash; BabelHelper</a></li>
66
98
 
67
- <li><a href="Object.html#method-i-get_job_data">#get_job_data &mdash; Object</a></li>
99
+ <li><a href="BabelHelper.html#method-c-put_inputs">::put_inputs &mdash; BabelHelper</a></li>
68
100
 
69
- <li><a href="AppControllerClient.html#method-i-get_output">#get_output &mdash; AppControllerClient</a></li>
101
+ <li><a href="NeptuneHelper.html#method-c-require_file_to_exist">::require_file_to_exist &mdash; NeptuneHelper</a></li>
70
102
 
71
- <li><a href="Object.html#method-i-get_std_out_and_err">#get_std_out_and_err &mdash; Object</a></li>
103
+ <li><a href="NeptuneHelper.html#method-c-require_file_to_not_exist">::require_file_to_not_exist &mdash; NeptuneHelper</a></li>
72
104
 
73
- <li><a href="AppControllerClient.html#method-i-make_call">#make_call &mdash; AppControllerClient</a></li>
105
+ <li><a href="NeptuneHelper.html#method-c-require_param">::require_param &mdash; NeptuneHelper</a></li>
74
106
 
75
- <li><a href="Object.html#method-i-neptune">#neptune &mdash; Object</a></li>
107
+ <li><a href="BabelHelper.html#method-c-run_job">::run_job &mdash; BabelHelper</a></li>
76
108
 
77
- <li><a href="Object.html#method-i-preprocess_compile">#preprocess_compile &mdash; Object</a></li>
109
+ <li><a href="NeptuneHelper.html#method-c-run_job">::run_job &mdash; NeptuneHelper</a></li>
78
110
 
79
- <li><a href="Object.html#method-i-preprocess_erlang">#preprocess_erlang &mdash; Object</a></li>
111
+ <li><a href="CommonFunctions.html#method-c-scp_file">::scp_file &mdash; CommonFunctions</a></li>
80
112
 
81
- <li><a href="Object.html#method-i-preprocess_mpi">#preprocess_mpi &mdash; Object</a></li>
113
+ <li><a href="CommonFunctions.html#method-c-scp_to_shadow">::scp_to_shadow &mdash; CommonFunctions</a></li>
82
114
 
83
- <li><a href="Object.html#method-i-preprocess_ssa">#preprocess_ssa &mdash; Object</a></li>
115
+ <li><a href="CommonFunctions.html#method-c-shell">::shell &mdash; CommonFunctions</a></li>
84
116
 
85
- <li><a href="AppControllerClient.html#method-i-put_input">#put_input &mdash; AppControllerClient</a></li>
117
+ <li><a href="NeptuneHelper.html#method-c-upload_app_for_cicero">::upload_app_for_cicero &mdash; NeptuneHelper</a></li>
86
118
 
87
- <li><a href="Object.html#method-i-run_job">#run_job &mdash; Object</a></li>
119
+ <li><a href="BabelHelper.html#method-c-validate_inputs">::validate_inputs &mdash; BabelHelper</a></li>
88
120
 
89
- <li><a href="AppControllerClient.html#method-i-set_acl">#set_acl &mdash; AppControllerClient</a></li>
121
+ <li><a href="NeptuneHelper.html#method-c-validate_storage_params">::validate_storage_params &mdash; NeptuneHelper</a></li>
90
122
 
91
- <li><a href="Kernel.html#method-i-shell">#shell &mdash; Kernel</a></li>
123
+ <li><a href="BabelHelper.html#method-c-wait_and_get_output">::wait_and_get_output &mdash; BabelHelper</a></li>
92
124
 
93
- <li><a href="AppControllerClient.html#method-i-start_neptune_job">#start_neptune_job &mdash; AppControllerClient</a></li>
125
+ <li><a href="NeptuneHelper.html#method-c-wait_for_compilation_to_finish">::wait_for_compilation_to_finish &mdash; NeptuneHelper</a></li>
126
+
127
+ <li><a href="Object.html#method-i-babel">#babel &mdash; Object</a></li>
128
+
129
+ <li><a href="AppControllerClient.html#method-i-compile_code">#compile_code &mdash; AppControllerClient</a></li>
130
+
131
+ <li><a href="AppControllerClient.html#method-i-does_file_exist-3F">#does_file_exist? &mdash; AppControllerClient</a></li>
132
+
133
+ <li><a href="AppControllerClient.html#method-i-get_acl">#get_acl &mdash; AppControllerClient</a></li>
134
+
135
+ <li><a href="AppControllerClient.html#method-i-get_output">#get_output &mdash; AppControllerClient</a></li>
94
136
 
95
- <li><a href="Object.html#method-i-upload_app_for_cicero">#upload_app_for_cicero &mdash; Object</a></li>
137
+ <li><a href="AppControllerClient.html#method-i-get_supported_babel_engines">#get_supported_babel_engines &mdash; AppControllerClient</a></li>
96
138
 
97
- <li><a href="Object.html#method-i-validate_storage_params">#validate_storage_params &mdash; Object</a></li>
139
+ <li><a href="AppControllerClient.html#method-i-make_call">#make_call &mdash; AppControllerClient</a></li>
140
+
141
+ <li><a href="Object.html#method-i-neptune">#neptune &mdash; Object</a></li>
98
142
 
99
- <li><a href="Object.html#method-i-wait_for_compilation_to_finish">#wait_for_compilation_to_finish &mdash; Object</a></li>
143
+ <li><a href="AppControllerClient.html#method-i-put_input">#put_input &mdash; AppControllerClient</a></li>
144
+
145
+ <li><a href="AppControllerClient.html#method-i-set_acl">#set_acl &mdash; AppControllerClient</a></li>
146
+
147
+ <li><a href="AppControllerClient.html#method-i-start_neptune_job">#start_neptune_job &mdash; AppControllerClient</a></li>
100
148
 
101
149
  </ul>
102
150
 
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">Tue Oct 25 23:47:47 -0700 2011</dd>
27
+ <dd class="modified-date">Wed Jan 25 12:07:13 -0800 2012</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -0,0 +1,68 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: babel.rb [RDoc Documentation]</title>
10
+
11
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Sat Feb 11 13:20:56 -0800 2012</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ <li>app_controller_client</li>
35
+
36
+ <li>common_functions</li>
37
+
38
+ <li>custom_exceptions</li>
39
+
40
+ <li>neptune</li>
41
+
42
+ <li>rubygems</li>
43
+
44
+ <li>promise</li>
45
+
46
+ <li>future</li>
47
+
48
+ </ul>
49
+ </dd>
50
+
51
+
52
+
53
+ </dl>
54
+ </div>
55
+
56
+ <div id="documentation">
57
+
58
+ <div class="description">
59
+ <h2>Description</h2>
60
+
61
+ <p>Programmer: Chris Bunch (cgb@cs.ucsb.edu)</p>
62
+
63
+ </div>
64
+
65
+ </div>
66
+ </body>
67
+ </html>
68
+
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">Wed Oct 26 10:37:34 -0700 2011</dd>
27
+ <dd class="modified-date">Sat Feb 11 13:20:31 -0800 2012</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -45,6 +45,8 @@
45
45
 
46
46
  <li>yaml</li>
47
47
 
48
+ <li>custom_exceptions</li>
49
+
48
50
  </ul>
49
51
  </dd>
50
52
 
@@ -0,0 +1,54 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: custom_exceptions.rb [RDoc Documentation]</title>
10
+
11
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Sat Dec 31 13:13:50 -0800 2011</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ </ul>
35
+ </dd>
36
+
37
+
38
+
39
+ </dl>
40
+ </div>
41
+
42
+ <div id="documentation">
43
+
44
+ <div class="description">
45
+ <h2>Description</h2>
46
+
47
+ <p>Programmer: Chris Bunch</p>
48
+
49
+ </div>
50
+
51
+ </div>
52
+ </body>
53
+ </html>
54
+
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">Tue Dec 06 13:21:57 -0800 2011</dd>
27
+ <dd class="modified-date">Sat Feb 11 11:16:25 -0800 2012</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -35,6 +35,8 @@
35
35
 
36
36
  <li>common_functions</li>
37
37
 
38
+ <li>custom_exceptions</li>
39
+
38
40
  </ul>
39
41
  </dd>
40
42
 
@@ -34,6 +34,8 @@ class AppControllerClient
34
34
  @conn.add_method("neptune_get_acl", "job_data", "secret")
35
35
  @conn.add_method("neptune_set_acl", "job_data", "secret")
36
36
  @conn.add_method("neptune_compile_code", "job_data", "secret")
37
+ @conn.add_method("neptune_get_supported_babel_engines", "job_data", "secret")
38
+ @conn.add_method("neptune_does_file_exist", "file", "job_data", "secret")
37
39
  end
38
40
 
39
41
  # A helper method to make SOAP calls for us. This method is mainly here to
@@ -58,7 +60,7 @@ class AppControllerClient
58
60
  if retry_on_except
59
61
  retry
60
62
  else
61
- abort("Connection was refused. Is the AppController running?")
63
+ raise AppControllerException.new("Connection was refused. Is the AppController running?")
62
64
  end
63
65
  rescue OpenSSL::SSL::SSLError, NotImplementedError, Timeout::Error
64
66
  retry
@@ -66,7 +68,7 @@ class AppControllerClient
66
68
  if retry_on_except
67
69
  retry
68
70
  else
69
- abort("We saw an unexpected error of the type #{except.class} with the following message:\n#{except}.")
71
+ raise AppControllerException.new("We saw an unexpected error of the type #{except.class} with the following message:\n#{except}.")
70
72
  end
71
73
  end
72
74
  end
@@ -75,7 +77,7 @@ class AppControllerClient
75
77
  # or MapReduce), or a scaling job (e.g., for AppScale itself). This method
76
78
  # should not be used for retrieving the output of a job or getting / setting
77
79
  # output ACLs, but just for starting new HPC / scaling jobs. This method
78
- # takes a hash containing the parameters of the job to run, and can abort if
80
+ # takes a hash containing the parameters of the job to run, and can raise AppControllerException.new if
79
81
  # the AppController it calls returns an error (e.g., if a bad secret is used
80
82
  # or the machine isn't running). Otherwise, the return value of this method
81
83
  # is the result returned from the AppController.
@@ -84,7 +86,7 @@ class AppControllerClient
84
86
  make_call(NO_TIMEOUT, false) {
85
87
  result = conn.neptune_start_job(job_data, @secret)
86
88
  }
87
- abort(result) if result =~ /Error:/
89
+ raise AppControllerException.new(result) if result =~ /Error:/
88
90
  return result
89
91
  end
90
92
 
@@ -98,7 +100,7 @@ class AppControllerClient
98
100
  make_call(NO_TIMEOUT, false) {
99
101
  result = conn.neptune_put_input(job_data, @secret)
100
102
  }
101
- abort(result) if result =~ /Error:/
103
+ raise AppControllerException.new(result) if result =~ /Error:/
102
104
  return result
103
105
  end
104
106
 
@@ -111,13 +113,13 @@ class AppControllerClient
111
113
  # for non-trivial output jobs, the next version of Neptune will add an
112
114
  # additional call to directly copy the output to a file on the local
113
115
  # filesystem. See start_neptune_job for conditions by which this method
114
- # can abort as well as the input format used for job_data.
116
+ # can raise AppControllerException.new as well as the input format used for job_data.
115
117
  def get_output(job_data)
116
118
  result = ""
117
119
  make_call(NO_TIMEOUT, false) {
118
120
  result = conn.neptune_get_output(job_data, @secret)
119
121
  }
120
- abort(result) if result =~ /Error:/
122
+ raise AppControllerException.new(result) if result =~ /Error:/
121
123
  return result
122
124
  end
123
125
 
@@ -131,7 +133,7 @@ class AppControllerClient
131
133
  make_call(NO_TIMEOUT, false) {
132
134
  result = conn.neptune_get_acl(job_data, @secret)
133
135
  }
134
- abort(result) if result =~ /Error:/
136
+ raise AppControllerException.new(result) if result =~ /Error:/
135
137
  return result
136
138
  end
137
139
 
@@ -145,7 +147,7 @@ class AppControllerClient
145
147
  make_call(NO_TIMEOUT, false) {
146
148
  result = conn.neptune_set_acl(job_data, @secret)
147
149
  }
148
- abort(result) if result =~ /Error:/
150
+ raise AppControllerException.new(result) if result =~ /Error:/
149
151
  return result
150
152
  end
151
153
 
@@ -154,7 +156,23 @@ class AppControllerClient
154
156
  make_call(NO_TIMEOUT, false) {
155
157
  result = conn.neptune_compile_code(job_data, @secret)
156
158
  }
157
- abort(result) if result =~ /Error:/
159
+ raise AppControllerException.new(result) if result =~ /Error:/
160
+ return result
161
+ end
162
+
163
+ def get_supported_babel_engines(job_data)
164
+ result = []
165
+ make_call(NO_TIMEOUT, false) {
166
+ result = conn.neptune_get_supported_babel_engines(job_data, @secret)
167
+ }
168
+ return result
169
+ end
170
+
171
+ def does_file_exist?(file, job_data)
172
+ result = false
173
+ make_call(NO_TIMEOUT, false) {
174
+ result = conn.neptune_does_file_exist(file, job_data, @secret)
175
+ }
158
176
  return result
159
177
  end
160
178
  end