Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
calibration
pycalibration
Commits
2ac58db6
Commit
2ac58db6
authored
3 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Remove reservation checks from serve_overview
parent
ad858fba
No related branches found
No related tags found
1 merge request
!589
Remove Slurm reservation check from serve_overview
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webservice/serve_overview.py
+2
-17
2 additions, 17 deletions
webservice/serve_overview.py
webservice/templates/maxwell_status.html
+1
-5
1 addition, 5 deletions
webservice/templates/maxwell_status.html
with
3 additions
and
22 deletions
webservice/serve_overview.py
+
2
−
17
View file @
2ac58db6
...
@@ -12,7 +12,7 @@ from typing import Optional
...
@@ -12,7 +12,7 @@ from typing import Optional
import
yaml
import
yaml
from
jinja2
import
Template
from
jinja2
import
Template
from
xfel_calibrate.settings
import
free_nodes_cmd
,
preempt_nodes_cmd
,
reservation
# noqa: E501
from
xfel_calibrate.settings
import
free_nodes_cmd
,
preempt_nodes_cmd
from
.config
import
serve_overview
as
config
from
.config
import
serve_overview
as
config
...
@@ -159,16 +159,6 @@ class RequestHandler(BaseHTTPRequestHandler):
...
@@ -159,16 +159,6 @@ class RequestHandler(BaseHTTPRequestHandler):
preempt
=
int
(
check_output
(
preempt
=
int
(
check_output
(
preempt_nodes_cmd
,
shell
=
True
).
decode
(
'
utf8
'
))
preempt_nodes_cmd
,
shell
=
True
).
decode
(
'
utf8
'
))
nodes_avail_general
=
free
+
preempt
nodes_avail_general
=
free
+
preempt
ret
=
check_output
(
self
.
nodes_avail_res_cmd
.
format
(
reservation
),
shell
=
True
).
decode
(
'
utf8
'
)
ures
=
ret
.
split
(
"
/
"
)
if
len
(
ures
)
==
2
:
used
,
reserved
=
ures
else
:
used
=
0
reserved
=
0
nodes_avail_gr
=
"
{}/{}
"
.
format
(
int
(
reserved
)
-
int
(
used
),
reserved
)
total_jobs_running
=
check_output
(
self
.
total_jobs_cmd
,
shell
=
True
)
total_jobs_running
=
check_output
(
self
.
total_jobs_cmd
,
shell
=
True
)
total_jobs_running
=
total_jobs_running
.
decode
(
'
utf8
'
).
split
(
"
/
"
)[
0
]
total_jobs_running
=
total_jobs_running
.
decode
(
'
utf8
'
).
split
(
"
/
"
)[
0
]
...
@@ -187,16 +177,11 @@ class RequestHandler(BaseHTTPRequestHandler):
...
@@ -187,16 +177,11 @@ class RequestHandler(BaseHTTPRequestHandler):
reserved
)
reserved
)
upex_reservations
[
res
]
=
nodes_avail_res
upex_reservations
[
res
]
=
nodes_avail_res
recommendation
=
"
DON
'
T SUBMIT TO RESERVATION
"
if
nodes_avail_general
<
int
(
reserved
)
-
int
(
used
):
"
CONSIDER SUBMITTING TO RESERVATION
"
tmpl
=
Template
(
self
.
templates
[
"
maxwell-status
"
])
tmpl
=
Template
(
self
.
templates
[
"
maxwell-status
"
])
maxwell_status_r
=
tmpl
.
render
(
nodes_avail_general
=
nodes_avail_general
,
maxwell_status_r
=
tmpl
.
render
(
nodes_avail_general
=
nodes_avail_general
,
nodes_avail_general_res
=
nodes_avail_gr
,
total_jobs_running
=
total_jobs_running
,
total_jobs_running
=
total_jobs_running
,
upex_reservations
=
upex_reservations
,
upex_reservations
=
upex_reservations
,
recommendation
=
recommendation
)
)
last_n_lines
=
check_output
(
self
.
tail_log_cmd
,
last_n_lines
=
check_output
(
self
.
tail_log_cmd
,
shell
=
True
).
decode
(
'
utf8
'
).
split
(
"
\n
"
)
shell
=
True
).
decode
(
'
utf8
'
).
split
(
"
\n
"
)
...
...
This diff is collapsed.
Click to expand it.
webservice/templates/maxwell_status.html
+
1
−
5
View file @
2ac58db6
...
@@ -14,16 +14,12 @@
...
@@ -14,16 +14,12 @@
<dd>
{{ total_jobs_running }}
</dd>
<dd>
{{ total_jobs_running }}
</dd>
<dt>
Nodes available on general partition
</dt>
<dt>
Nodes available on general partition
</dt>
<dd>
{{ nodes_avail_general }}
</dd>
<dd>
{{ nodes_avail_general }}
</dd>
<dt>
Nodes available on general reservation
</dt>
<dd>
{{ nodes_avail_general_res }}
</dd>
{% for res, avail in upex_reservations.items() %}
{% for res, avail in upex_reservations.items() %}
<dt>
Nodes available on {{ res }}
</dt>
<dt>
Nodes available on {{ res }}
</dt>
<dd>
{{ avail }}
</dd>
<dd>
{{ avail }}
</dd>
{% endfor %}
{% endfor %}
<dt>
Recommendation
</dt>
<dd>
{{ recommendation }}
</dd>
</dl>
</dl>
<p><b>
Note:
</b>
This is only a hint!
Maxwell status can change quickly, so the feedback here
<p><b>
Note:
</b>
Maxwell status can change quickly, so the feedback here
can rapidly become outdated.
can rapidly become outdated.
</p>
</p>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment