right_chimp 1.1.1 → 1.1.2

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.
data/CHANGES CHANGED
@@ -125,3 +125,8 @@ Version 1.1.0
125
125
  Version 1.1.1
126
126
  -------------
127
127
  * Bugfix: Enable timeouts on server arrays
128
+
129
+ Version 1.1.2
130
+ -------------
131
+ * Bugfix: Fix queueing of 'held' jobs to pull no more than one job from the queue
132
+ * Bugfix: Fix issue where ssh commands were non-functional
@@ -368,6 +368,7 @@ module Chimp
368
368
 
369
369
  jobs = queue.get_jobs_by_status(:running) if id == 'running'
370
370
  jobs = queue.get_jobs_by_status(:error) if id == 'error'
371
+ jobs = queue.get_jobs_by_status(:holding) if id == 'holding'
371
372
  jobs = queue.get_jobs if id == 'all'
372
373
 
373
374
  raise WEBrick::HTTPStatus::PreconditionFailed.new('invalid or missing job_id #{id}') unless jobs.size > 0
@@ -382,6 +383,16 @@ module Chimp
382
383
 
383
384
  resp.set_redirect( WEBrick::HTTPStatus::TemporaryRedirect, req.header['referer'])
384
385
 
386
+ #
387
+ # queue a job
388
+ #
389
+ elsif req.request_uri.path =~ /queue$/
390
+ jobs.each do |j|
391
+ j.queue
392
+ end
393
+
394
+ resp.set_redirect( WEBrick::HTTPStatus::TemporaryRedirect, req.header['referer'])
395
+
385
396
  #
386
397
  # retry a job
387
398
  #
@@ -57,6 +57,13 @@ module Chimp
57
57
  end
58
58
  end
59
59
 
60
+ #
61
+ # Convenience method to queue a held job
62
+ #
63
+ def queue
64
+ @group.queue(self.job_id)
65
+ end
66
+
60
67
  #
61
68
  # Convenience method to requeue
62
69
  #
@@ -48,13 +48,6 @@ module Chimp
48
48
  # Push a task into the queue
49
49
  #
50
50
  def push(g, w)
51
- if w.exec.right_script && w.exec.right_script.kind_of?(Hash)
52
- Log.debug "Pushing job '#{w.exec.right_script['name']}' into group '#{g}'"
53
- if w.status == Executor::STATUS_HOLDING
54
- Log.info "Holding job '#{w.exec.right_script['name']}'"
55
- end
56
- end
57
-
58
51
  raise "no group specified" unless g
59
52
  create_group(g) if not ChimpQueue[g]
60
53
  ChimpQueue[g].push(w)
@@ -196,6 +196,18 @@ module Chimp
196
196
  end
197
197
  end
198
198
 
199
+ #
200
+ # Queue a held job by id
201
+ #
202
+ def queue(id)
203
+ Log.debug "Requeuing job id #{id}"
204
+ job = @jobs_by_id[id]
205
+ job.owner = nil
206
+ job.time_start = Time.now
207
+ job.time_end = nil
208
+ job.status = Executor::STATUS_NONE
209
+ end
210
+
199
211
  #
200
212
  # Requeue a job by id
201
213
  #
@@ -159,7 +159,7 @@ jobs.each do |j|
159
159
  <% when Executor::STATUS_RUNNING, Executor::STATUS_RETRYING, Executor::STATUS_NONE %>
160
160
  <a href="#" onclick="chimpd_job_control(this, '/job/<%=id%>/cancel')">cancel</a>
161
161
  <% when Executor::STATUS_HOLDING %>
162
- <a href="#" onclick="chimpd_job_control(this, '/job/<%=id%>/retry')">queue</a>
162
+ <a href="#" onclick="chimpd_job_control(this, '/job/<%=id%>/queue')">queue</a>
163
163
  <a href="#" onclick="chimpd_job_control(this, '/job/<%=id%>/cancel')">cancel</a>
164
164
  <% when Executor::STATUS_DONE %>
165
165
  <a href="#" onclick="chimpd_job_control(this, '/job/<%=id%>/retry')">requeue</a>
@@ -1,3 +1,3 @@
1
1
  module Chimp
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: right_chimp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-19 00:00:00.000000000 Z
12
+ date: 2013-12-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest_connection