mortar 0.12.5 → 0.12.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,6 +62,7 @@ class Mortar::Command::Jobs < Mortar::Command::Base
62
62
  # -s, --clustersize NUMNODES # Run job on a new cluster, with NUMNODES nodes (optional; must be >= 2 if provided)
63
63
  # -1, --singlejobcluster # Stop the cluster after job completes. (Default: false—-cluster can be used for other jobs, and will shut down after 1 hour of inactivity)
64
64
  # -2, --permanentcluster # Don't automatically stop the cluster after it has been idle for an hour (Default: false--cluster will be shut down after 1 hour of inactivity)
65
+ # -3, --spot # Use spot instances for this cluster (Default: false, only applicable to new clusters)
65
66
  # -p, --parameter NAME=VALUE # Set a pig parameter value in your script.
66
67
  # -f, --param-file PARAMFILE # Load pig parameter values from a file.
67
68
  # -d, --donotnotify # Don't send an email on job completion. (Default: false--an email will be sent to you once the job completes)
@@ -162,12 +163,14 @@ class Mortar::Command::Jobs < Mortar::Command::Base
162
163
  elsif options[:permanentcluster]
163
164
  cluster_type = CLUSTER_TYPE__PERMANENT
164
165
  end
166
+ use_spot_instances = options[:spot] || false
165
167
  api.post_job_new_cluster(project_name, script_name, git_ref, cluster_size,
166
168
  :pig_version => pig_version.version,
167
169
  :parameters => pig_parameters,
168
170
  :cluster_type => cluster_type,
169
171
  :notify_on_job_finish => notify_on_job_finish,
170
- :is_control_script => is_control_script).body
172
+ :is_control_script => is_control_script,
173
+ :use_spot_instances => use_spot_instances).body
171
174
  else
172
175
  cluster_id = options[:clusterid]
173
176
  api.post_job_existing_cluster(project_name, script_name, git_ref, cluster_id,
@@ -16,5 +16,5 @@
16
16
 
17
17
  module Mortar
18
18
  # see http://semver.org/
19
- VERSION = "0.12.5"
19
+ VERSION = "0.12.6"
20
20
  end
@@ -51,7 +51,8 @@ module Mortar::Command
51
51
  :parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
52
52
  :cluster_type => Jobs::CLUSTER_TYPE__SINGLE_JOB,
53
53
  :notify_on_job_finish => true,
54
- :is_control_script=> false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
54
+ :is_control_script=> false,
55
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
55
56
 
56
57
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
57
58
  stderr, stdout = execute("jobs:run pigscripts/my_script.pig -1 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
@@ -85,7 +86,8 @@ STDOUT
85
86
  :parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
86
87
  :cluster_type => Jobs::CLUSTER_TYPE__PERMANENT,
87
88
  :notify_on_job_finish => true,
88
- :is_control_script=> false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
89
+ :is_control_script=> false,
90
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
89
91
 
90
92
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
91
93
  stderr, stdout = execute("jobs:run pigscripts/my_script.pig -2 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
@@ -143,7 +145,8 @@ STDERR
143
145
  :parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
144
146
  :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
145
147
  :notify_on_job_finish => true,
146
- :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
148
+ :is_control_script=>false,
149
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
147
150
 
148
151
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
149
152
  stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
@@ -153,6 +156,41 @@ Sending code snapshot to Mortar... done
153
156
  Requesting job execution... done
154
157
  job_id: c571a8c7f76a4fd4a67c103d753e2dd5
155
158
 
159
+ Job status can be viewed on the web at:
160
+
161
+ http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5
162
+
163
+ Or by running:
164
+
165
+ mortar jobs:status c571a8c7f76a4fd4a67c103d753e2dd5 --poll
166
+
167
+ STDOUT
168
+ end
169
+ end
170
+
171
+ it "runs a job on a new spot instance cluster" do
172
+ with_git_initialized_project do |p|
173
+ # stub api requests
174
+ job_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
175
+ job_url = "http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5"
176
+ cluster_size = 5
177
+
178
+ mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String),cluster_size,
179
+ :pig_version => "0.9",
180
+ :parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
181
+ :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
182
+ :notify_on_job_finish => true,
183
+ :is_control_script=>false,
184
+ :use_spot_instances=>true) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
185
+
186
+ write_file(File.join(p.pigscripts_path, "my_script.pig"))
187
+ stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR --spot", p, @git)
188
+ stdout.should == <<-STDOUT
189
+ Taking code snapshot... done
190
+ Sending code snapshot to Mortar... done
191
+ Requesting job execution... done
192
+ job_id: c571a8c7f76a4fd4a67c103d753e2dd5
193
+
156
194
  Job status can be viewed on the web at:
157
195
 
158
196
  http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5
@@ -243,7 +281,8 @@ STDOUT
243
281
  :parameters => [],
244
282
  :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
245
283
  :notify_on_job_finish => true,
246
- :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
284
+ :is_control_script=>false,
285
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
247
286
 
248
287
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
249
288
  stderr, stdout = execute("jobs:run my_script", p, @git)
@@ -279,7 +318,8 @@ STDOUT
279
318
  :parameters => [],
280
319
  :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
281
320
  :notify_on_job_finish => true,
282
- :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
321
+ :is_control_script=>false,
322
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
283
323
 
284
324
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
285
325
  stderr, stdout = execute("jobs:run pigscripts/my_script.pig ", p, @git)
@@ -400,7 +440,8 @@ STDOUT
400
440
  :parameters => match_array([{"name" => "FIRST", "value" => "FOO"}, {"name" => "SECOND", "value" => "BAR"}, {"name" => "THIRD", "value" => "BEAR"}]),
401
441
  :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
402
442
  :notify_on_job_finish => true,
403
- :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id})}
443
+ :is_control_script=>false,
444
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id})}
404
445
 
