Skip to content

Commit

Permalink
Merge pull request #65 from CDLUC3/requeue-special
Browse files Browse the repository at this point in the history
requeue special
  • Loading branch information
terrywbrady authored Feb 21, 2025
2 parents 3400399 + a04a8ac commit 7040821
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 9 deletions.
2 changes: 1 addition & 1 deletion mysql-ruby-lambda/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ DEPENDENCIES
uc3-ssm!

BUNDLED WITH
2.6.4
2.6.5
4 changes: 2 additions & 2 deletions src-admintool/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
specs:
ast (2.4.2)
aws-eventstream (1.3.1)
aws-partitions (1.1052.0)
aws-partitions (1.1053.0)
aws-sdk-core (3.219.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand Down Expand Up @@ -69,4 +69,4 @@ DEPENDENCIES
uc3-ssm!

BUNDLED WITH
2.6.4
2.6.5
6 changes: 3 additions & 3 deletions src-colladmin/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ GEM
specs:
ast (2.4.2)
aws-eventstream (1.3.1)
aws-partitions (1.1052.0)
aws-partitions (1.1053.0)
aws-sdk-core (3.219.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand Down Expand Up @@ -58,7 +58,7 @@ GEM
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0204)
mime-types-data (3.2025.0220)
mini_portile2 (2.8.8)
mysql2 (0.5.6)
netrc (0.11.0)
Expand Down Expand Up @@ -121,4 +121,4 @@ DEPENDENCIES
zookeeper

BUNDLED WITH
2.6.4
2.6.5
36 changes: 36 additions & 0 deletions src-colladmin/actions/zookeeper_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,42 @@ def perform_action
end
end

## Queue manipulation action using new mrt-zk - special handling to skip downloading
class ZkRequeueSpecialAction < ZkAction
def perform_action
if @qpath =~ /access/
acc = MerrittZK::Access.new(get_access_queue, get_id)
acc.load(@zk)
acc.set_status(@zk, MerrittZK::AccessState::Pending)
{ message: "Acc #{acc.id} requeued " }.to_json
else
job = MerrittZK::Job.new(get_id)
job.load(@zk)
js = job.json_property(@zk, MerrittZK::ZkKeys::STATUS)
laststat = js.fetch(:last_successful_status, '')

job.lock(@zk)

case laststat
when 'Pending', '', nil
job.set_status(@zk, MerrittZK::JobState::Estimating, job_retry: true)
when 'Estimating'
job.set_status(@zk, MerrittZK::JobState::Provisioning, job_retry: true)
when 'Provisioning' || 'Downloading'
job.set_status(@zk, MerrittZK::JobState::Processing, job_retry: true)
when 'Processing'
job.set_status(@zk, MerrittZK::JobState::Recording, job_retry: true)
when 'Recording'
job.set_status(@zk, MerrittZK::JobState::Notify, job_retry: true)
end

job.unlock(@zk)

{ message: "Job #{job.id} requeued to status #{job.status_name}" }.to_json
end
end
end

## Queue manipulation action using new mrt-zk
class ZkDeleteAction < ZkAction
def perform_action
Expand Down
17 changes: 17 additions & 0 deletions src-colladmin/config/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ queues:
description: |
Display the contents of the *ingest queue*. Items in this queue are slated to be processed by the Ingest service.
From this screen, items can be requeued.
- *Requeue* will return a job to the state AFTER last successful state for a job.
- *Requeue Special* will set a job to a specific state if available.
- If the last successful state is 'Provisioning', the job will be reset to 'Processing'.
- Otherwise, this button will perform the same action as the *Requeue* button.
report-datatypes:
- fprofile
- fstatus
Expand Down Expand Up @@ -987,6 +992,18 @@ requeue-mrtzk:
- requeue
documentation: |
ZK tbd
requeue-special-mrtzk:
link-title: Re-queue an item from a Zookeeper queue
class: ZkRequeueSpecialAction
category: Queue Management
sensitivity: irreversible change
testing: manual
description: |
Re-queue an item from a Zookeeper queue.
report-datatypes:
- requeue
documentation: |
ZK tbd
hold-queue-item-mrtzk:
link-title: Move a pending item from in Zookeeper queue to a Held status
class: ZkHoldAction
Expand Down
2 changes: 1 addition & 1 deletion src-common/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ DEPENDENCIES
uc3-ssm!

BUNDLED WITH
2.6.4
2.6.5
2 changes: 2 additions & 0 deletions src-common/template/api-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,8 @@ function format(cell, v, type, merritt_path) {
} else if (type == 'requeue-mrtzk' && v != '') {
p = colladmin_root + "/lambda?path=requeue-mrtzk&queue-path="+v;
makeLink(cell, 'Requeue', "javascript:ajax_invoke('"+encodeURIComponent(p)+"');testRequeue()").addClass("ajax");
p = colladmin_root + "/lambda?path=requeue-special-mrtzk&queue-path="+v;
makeLink(cell, 'Requeue Special', "javascript:ajax_invoke('"+encodeURIComponent(p)+"');testRequeue()").addClass("ajax");
} else if (type == 'hold' && v != '') {
p = colladmin_root + "/lambda?path=hold-queue-item&queue-path="+v;
makeLink(cell, 'Hold', "javascript:ajax_invoke('"+encodeURIComponent(p)+"')").addClass("ajax");
Expand Down
4 changes: 2 additions & 2 deletions src-testdriver/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GEM
specs:
ast (2.4.2)
aws-eventstream (1.3.1)
aws-partitions (1.1052.0)
aws-partitions (1.1053.0)
aws-sdk-core (3.219.0)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.992.0)
Expand Down Expand Up @@ -91,4 +91,4 @@ DEPENDENCIES
uc3-ssm!

BUNDLED WITH
2.6.4
2.6.5

0 comments on commit 7040821

Please sign in to comment.