neptune 0.0.4 → 0.0.5

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.
Files changed (3) hide show
  1. data/README +13 -1
  2. data/lib/neptune.rb +89 -2
  3. metadata +5 -5
data/README CHANGED
@@ -3,7 +3,7 @@ Neptune: A Domain Specific Language for Deploying HPC
3
3
  Software on Cloud Platforms
4
4
 
5
5
  Neptune provides programmers with a simple interface
6
- by which they can deploy MPI, X10, and MapReduce jobs
6
+ by which they can deploy MPI, X10, MapReduce, UPC, and Erlang jobs
7
7
  to without needing to know the particulars of the underlying
8
8
  cloud platform. You only need to give Neptune your code,
9
9
  tell it how many machines to run on and where to put the output:
@@ -28,6 +28,10 @@ in it! Neptune will run 'make' on it (you can specify which target
28
28
  to make as well) and return to you a folder containing the standard
29
29
  out and standard error of the make command.
30
30
 
31
+ By default, Neptune jobs store their outputs in the underlying database
32
+ that AppScale is running over. As of Neptune 0.0.5, job outputs can
33
+ also be stored in Amazon S3, Eucalyptus Walrus, and Google Storage.
34
+
31
35
  Sample Neptune job scripts can be found in samples. Test scripts will
32
36
  be added to the 'test' folder soon.
33
37
 
@@ -53,6 +57,14 @@ in for a link to that as it becomes available.
53
57
 
54
58
  Version History:
55
59
 
60
+ March 18, 2011 - 0.0.5 released, adding support for storage outside
61
+ of AppScale to be used. Tested and working with Amazon S3 and Google
62
+ Storage
63
+
64
+ February 10, 2011 - 0.0.4 released, adding UPC and Erlang support,
65
+ and restructuring syntax to pass in hashes to method calls instead
66
+ of passing in blocks
67
+
56
68
  February 4, 2011 - 0.0.3 released, allowing users to use
57
69
  Neptune properly as a gem within Ruby code
58
70
 
@@ -19,9 +19,17 @@ $VERBOSE = nil
19
19
  #MR_RUN_JOB_REQUIRED = %w{ }
20
20
  #MR_REQUIRED = %w{ output }
21
21
 
22
+ # A list of Neptune jobs that do not require nodes to be spawned
23
+ # up for computation
24
+ NO_NODES_NEEDED = ["acl", "output", "compile"]
25
+
26
+ # A list of storage mechanisms that we can use to store and retrieve
27
+ # data to for Neptune jobs.
28
+ ALLOWED_STORAGE_TYPES = ["appdb", "gstorage", "s3"]
29
+
22
30
  # A list of jobs that require some kind of work to be done before
23
31
  # the actual computation can be performed.
24
- NEED_PREPROCESSING = ["compile", "mapreduce", "mpi"]
32
+ NEED_PREPROCESSING = ["compile", "erlang", "mapreduce", "mpi"]
25
33
 
26
34
  # A set of methods and constants that we've monkey-patched to enable Neptune
27
35
  # support. In the future, it is likely that the only exposed / monkey-patched
@@ -66,6 +74,19 @@ def preprocess_compile(job_data)
66
74
  job_data["@code"] = dest
67
75
  end
68
76
 
77
+ def preprocess_erlang(job_data)
78
+ source_code = File.expand_path(job_data["@code"])
79
+ unless File.exists?(source_code)
80
+ file_not_found = "The specified code, #{job_data['@code']}," +
81
+ " didn't exist. Please specify one that exists and try again"
82
+ abort(file_not_found)
83
+ end
84
+ dest_code = "/tmp/"
85
+
86
+ keyname = job_data["@keyname"]
87
+ CommonFunctions.scp_to_shadow(source_code, dest_code, keyname)
88
+ end
89
+
69
90
  # This preprocessing method handles copying data for regular
70
91
  # Hadoop MapReduce and Hadoop MapReduce Streaming. For the former
71
92
  # case, we copy over just the JAR the user has given us, and
@@ -97,12 +118,31 @@ end
97
118
  # code to the master node in AppScale - this node will
98
119
  # then copy it to whoever will run the MPI job.
99
120
  def preprocess_mpi(job_data)
