neptune 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +39 -0
- data/README +50 -0
- data/bin/neptune +16 -0
- data/doc/AppControllerClient.html +468 -0
- data/doc/CommonFunctions.html +368 -0
- data/doc/LICENSE.html +131 -0
- data/doc/Object.html +431 -0
- data/doc/README.html +135 -0
- data/doc/bin/neptune.html +58 -0
- data/doc/created.rid +7 -0
- data/doc/images/brick.png +0 -0
- data/doc/images/brick_link.png +0 -0
- data/doc/images/bug.png +0 -0
- data/doc/images/bullet_black.png +0 -0
- data/doc/images/bullet_toggle_minus.png +0 -0
- data/doc/images/bullet_toggle_plus.png +0 -0
- data/doc/images/date.png +0 -0
- data/doc/images/find.png +0 -0
- data/doc/images/loadingAnimation.gif +0 -0
- data/doc/images/macFFBgHack.png +0 -0
- data/doc/images/package.png +0 -0
- data/doc/images/page_green.png +0 -0
- data/doc/images/page_white_text.png +0 -0
- data/doc/images/page_white_width.png +0 -0
- data/doc/images/plugin.png +0 -0
- data/doc/images/ruby.png +0 -0
- data/doc/images/tag_green.png +0 -0
- data/doc/images/wrench.png +0 -0
- data/doc/images/wrench_orange.png +0 -0
- data/doc/images/zoom.png +0 -0
- data/doc/index.html +90 -0
- data/doc/js/darkfish.js +116 -0
- data/doc/js/jquery.js +32 -0
- data/doc/js/quicksearch.js +114 -0
- data/doc/js/thickbox-compressed.js +10 -0
- data/doc/lib/app_controller_client_rb.html +60 -0
- data/doc/lib/common_functions_rb.html +68 -0
- data/doc/lib/job_rb.html +55 -0
- data/doc/scripts/appscale/add_appserver_rb.html +52 -0
- data/doc/scripts/appscale/add_database_rb.html +52 -0
- data/doc/scripts/appscale/add_loadbalancer_rb.html +52 -0
- data/doc/scripts/appscale/add_slave_rb.html +52 -0
- data/doc/scripts/cewssa/cewssa-output.html +104 -0
- data/doc/scripts/cewssa/get_cewssa_output_rb.html +52 -0
- data/doc/scripts/cewssa/run_cewssa_rb.html +52 -0
- data/doc/scripts/cewssa/test_dfsp_rb.html +52 -0
- data/doc/scripts/dfsp/get_dfsp_output_rb.html +52 -0
- data/doc/scripts/dfsp/make_output_public_rb.html +52 -0
- data/doc/scripts/dfsp/run_dfsp_rb.html +52 -0
- data/doc/scripts/dfsp/see_acl_rb.html +52 -0
- data/doc/scripts/dfsp/test_dfsp_rb.html +52 -0
- data/doc/scripts/mapreduce/get_mapreduce_output_rb.html +52 -0
- data/doc/scripts/mapreduce/input-10.html +114 -0
- data/doc/scripts/mapreduce/input-30.html +114 -0
- data/doc/scripts/mapreduce/input-7.html +104 -0
- data/doc/scripts/mapreduce/map_rb.html +56 -0
- data/doc/scripts/mapreduce/reduce_rb.html +56 -0
- data/doc/scripts/mapreduce/run_java_mr_rb.html +52 -0
- data/doc/scripts/mapreduce/run_mapreduce_rb.html +52 -0
- data/doc/scripts/mpi/Makefile.html +125 -0
- data/doc/scripts/mpi/get_mpi_output_rb.html +52 -0
- data/doc/scripts/mpi/hw2_c.html +52 -0
- data/doc/scripts/mpi/hw2harness_c.html +52 -0
- data/doc/scripts/mpi/hw2harness_h.html +52 -0
- data/doc/scripts/mpi/run_mpi_cpi_rb.html +52 -0
- data/doc/scripts/mpi/run_mpi_powermethod_rb.html +52 -0
- data/doc/scripts/mpi/test_rb.html +52 -0
- data/doc/scripts/x10/Makefile.html +106 -0
- data/doc/scripts/x10/get_x10_output_rb.html +52 -0
- data/doc/scripts/x10/run_x10_kmeans_rb.html +52 -0
- data/doc/scripts/x10/run_x10_montypi_rb.html +52 -0
- data/doc/scripts/x10/run_x10_nqueens_rb.html +52 -0
- data/doc/scripts/x10/run_x10_powermethod_rb.html +52 -0
- data/doc/scripts/x10/run_x10_qsort_rb.html +52 -0
- data/doc/scripts/x10/test_rb.html +52 -0
- data/lib/app_controller_client.rb +135 -0
- data/lib/common_functions.rb +107 -0
- data/lib/job.rb +161 -0
- metadata +145 -0
data/LICENSE
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
Software License Agreement (BSD License)
|
3
|
+
|
4
|
+
Copyright (c) 2008, Regents of the University of California
|
5
|
+
All rights reserved.
|
6
|
+
|
7
|
+
Redistribution and use of this software in source and binary forms, with or
|
8
|
+
without modification, are permitted provided that the following conditions
|
9
|
+
are met:
|
10
|
+
|
11
|
+
* Redistributions of source code must retain the above
|
12
|
+
copyright notice, this list of conditions and the
|
13
|
+
following disclaimer.
|
14
|
+
|
15
|
+
* Redistributions in binary form must reproduce the above
|
16
|
+
copyright notice, this list of conditions and the
|
17
|
+
following disclaimer in the documentation and/or other
|
18
|
+
materials provided with the distribution.
|
19
|
+
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
23
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
24
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
25
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
26
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
27
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
28
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
29
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
30
|
+
POSSIBILITY OF SUCH DAMAGE. USERS OF THIS SOFTWARE ACKNOWLEDGE THE POSSIBLE
|
31
|
+
PRESENCE OF OTHER OPEN SOURCE LICENSED MATERIAL, COPYRIGHTED MATERIAL OR
|
32
|
+
PATENTED MATERIAL IN THIS SOFTWARE, AND IF ANY SUCH MATERIAL IS DISCOVERED THE PARTY
|
33
|
+
DISCOVERING IT MAY INFORM DR. CHANDRA KRINTZ AT THE UNIVERSITY OF CALIFORNIA,
|
34
|
+
SANTA BARBARA WHO WILL THEN ASCERTAIN THE MOST APPROPRIATE REMEDY, WHICH
|
35
|
+
IN THE REGENTS’ DISCRETION MAY INCLUDE, WITHOUT LIMITATION, REPLACEMENT
|
36
|
+
OF THE CODE SO IDENTIFIED, LICENSING OF THE CODE SO IDENTIFIED, OR WITHDRAWAL
|
37
|
+
OF THE CODE CAPABILITY TO THE EXTENT NEEDED TO COMPLY WITH ANY SUCH LICENSES
|
38
|
+
OR RIGHTS.
|
39
|
+
=end
|
data/README
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
=begin rdoc
|
2
|
+
Neptune: A Domain Specific Language for Deploying HPC
|
3
|
+
Software on Cloud Platforms
|
4
|
+
|
5
|
+
Neptune provides programmers with a simple interface
|
6
|
+
by which they can deploy MPI, X10, and MapReduce jobs
|
7
|
+
to without needing to know the particulars of the underlying
|
8
|
+
cloud platform. You only need to give Neptune your code,
|
9
|
+
tell it how many machines to run on and where to put the output:
|
10
|
+
Neptune handles everything else. No more writing configuration
|
11
|
+
files, having to start up NFS on all your machines, yada yada yada.
|
12
|
+
Neptune works together with supported cloud platforms (currently
|
13
|
+
AppScale is recommended) and can deploy over anything AppScale
|
14
|
+
can - Xen or KVM virtual machines as well as Eucalyptus and
|
15
|
+
Amazon EC2. There's nothing virtualization specific in there,
|
16
|
+
so in theory any machine installed with the AppScale software
|
17
|
+
should work fine.
|
18
|
+
|
19
|
+
Although Neptune is designed to automate deploying HPC jobs,
|
20
|
+
it also can be used to deploy other types of software. For example,
|
21
|
+
Neptune has support for user-specified scaling of the underlying
|
22
|
+
cloud platform: users can write Neptune jobs that manually add
|
23
|
+
load balancers, application servers, or database servers to a running
|
24
|
+
AppScale deployment.
|
25
|
+
|
26
|
+
Sample Neptune job scripts can be found in samples. Test scripts will
|
27
|
+
be added to test in the next release.
|
28
|
+
|
29
|
+
Developed by Chris Bunch as part of the AppScale project.
|
30
|
+
See LICENSE for the specifics of the New BSD License
|
31
|
+
by which Neptune is released.
|
32
|
+
|
33
|
+
Check us out on the web:
|
34
|
+
|
35
|
+
http://code.google.com/p/appscale
|
36
|
+
|
37
|
+
http://appscale.cs.ucsb.edu
|
38
|
+
|
39
|
+
Contributors welcome! We would love to add support for other
|
40
|
+
cloud platforms and test out Neptune more on non-virtualized
|
41
|
+
deployments, as well as adding capabilities for other types
|
42
|
+
of computation. We would also like to refactor Neptune to use
|
43
|
+
symbols instead of instance variables for running jobs: this
|
44
|
+
will likely appear in a future release as well.
|
45
|
+
|
46
|
+
An academic paper describing Neptune is in the works - check
|
47
|
+
in for a link to that as it becomes available.
|
48
|
+
|
49
|
+
=end
|
50
|
+
|
data/bin/neptune
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
|
3
|
+
$VERBOSE = nil # to surpress excessive SSL cert warnings
|
4
|
+
|
5
|
+
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
6
|
+
require 'app_controller_client'
|
7
|
+
require 'common_functions'
|
8
|
+
require 'job'
|
9
|
+
|
10
|
+
file = ARGV[0]
|
11
|
+
unless File.exists?(file)
|
12
|
+
abort("File #{file} does not exist.")
|
13
|
+
end
|
14
|
+
|
15
|
+
load file
|
16
|
+
|
@@ -0,0 +1,468 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Class: AppControllerClient</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="class">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lib/app_controller_client_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/app_controller_client.rb">lib/app_controller_client.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
<div id="parent-class-section" class="section">
|
56
|
+
<h3 class="section-header">Parent</h3>
|
57
|
+
|
58
|
+
<p class="link"><a href="Object.html">Object</a></p>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
|
62
|
+
|
63
|
+
<!-- Namespace Contents -->
|
64
|
+
|
65
|
+
|
66
|
+
<!-- Method Quickref -->
|
67
|
+
|
68
|
+
<div id="method-list-section" class="section">
|
69
|
+
<h3 class="section-header">Methods</h3>
|
70
|
+
<ul class="link-list">
|
71
|
+
|
72
|
+
<li><a href="#method-c-new">::new</a></li>
|
73
|
+
|
74
|
+
<li><a href="#method-i-get_acl">#get_acl</a></li>
|
75
|
+
|
76
|
+
<li><a href="#method-i-get_output">#get_output</a></li>
|
77
|
+
|
78
|
+
<li><a href="#method-i-make_call">#make_call</a></li>
|
79
|
+
|
80
|
+
<li><a href="#method-i-set_acl">#set_acl</a></li>
|
81
|
+
|
82
|
+
<li><a href="#method-i-start_neptune_job">#start_neptune_job</a></li>
|
83
|
+
|
84
|
+
</ul>
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
<!-- Included Modules -->
|
89
|
+
|
90
|
+
</div>
|
91
|
+
|
92
|
+
<div id="project-metadata">
|
93
|
+
|
94
|
+
|
95
|
+
<div id="fileindex-section" class="section project-section">
|
96
|
+
<h3 class="section-header">Files</h3>
|
97
|
+
<ul>
|
98
|
+
|
99
|
+
<li class="file"><a href="./LICENSE.html">LICENSE</a></li>
|
100
|
+
|
101
|
+
<li class="file"><a href="./README.html">README</a></li>
|
102
|
+
|
103
|
+
</ul>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<div id="classindex-section" class="section project-section">
|
108
|
+
<h3 class="section-header">Class/Module Index
|
109
|
+
<span class="search-toggle"><img src="./images/find.png"
|
110
|
+
height="16" width="16" alt="[+]"
|
111
|
+
title="show/hide quicksearch" /></span></h3>
|
112
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
113
|
+
<fieldset>
|
114
|
+
<legend>Quicksearch</legend>
|
115
|
+
<input type="text" name="quicksearch" value=""
|
116
|
+
class="quicksearch-field" />
|
117
|
+
</fieldset>
|
118
|
+
</form>
|
119
|
+
|
120
|
+
<ul class="link-list">
|
121
|
+
|
122
|
+
<li><a href="./AppControllerClient.html">AppControllerClient</a></li>
|
123
|
+
|
124
|
+
<li><a href="./CommonFunctions.html">CommonFunctions</a></li>
|
125
|
+
|
126
|
+
<li><a href="./Object.html">Object</a></li>
|
127
|
+
|
128
|
+
</ul>
|
129
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
130
|
+
</div>
|
131
|
+
|
132
|
+
|
133
|
+
</div>
|
134
|
+
</div>
|
135
|
+
|
136
|
+
<div id="documentation">
|
137
|
+
<h1 class="class">AppControllerClient</h1>
|
138
|
+
|
139
|
+
<div id="description">
|
140
|
+
|
141
|
+
<p>A client that uses SOAP messages to communicate with the underlying cloud
|
142
|
+
platform (here, AppScale). This client is similar to that used in the
|
143
|
+
AppScale Tools, but with non-Neptune SOAP calls removed.</p>
|
144
|
+
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<!-- Constants -->
|
148
|
+
|
149
|
+
|
150
|
+
<!-- Attributes -->
|
151
|
+
|
152
|
+
|
153
|
+
<!-- Methods -->
|
154
|
+
|
155
|
+
<div id="public-class-method-details" class="method-section section">
|
156
|
+
<h3 class="section-header">Public Class Methods</h3>
|
157
|
+
|
158
|
+
|
159
|
+
<div id="new-method" class="method-detail ">
|
160
|
+
<a name="method-c-new"></a>
|
161
|
+
|
162
|
+
|
163
|
+
<div class="method-heading">
|
164
|
+
<span class="method-name">new</span><span
|
165
|
+
class="method-args">(ip, secret)</span>
|
166
|
+
<span class="method-click-advice">click to toggle source</span>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
|
172
|
+
<p>A constructor that requires both the IP address of the machine to
|
173
|
+
communicate with as well as the secret (string) needed to perform
|
174
|
+
communication. AppControllers will reject SOAP calls if this secret
|
175
|
+
(basically a password) is not present - it can be found in the user’s
|
176
|
+
.appscale directory, and a helper method is usually present to fetch this
|
177
|
+
for us.</p>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
<div class="method-source-code"
|
182
|
+
id="new-source">
|
183
|
+
<pre>
|
184
|
+
<span class="ruby-comment"># File lib/app_controller_client.rb, line 26</span>
|
185
|
+
def initialize(ip, secret)
|
186
|
+
<span class="ruby-ivar">@ip</span> = ip
|
187
|
+
<span class="ruby-ivar">@secret</span> = secret
|
188
|
+
|
189
|
+
<span class="ruby-ivar">@conn</span> = <span class="ruby-constant">SOAP</span>::<span class="ruby-constant">RPC</span>::<span class="ruby-constant">Driver</span>.new("https://#{@ip}:17443")
|
190
|
+
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_start_job"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
191
|
+
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_get_output"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
192
|
+
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_get_acl"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
193
|
+
<span class="ruby-ivar">@conn</span>.add_method(<span class="ruby-string">"neptune_set_acl"</span>, <span class="ruby-string">"job_data"</span>, <span class="ruby-string">"secret"</span>)
|
194
|
+
end</pre>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div id="public-instance-method-details" class="method-section section">
|
208
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
209
|
+
|
210
|
+
|
211
|
+
<div id="get_acl-method" class="method-detail ">
|
212
|
+
<a name="method-i-get_acl"></a>
|
213
|
+
|
214
|
+
|
215
|
+
<div class="method-heading">
|
216
|
+
<span class="method-name">get_acl</span><span
|
217
|
+
class="method-args">(job_data)</span>
|
218
|
+
<span class="method-click-advice">click to toggle source</span>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
|
222
|
+
<div class="method-description">
|
223
|
+
|
224
|
+
<p>Returns the ACL associated with the named piece of data stored in the
|
225
|
+
underlying cloud platform. Right now, data can only be public or private,
|
226
|
+
but future versions will add individual user support. Input, output, and
|
227
|
+
exceptions mirror that of start_neptune_job.</p>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
<div class="method-source-code"
|
232
|
+
id="get_acl-source">
|
233
|
+
<pre>
|
234
|
+
<span class="ruby-comment"># File lib/app_controller_client.rb, line 113</span>
|
235
|
+
def get_acl(job_data)
|
236
|
+
result = <span class="ruby-string">""</span>
|
237
|
+
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
238
|
+
result = conn.neptune_get_acl(job_data, <span class="ruby-ivar">@secret</span>)
|
239
|
+
}
|
240
|
+
abort(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
241
|
+
return result
|
242
|
+
end</pre>
|
243
|
+
</div>
|
244
|
+
|
245
|
+
</div>
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
|
252
|
+
|
253
|
+
<div id="get_output-method" class="method-detail ">
|
254
|
+
<a name="method-i-get_output"></a>
|
255
|
+
|
256
|
+
|
257
|
+
<div class="method-heading">
|
258
|
+
<span class="method-name">get_output</span><span
|
259
|
+
class="method-args">(job_data)</span>
|
260
|
+
<span class="method-click-advice">click to toggle source</span>
|
261
|
+
</div>
|
262
|
+
|
263
|
+
|
264
|
+
<div class="method-description">
|
265
|
+
|
266
|
+
<p>Retrieves the output of a Neptune job, stored in an underlying database.
|
267
|
+
Within AppScale, a special application runs, referred to as the Repository,
|
268
|
+
which provides a key-value interface to Neptune job data. Data is stored as
|
269
|
+
though it were on a file system, therefore output be of the usual form
|
270
|
+
/folder/filename . Currently the contents of the file is returned as a
|
271
|
+
string to the caller, but as this is inefficient for non-trivial output
|
272
|
+
jobs, the next version of Neptune will add an additional call to directly
|
273
|
+
copy the output to a file on the local filesystem. See <a
|
274
|
+
href="AppControllerClient.html#method-i-start_neptune_job">start_neptune_job</a>
|
275
|
+
for conditions by which this method can abort as well as the input format
|
276
|
+
used for job_data.</p>
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
<div class="method-source-code"
|
281
|
+
id="get_output-source">
|
282
|
+
<pre>
|
283
|
+
<span class="ruby-comment"># File lib/app_controller_client.rb, line 99</span>
|
284
|
+
def get_output(job_data)
|
285
|
+
result = <span class="ruby-string">""</span>
|
286
|
+
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
287
|
+
result = conn.neptune_get_output(job_data, <span class="ruby-ivar">@secret</span>)
|
288
|
+
}
|
289
|
+
abort(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
290
|
+
return result
|
291
|
+
end</pre>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
</div>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
|
299
|
+
</div>
|
300
|
+
|
301
|
+
|
302
|
+
<div id="make_call-method" class="method-detail ">
|
303
|
+
<a name="method-i-make_call"></a>
|
304
|
+
|
305
|
+
|
306
|
+
<div class="method-heading">
|
307
|
+
<span class="method-name">make_call</span><span
|
308
|
+
class="method-args">(time, retry_on_except)</span>
|
309
|
+
<span class="method-click-advice">click to toggle source</span>
|
310
|
+
</div>
|
311
|
+
|
312
|
+
|
313
|
+
<div class="method-description">
|
314
|
+
|
315
|
+
<p>A helper method to make SOAP calls for us. This method is mainly here to
|
316
|
+
reduce code duplication: all SOAP calls expect a certain timeout and can
|
317
|
+
tolerate certain exceptions, so we consolidate this code into this method.
|
318
|
+
Here, the caller specifies the timeout for the SOAP call (or NO_TIMEOUT if
|
319
|
+
an infinite timeout is required) as well as whether the call should be
|
320
|
+
retried in the face of exceptions. Exceptions can occur if the machine is
|
321
|
+
not yet running or is too busy to handle the request, so these exceptions
|
322
|
+
are automatically retried regardless of the retry value. Typically callers
|
323
|
+
set this to false to catch ‘Connection Refused’ exceptions or the like.
|
324
|
+
Finally, the caller must provide a block of code that indicates the SOAP
|
325
|
+
call to make: this is really all that differs between the calling methods.
|
326
|
+
The result of the block is returned to the caller.</p>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
<div class="method-source-code"
|
331
|
+
id="make_call-source">
|
332
|
+
<pre>
|
333
|
+
<span class="ruby-comment"># File lib/app_controller_client.rb, line 50</span>
|
334
|
+
def make_call(time, retry_on_except)
|
335
|
+
begin
|
336
|
+
<span class="ruby-constant">Timeout</span>::timeout(time) {
|
337
|
+
yield if block_given?
|
338
|
+
}
|
339
|
+
rescue <span class="ruby-constant">Errno</span>::<span class="ruby-constant">ECONNREFUSED</span>
|
340
|
+
if retry_on_except
|
341
|
+
retry
|
342
|
+
else
|
343
|
+
abort(<span class="ruby-string">"Connection was refused. Is the AppController running?"</span>)
|
344
|
+
end
|
345
|
+
rescue <span class="ruby-constant">OpenSSL</span>::<span class="ruby-constant">SSL</span>::<span class="ruby-constant">SSLError</span>, <span class="ruby-constant">NotImplementedError</span>, <span class="ruby-constant">Timeout</span>::<span class="ruby-constant">Error</span>
|
346
|
+
retry
|
347
|
+
rescue <span class="ruby-constant">Exception</span> => except
|
348
|
+
if retry_on_except
|
349
|
+
retry
|
350
|
+
else
|
351
|
+
abort("We saw an unexpected error of the type #{except.class} with the following message:\n#{except}.")
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end</pre>
|
355
|
+
</div>
|
356
|
+
|
357
|
+
</div>
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
</div>
|
363
|
+
|
364
|
+
|
365
|
+
<div id="set_acl-method" class="method-detail ">
|
366
|
+
<a name="method-i-set_acl"></a>
|
367
|
+
|
368
|
+
|
369
|
+
<div class="method-heading">
|
370
|
+
<span class="method-name">set_acl</span><span
|
371
|
+
class="method-args">(job_data)</span>
|
372
|
+
<span class="method-click-advice">click to toggle source</span>
|
373
|
+
</div>
|
374
|
+
|
375
|
+
|
376
|
+
<div class="method-description">
|
377
|
+
|
378
|
+
<p>Sets the ACL of a specified pieces of data stored in the underlying cloud
|
379
|
+
platform. As is the case with <a
|
380
|
+
href="AppControllerClient.html#method-i-get_acl">get_acl</a>, ACLs can be
|
381
|
+
either public or private right now, but this will be expanded upon in the
|
382
|
+
future. As with the other SOAP calls, input, output, and exceptions mirror
|
383
|
+
that of start_neptune_job.</p>
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
<div class="method-source-code"
|
388
|
+
id="set_acl-source">
|
389
|
+
<pre>
|
390
|
+
<span class="ruby-comment"># File lib/app_controller_client.rb, line 127</span>
|
391
|
+
def set_acl(job_data)
|
392
|
+
result = <span class="ruby-string">""</span>
|
393
|
+
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
394
|
+
result = conn.neptune_set_acl(job_data, <span class="ruby-ivar">@secret</span>)
|
395
|
+
}
|
396
|
+
abort(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
397
|
+
return result
|
398
|
+
end</pre>
|
399
|
+
</div>
|
400
|
+
|
401
|
+
</div>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
|
406
|
+
</div>
|
407
|
+
|
408
|
+
|
409
|
+
<div id="start_neptune_job-method" class="method-detail ">
|
410
|
+
<a name="method-i-start_neptune_job"></a>
|
411
|
+
|
412
|
+
|
413
|
+
<div class="method-heading">
|
414
|
+
<span class="method-name">start_neptune_job</span><span
|
415
|
+
class="method-args">(job_data)</span>
|
416
|
+
<span class="method-click-advice">click to toggle source</span>
|
417
|
+
</div>
|
418
|
+
|
419
|
+
|
420
|
+
<div class="method-description">
|
421
|
+
|
422
|
+
<p>Initiates the start of a Neptune job, whether it be a HPC job (MPI, X10, or
|
423
|
+
MapReduce), or a scaling job (e.g., for AppScale itself). This method
|
424
|
+
should not be used for retrieving the output of a job or getting / setting
|
425
|
+
output ACLs, but just for starting new HPC / scaling jobs. This method
|
426
|
+
takes a hash containing the parameters of the job to run, and can abort if
|
427
|
+
the AppController it calls returns an error (e.g., if a bad secret is used
|
428
|
+
or the machine isn’t running). Otherwise, the return value of this method
|
429
|
+
is the result returned from the AppController.</p>
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
<div class="method-source-code"
|
434
|
+
id="start_neptune_job-source">
|
435
|
+
<pre>
|
436
|
+
<span class="ruby-comment"># File lib/app_controller_client.rb, line 80</span>
|
437
|
+
def start_neptune_job(job_data)
|
438
|
+
result = <span class="ruby-string">""</span>
|
439
|
+
make_call(<span class="ruby-constant">NO_TIMEOUT</span>, false) {
|
440
|
+
result = conn.neptune_start_job(job_data, <span class="ruby-ivar">@secret</span>)
|
441
|
+
}
|
442
|
+
abort(result) if result =~ <span class="ruby-regexp">/Error:/</span>
|
443
|
+
return result
|
444
|
+
end</pre>
|
445
|
+
</div>
|
446
|
+
|
447
|
+
</div>
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
|
452
|
+
</div>
|
453
|
+
|
454
|
+
|
455
|
+
</div>
|
456
|
+
|
457
|
+
|
458
|
+
</div>
|
459
|
+
|
460
|
+
<div id="validator-badges">
|
461
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
462
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
463
|
+
Rdoc Generator</a> 2</small>.</p>
|
464
|
+
</div>
|
465
|
+
|
466
|
+
</body>
|
467
|
+
</html>
|
468
|
+
|