405
446
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
406
447
 
@@ -426,7 +467,8 @@ PARAMS
426
467
  :parameters => match_array([{"name" => "FIRST", "value" => "FOO"}, {"name" => "SECOND", "value" => "BAR"}, {"name" => "THIRD", "value" => "BEAR"}]),
427
468
  :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
428
469
  :notify_on_job_finish => true,
429
- :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id})}
470
+ :is_control_script=>false,
471
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id})}
430
472
 
431
473
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
432
474
 
@@ -480,7 +522,8 @@ STDERR
480
522
  :parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
481
523
  :cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
482
524
  :notify_on_job_finish => true,
483
- :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
525
+ :is_control_script=>false,
526
+ :use_spot_instances => false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
484
527
 
485
528
  write_file(File.join(p.pigscripts_path, "my_script.pig"))
486
529
  stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
metadata CHANGED
@@ -1,130 +1,199 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mortar
3
- version: !ruby/object:Gem::Version
4
- version: 0.12.5
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.12.6
5
+ prerelease:
5
6
  platform: ruby
6
- authors:
7
+ authors:
7
8
  - Mortar Data
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
-
12
- date: 2013-11-08 00:00:00 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
12
+ date: 2013-11-21 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
15
  name: rdoc
16
- prerelease: false
17
- requirement: &id001 !ruby/object:Gem::Requirement
18
- requirements:
19
- - - ">="
20
- - !ruby/object:Gem::Version
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
21
  version: 4.0.0
22
22
  type: :runtime
23
- version_requirements: *id001
24
- - !ruby/object:Gem::Dependency
25
- name: mortar-api-ruby
26
23
  prerelease: false
27
- requirement: &id002 !ruby/object:Gem::Requirement
28
- requirements:
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 4.0.0
30
+ - !ruby/object:Gem::Dependency
31
+ name: mortar-api-ruby
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
29
35
  - - ~>
30
- - !ruby/object:Gem::Version
31
- version: 0.7.2
36
+ - !ruby/object:Gem::Version
37
+ version: 0.7.3
32
38
  type: :runtime
33
- version_requirements: *id002
34
- - !ruby/object:Gem::Dependency
35
- name: netrc
36
39
  prerelease: false
37
- requirement: &id003 !ruby/object:Gem::Requirement
38
- requirements:
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ version: 0.7.3
46
+ - !ruby/object:Gem::Dependency
47
+ name: netrc
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
39
51
  - - ~>
40
- - !ruby/object:Gem::Version
41
- version: "0.7"
52
+ - !ruby/object:Gem::Version
53
+ version: '0.7'
42
54
  type: :runtime
43
- version_requirements: *id003
44
- - !ruby/object:Gem::Dependency
45
- name: launchy
46
55
  prerelease: false
47
- requirement: &id004 !ruby/object:Gem::Requirement
48
- requirements:
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
49
59
  - - ~>
50
- - !ruby/object:Gem::Version
51
- version: "2.1"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.7'
62
+ - !ruby/object:Gem::Dependency
63
+ name: launchy
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '2.1'
52
70
  type: :runtime
53
- version_requirements: *id004
54
- - !ruby/object:Gem::Dependency
55
- name: parseconfig
56
71
  prerelease: false
57
- requirement: &id005 !ruby/object:Gem::Requirement
58
- requirements:
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '2.1'
78
+ - !ruby/object:Gem::Dependency
79
+ name: parseconfig
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
59
83
  - - ~>
60
- - !ruby/object:Gem::Version
84
+ - !ruby/object:Gem::Version
61
85
  version: 1.0.2
62
86
  type: :runtime
63
- version_requirements: *id005
64
- - !ruby/object:Gem::Dependency
65
- name: excon
66
87
  prerelease: false
67
- requirement: &id006 !ruby/object:Gem::Requirement
68
- requirements:
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
69
91
  - - ~>
70
- - !ruby/object:Gem::Version
71
- version: "0.28"
92
+ - !ruby/object:Gem::Version
93
+ version: 1.0.2
94
+ - !ruby/object:Gem::Dependency
95
+ name: excon
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ~>
100
+ - !ruby/object:Gem::Version
101
+ version: '0.28'
72
102
  type: :development
73
- version_requirements: *id006
74
- - !ruby/object:Gem::Dependency
75
- name: fakefs
76
103
  prerelease: false
