Skip to content
Snippets Groups Projects
Commit 660dbe63 authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Add job monitor logs to serve_overview

parent 18f1004d
No related branches found
No related tags found
1 merge request!668[Webservice] Monitor Slurm jobs in separate process
This commit is part of merge request !668. Comments created here will be created in the context of that merge request.
......@@ -12,6 +12,7 @@ shell-commands:
total-jobs: "sinfo -p exfel -o %A --noheader"
tail-log: "tail -5000 web.log"
cat-log: "cat web.log"
tail-monitor-log: "tail -5000 monitor.log"
run-candidates:
- "--run-high"
......
......@@ -147,7 +147,16 @@ class RequestHandler(BaseHTTPRequestHandler):
if ("Response error from MDC" not in l
and "DEBUG" not in l)]
tmpl = Template(self.templates["log-output"])
log_output_r = tmpl.render(logout="<br>".join(last_n_lines[::-1]))
log_output_r = tmpl.render(service="Webservice", lines=last_n_lines)
last_n_lines_monitor = [l for l in check_output(
config["shell-commands"]["tail-log-monitor"], shell=True
).decode('utf8').split("\n")
if "DEBUG" not in l
]
log_output_monitor_r = tmpl.render(
service="Job monitor", lines=last_n_lines_monitor
)
last_n_lines = check_output(self.cat_log_cmd,
shell=True).decode('utf8').split("\n")[
......@@ -280,6 +289,7 @@ class RequestHandler(BaseHTTPRequestHandler):
tmpl = Template(self.templates["main-doc"])
message = tmpl.render(maxwell_status=maxwell_status_r,
log_output=log_output_r,
log_output_monitor=log_output_monitor_r,
last_characterizations=last_characterizations_r,
last_correction=last_correction_r,
running_jobs=running_jobs_r)
......
<div class="block">
<h2> Webservice log </h2>
<h2> {{ service }} log </h2>
<div class="log-out">
{{ logout }}
{{ lines | reverse | join("<br>") }}
</div>
</div>
......@@ -10,5 +10,6 @@
{{ last_characterizations }}
{{ last_correction }}
{{ log_output }}
{{ log_output_monitor }}
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment