Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
da1d5077
Commit
da1d5077
authored
8 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #9607: added link to observation/pipeline logfiles
parent
27a38c61
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py
+20
-0
20 additions, 0 deletions
...urceAssignment/ResourceAssignmentEditor/lib/webservice.py
with
20 additions
and
0 deletions
SAS/ResourceAssignment/ResourceAssignmentEditor/lib/webservice.py
+
20
−
0
View file @
da1d5077
...
...
@@ -31,6 +31,7 @@ from threading import Condition
from
datetime
import
datetime
import
time
import
logging
import
subprocess
from
dateutil
import
parser
,
tz
from
flask
import
Flask
from
flask
import
render_template
...
...
@@ -546,6 +547,8 @@ def getTaskHtml(task_id):
html
+=
'
<h1>Task %s</h1>
'
%
task_id
html
+=
'
<p><a href=
"
/tasks/%s/log.html
"
>%s log</a></p>
'
%
(
task
[
'
id
'
],
task
[
'
type
'
])
props
=
sorted
(
task
.
keys
())
html
+=
'
<tr><th>key</th><th>value</th></tr>
\n
'
...
...
@@ -631,7 +634,24 @@ def resourceClaimsForTaskHtml(task_id):
return
html
@app.route
(
'
/tasks/<int:task_id>/log.html
'
,
methods
=
[
'
GET
'
])
def
getTaskLogHtml
(
task_id
):
task
=
rarpc
.
getTask
(
task_id
)
cmd
=
[]
if
task
[
'
type
'
]
==
'
pipeline
'
:
cmd
=
[
'
ssh
'
,
'
-t
'
,
'
lofarsys@head01.cep4.control.lofar
'
,
'
cat /data/log/pipeline-%s-*.log
'
%
task
[
'
otdb_id
'
]]
else
:
cmd
=
[
'
ssh
'
,
'
-t
'
,
'
mcu001.control.lofar
'
,
'
cat /opt/lofar/var/log/MCU001
\\
:ObservationControl
\\
[0
\\
]
\\
{%s
\\
}.log*
'
%
task
[
'
otdb_id
'
]]
logger
.
info
(
'
'
.
join
(
cmd
))
proc
=
subprocess
.
Popen
(
cmd
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
out
,
err
=
proc
.
communicate
()
if
proc
.
returncode
==
0
:
return
out
,
200
,
{
'
Content-Type
'
:
'
text/plain; charset=utf-8
'
}
else
:
return
err
,
500
,
{
'
Content-Type
'
:
'
text/plain; charset=utf-8
'
}
def
main
():
# make sure we run in UTC timezone
...
...
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