121
+ if job_data["@procs_to_use"]
122
+ p = job_data["@procs_to_use"]
123
+ n = job_data["@nodes_to_use"]
124
+ if p < n
125
+ not_enough_procs = "When specifying both :procs_to_use and :nodes_to_use" +
126
+ ", :procs_to_use must be at least as large as :nodes_to_use. Please " +
127
+ "change this and try again. You specified :procs_to_use = #{p} and" +
128
+ ":nodes_to_use = #{n}."
129
+ abort(not_enough_procs)
130
+ end
131
+ end
132
+
100
133
  source_code = File.expand_path(job_data["@code"])
101
134
  unless File.exists?(source_code)
102
- file_not_found = "The specified code, #{job_data['@code']}," +
135
+ file_not_found = "The specified code, #{source_code}," +
103
136
  " didn't exist. Please specify one that exists and try again"
104
137
  abort(file_not_found)
105
138
  end
139
+
140
+ unless File.file?(source_code)
141
+ should_be_file = "The specified code, #{source_code}, was not a file - " +
142
+ " it was a directory or symbolic link. Please specify a file and try again."
143
+ abort(should_be_file)
144
+ end
145
+
106
146
  dest_code = "/tmp/thempicode"
107
147
 
108
148
  keyname = job_data["@keyname"]
@@ -145,6 +185,10 @@ def neptune(params)
145
185
  job_data["@job"] = nil
146
186
  job_data["@keyname"] = keyname || "appscale"
147
187
 
188
+ if job_data["@nodes_to_use"].class == Hash
189
+ job_data["@nodes_to_use"] = job_data["@nodes_to_use"].to_a.flatten
190
+ end
191
+
148
192
  if (job_data["@output"].nil? or job_data["@output"] == "")
149
193
  abort("Job output must be specified")
150
194
  end
@@ -153,6 +197,49 @@ def neptune(params)
153
197
  abort("Job output must begin with a slash ('/')")
154
198
  end
155
199
 
200
+ if job_data["@storage"]
201
+ storage = job_data["@storage"]
202
+ unless ALLOWED_STORAGE_TYPES.include?(storage)
203
+ msg = "Supported storage types are #{ALLOWED_STORAGE_TYPES.join(', ')}" +
204
+ " - we do not support #{storage}."
205
+ abort(msg)
206
+ end
207
+
208
+ # Our implementation for storing / retrieving via Google Storage uses
209
+ # the same library as we do for S3 - so just tell it that it's S3
210
+ if storage == "gstorage"
211
+ storage = "s3"
212
+ job_data["@storage"] = "s3"
213
+ end
214
+
215
+ if storage == "s3"
216
+ ["EC2_ACCESS_KEY", "EC2_SECRET_KEY", "S3_URL"].each { |item|
217
+ unless job_data["@#{item}"]
218
+ if ENV[item]
219
+ puts "Using #{item} from environment"
220
+ job_data["@#{item}"] = ENV[item]
221
+ else
222
+ msg = "When storing data to S3, #{item} must be specified or be in " +
223
+ "your environment. Please do so and try again."
224
+ abort(msg)
225
+ end
226
+ end
227
+ }
228
+
229
+ # the rightscale gems won't take the s3 url if it has http or https on
230
+ # the front, so rip it off first - it also doesn't like a trailing slash
231
+ s3_url = job_data["@S3_URL"]
232
+ puts "s3 url is now #{s3_url}"
233
+ if s3_url =~ /\Ahttp[s]?:\/\/(.*)\/\Z/
234
+ s3_url = $1
235
+ end
236
+ puts "s3 url is now #{s3_url}"
237
+ job_data["@S3_URL"] = s3_url
238
+ end
239
+ else
240
+ job_data["@storage"] = "appdb"
241
+ end
242
+
156
243
  #if job_data["@can_run_on"].class == Range
157
244
  # job_data["@can_run_on"] = job_data["@can_run_on"].to_a
158
245
  #elsif job_data["@can_run_on"].class == Fixnum
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neptune
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Bunch
@@ -15,7 +15,7 @@ autorequire: neptune
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-09 00:00:00 -08:00
18
+ date: 2011-03-18 00:00:00 -07:00
19
19
  default_executable: neptune
20
20
  dependencies: []
21
21
 
@@ -108,7 +108,7 @@ files:
108
108
  - README
109
109
  - LICENSE
110
110
  has_rdoc: true
111
- homepage: http://appscale.cs.ucsb.edu
111
+ homepage: http://neptune-lang.org
112
112
  licenses: []
113
113
 
114
114
  post_install_message: