Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New workergroups configuration UI (dashboard) #172

Open
wants to merge 19 commits into
base: 0.9.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
0ca3475
Adding job moving feature
DasFranck Jul 5, 2017
346e0ef
Checking destination_queue is not null or empty before moving a job (…
DasFranck Jul 5, 2017
2c73b9b
Prompt message modified for move action (dashboard/static/js/views/jo…
DasFranck Jul 5, 2017
a3fc2ec
Factoring move with requeue (basetasks/utils.py)
DasFranck Jul 5, 2017
d1ea418
Remove move member function in Job (mrq/job.py)
DasFranck Jul 5, 2017
d5086ad
Retry count is now shown in the dashboard (dashboard/static/js/views/…
DasFranck Jul 5, 2017
fff76c6
Remove move exception import in Job (mrq/job.py)
DasFranck Jul 5, 2017
efbfffe
Adding group job moving feature
DasFranck Jul 5, 2017
62cd693
Adding a supplementary for move action in groupactions (dashboard/sta…
DasFranck Jul 6, 2017
99e88b6
Adding a UI for worker groups configuration (not working for now)
DasFranck Jul 7, 2017
2ea541f
Adding buttons to delete/add workers groups (dashboard/static/js/view…
DasFranck Jul 7, 2017
2d1b322
Updating POST on /api/workergroups (dashboard/app.py)
DasFranck Jul 10, 2017
9bdea97
Updating UI for worker groups configuration, working and nearly finis…
DasFranck Jul 10, 2017
026592e
Don't send profiles with an empty name (Worker group configuration UI)
DasFranck Jul 10, 2017
d51866a
Don't send workergroups with an empty name (Dashboard - Worker group …
DasFranck Jul 11, 2017
7255838
Adding serial checking to avoid configuration conflict writing (Dashb…
DasFranck Jul 11, 2017
f806295
Adding a test for job killing and sleep test task (tests/{test_kill.p…
DasFranck Jul 12, 2017
4e77a07
Adding a killing feature for jobs (mrq/{job.py,worker.py})
DasFranck Jul 12, 2017
0d0b506
Replacing iteritems (non-existant in Python3) (mrq/dashboard/app.py)
DasFranck Jul 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mrq/basetasks/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def perform_action(self, action, query, destination_queue):
if list(query.keys()) == ["queue"]:
Queue(query["queue"]).empty()

elif action in ("requeue", "requeue_retry"):
elif action in ("requeue", "requeue_retry", "move"):

# Requeue task by groups of maximum 1k items (if all in the same
# queue)
Expand Down Expand Up @@ -127,7 +127,7 @@ def perform_action(self, action, query, destination_queue):
if destination_queue is not None:
updates["queue"] = destination_queue

if action == "requeue":
if action in ("requeue", "move"):
updates["retry_count"] = 0

self.collection.update({
Expand Down
21 changes: 21 additions & 0 deletions mrq/dashboard/static/js/views/jobs.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ define(["jquery", "underscore", "views/generic/datatablepage", "models"],functio
var action = $(evt.target).data("action");
var data = _.clone(this.filters);

if (action == "move") {
data["destination_queue"] = prompt("Enter destination queue");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

faire comme en dessous, ne rien faire si data["destination_queue"] est vide

}

data["action"] = action;
self.jobaction(evt, data);

Expand Down Expand Up @@ -223,6 +227,18 @@ define(["jquery", "underscore", "views/generic/datatablepage", "models"],functio
});
self.refreshCallStack(job_id);

} else if (action == "move") {

var queue = prompt("Enter destination queue");
if (queue != null && queue != "")
{
self.jobaction(evt, {
"id": job_id,
"action": action,
"destination_queue": queue
});
}

} else {

self.jobaction(evt, {
Expand Down Expand Up @@ -343,6 +359,10 @@ define(["jquery", "underscore", "views/generic/datatablepage", "models"],functio
display.push("cputime "+String(source.time).substring(0,6)+"s ("+source.switches+" switches)");
}

if (source.retry_count) {
display.push("retried " + String(source.retry_count) + " times");
}

return "<small>" + display.join("<br/>") + "</small>";

} else {
Expand Down Expand Up @@ -392,6 +412,7 @@ define(["jquery", "underscore", "views/generic/datatablepage", "models"],functio
"<br/><br/>"+
"<button class='btn btn-xs btn-danger pull-right' data-action='cancel'><span class='glyphicon glyphicon-remove-circle'></span> Cancel</button>"+
"<button class='btn btn-xs btn-warning' data-action='requeue'><span class='glyphicon glyphicon-refresh'></span> Requeue</button>"+
"<button class='btn btn-xs btn-warning' data-action='move'><span class='glyphicon glyphicon-refresh'></span> Move to...</button>"+
"</div>";
}
return "";
Expand Down
2 changes: 2 additions & 0 deletions mrq/dashboard/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,8 @@ <h4 class="modal-title"></h4>

<div class="pull-right js-jobs-groupactions">
<br/>
<button type="submit" class="btn btn-warning input-sm js-jobs-groupaction" data-action="move" style="padding:5px"><span class='glyphicon glyphicon-refresh'></span> Move these jobs to...</button>
&nbsp;
<button type="submit" class="btn btn-warning input-sm js-jobs-groupaction" data-action="requeue" style="padding:5px"><span class='glyphicon glyphicon-refresh'></span> Requeue these jobs</button>
&nbsp;
<button type="submit" class="btn btn-danger input-sm js-jobs-groupaction" data-action="cancel" style="padding:5px"><span class='glyphicon glyphicon-remove-circle'></span> Cancel these jobs</button>
Expand Down