77
- requirement: &id007 !ruby/object:Gem::Requirement
78
- requirements:
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ version: '0.28'
110
+ - !ruby/object:Gem::Dependency
111
+ name: fakefs
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
79
115
  - - ~>
80
- - !ruby/object:Gem::Version
116
+ - !ruby/object:Gem::Version
81
117
  version: 0.4.2
82
118
  type: :development
83
- version_requirements: *id007
84
- - !ruby/object:Gem::Dependency
85
- name: gem-release
86
119
  prerelease: false
87
- requirement: &id008 !ruby/object:Gem::Requirement
88
- requirements:
89
- - &id009
90
- - ">="
91
- - !ruby/object:Gem::Version
92
- version: "0"
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ~>
124
+ - !ruby/object:Gem::Version
125
+ version: 0.4.2
126
+ - !ruby/object:Gem::Dependency
127
+ name: gem-release
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
93
134
  type: :development
94
- version_requirements: *id008
95
- - !ruby/object:Gem::Dependency
96
- name: rake
97
135
  prerelease: false
98
- requirement: &id010 !ruby/object:Gem::Requirement
99
- requirements:
100
- - *id009
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: rake
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
101
150
  type: :development
102
- version_requirements: *id010
103
- - !ruby/object:Gem::Dependency
104
- name: rr
105
151
  prerelease: false
106
- requirement: &id011 !ruby/object:Gem::Requirement
107
- requirements:
108
- - *id009
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ - !ruby/object:Gem::Dependency
159
+ name: rr
160
+ requirement: !ruby/object:Gem::Requirement
161
+ none: false
162
+ requirements:
163
+ - - ! '>='
164
+ - !ruby/object:Gem::Version
165
+ version: '0'
109
166
  type: :development
110
- version_requirements: *id011
111
- - !ruby/object:Gem::Dependency
112
- name: rspec
113
167
  prerelease: false
114
- requirement: &id012 !ruby/object:Gem::Requirement
115
- requirements:
116
- - *id009
168
+ version_requirements: !ruby/object:Gem::Requirement
169
+ none: false
170
+ requirements:
171
+ - - ! '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ - !ruby/object:Gem::Dependency
175
+ name: rspec
176
+ requirement: !ruby/object:Gem::Requirement
177
+ none: false
178
+ requirements:
179
+ - - ! '>='
180
+ - !ruby/object:Gem::Version
181
+ version: '0'
117
182
  type: :development
118
- version_requirements: *id012
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ none: false
186
+ requirements:
187
+ - - ! '>='
188
+ - !ruby/object:Gem::Version
189
+ version: '0'
119
190
  description: Client library and command-line tool to interact with the Mortar service.
120
191
  email: support@mortardata.com
121
- executables:
192
+ executables:
122
193
  - mortar
123
194
  extensions: []
124
-
125
195
  extra_rdoc_files: []
126
-
127
- files:
196
+ files:
128
197
  - README.md
129
198
  - bin/mortar
130
199
  - css/illustrate.css
@@ -250,28 +319,26 @@ files:
250
319
  - spec/support/display_message_matcher.rb
251
320
  homepage: http://mortardata.com/
252
321
  licenses: []
253
-
254
- metadata: {}
255
-
256
322
  post_install_message:
257
323
  rdoc_options: []
258
-
259
- require_paths:
324
+ require_paths:
260
325
  - lib
261
- required_ruby_version: !ruby/object:Gem::Requirement
262
- requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
326
+ required_ruby_version: !ruby/object:Gem::Requirement
327
+ none: false
328
+ requirements:
329
+ - - ! '>='
330
+ - !ruby/object:Gem::Version
265
331
  version: 1.8.7
266
- required_rubygems_version: !ruby/object:Gem::Requirement
267
- requirements:
268
- - *id009
332
+ required_rubygems_version: !ruby/object:Gem::Requirement
333
+ none: false
334
+ requirements:
335
+ - - ! '>='
336
+ - !ruby/object:Gem::Version
337
+ version: '0'
269
338
  requirements: []
270
-
271
339
  rubyforge_project:
272
- rubygems_version: 2.0.9
340
+ rubygems_version: 1.8.23
273
341
  signing_key:
274
- specification_version: 4
342
+ specification_version: 3
275
343
  summary: Client library and CLI to interact with the Mortar service.
276
344
  test_files: []
277
-
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- data.tar.gz: b900035bf87f38c4ae6aedd392ba03a69eec6b47
4
- metadata.gz: dad652ba02dba009df5e9927b30c0950c2f391fb
5
- SHA512:
6
- data.tar.gz: 44286eb21da7ab55d4a99b67417004f171439b801aed8aab92591a855a41977171a756acd726d35f9f5ed67f3f89ec65900ec83801e1867c3605a1db5caa45ad
7
- metadata.gz: 9d50341259fd7bbd754a32f9507b6e62d2e0a254010a71f56477fc0a3443d4aac8d21bda3cdff8b1853ae987c26c81f390a9bd3b0250510cb4a7ce5f441f028c