Skip to content

Commit 53ff9d6

Browse files
committed
make errored worker sandboxes more accessible
1 parent 3a7b126 commit 53ff9d6

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

cms/server/admin/templates/overview.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,13 @@
151151

152152
function link_submissions(s)
153153
{
154-
return s.replace(/submission ([0-9]+)/g,
154+
s = s.replace(/submission ([0-9]+)/g,
155155
function (match, n, offset, string) {
156156
return 'submission <a href="' + utils.url("submission", n) + '">' + n + '</a>';
157157
});
158+
s = s.replace(/sandbox\("([^"]+)", hash=([0-9a-f]+)\)/g,
159+
function(match, path, hash) {return 'sandbox("<a href="' + utils.url("file", hash, "sandbox.tar.gz") + '">' + path + '</a>")'});
160+
return s;
158161
}
159162

160163
function escape_html(s)

cms/service/EvaluationService.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,9 +475,14 @@ def action_finished(self, data: dict, shard: int, error=None):
475475
if job.success:
476476
logger.info("`%s' succeeded.", operation)
477477
else:
478-
logger.error("`%s' failed, see worker logs and (possibly) "
479-
"sandboxes at '%s'.",
480-
operation, " ".join(job.sandboxes))
478+
sboxes: list[str] = []
479+
for x in job.sandboxes:
480+
hash = job.sandbox_digests.get(x)
481+
if hash:
482+
sboxes.append(f'sandbox("{x}", hash={hash})')
483+
else:
484+
sboxes.append(f'sandbox("{x}")')
485+
logger.error(f"`{operation}' failed, see worker logs and (possibly) sandboxes: {' '.join(sboxes)}")
481486
if isinstance(to_ignore, list) and operation in to_ignore:
482487
logger.info("`%s' result ignored as requested", operation)
483488
else:

0 commit comments

Comments
 (0)