Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
atdb-ldv
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
ASTRON SDC
atdb-ldv
Commits
56cd89fc
Commit
56cd89fc
authored
1 year ago
by
Nico Vermaas
Browse files
Options
Downloads
Patches
Plain Diff
use different srm_to_url translation when plots are moved
parent
b6dfc5ca
No related branches found
No related tags found
1 merge request
!296
SDC 971 handle moved inspectionplots
Pipeline
#49529
passed
1 year ago
Stage: build
Stage: deploy_to_test
Stage: deploy_to_production
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
atdb/taskdatabase/services/algorithms.py
+33
-15
33 additions, 15 deletions
atdb/taskdatabase/services/algorithms.py
atdb/taskdatabase/templates/taskdatabase/index.html
+1
-1
1 addition, 1 deletion
atdb/taskdatabase/templates/taskdatabase/index.html
with
34 additions
and
16 deletions
atdb/taskdatabase/services/algorithms.py
+
33
−
15
View file @
56cd89fc
...
...
@@ -684,9 +684,33 @@ def add_plots(task, token, translation, results, expand_image="False"):
# keep a temporary list of filenames to check uniqueness
plot_files
=
[]
# translate the path to a url for the original plots location
try
:
srm_to_url
=
Configuration
.
objects
.
get
(
key
=
'
dcache:srm_to_url
'
).
value
except
:
srm_to_url
=
"
srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/lofar/ops/disk/ldv/::https://webdav.grid.surfsara.nl/
"
# translate the path to a url for when the plots are moved by the archiver
try
:
srm_to_url_archive_disk
=
Configuration
.
objects
.
get
(
key
=
'
dcache:srm_to_url_archive_disk
'
).
value
except
:
srm_to_url_archive_disk
=
"
srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/lofar/ops/disk/projects/::https://webdav.grid.surfsara.nl/projects/
"
plots
=
task
.
quality_json
[
"
plots
"
]
count
=
0
for
plot
in
plots
:
# check where the plot lives and provide the translation
try
:
# is the plot already moved to its final location on disk in the lta?
base_surl
=
plot
[
'
surl_lta
'
]
translation
=
srm_to_url_archive_disk
.
split
(
"
::
"
)
except
:
# assume the orignal location.
base_surl
=
plot
[
'
surl
'
]
translation
=
srm_to_url
.
split
(
"
::
"
)
basename
=
plot
[
'
basename
'
]
checksum
=
plot
[
'
checksum
'
]
# plot_file = basename + str(plot['size'])
...
...
@@ -695,8 +719,7 @@ def add_plots(task, token, translation, results, expand_image="False"):
# only add unique files
if
not
plot_file
in
plot_files
:
count
=
count
+
1
surl
=
plot
[
'
surl
'
]
+
"
?action=show&authz=
"
+
str
(
token
)
surl
=
base_surl
+
"
?action=show&authz=
"
+
str
(
token
)
url
=
surl
.
replace
(
translation
[
0
],
translation
[
1
])
if
basename
.
endswith
(
'
png
'
)
and
expand_image
==
"
True
"
:
...
...
@@ -737,20 +760,14 @@ def add_plots(task, token, translation, results, expand_image="False"):
def
construct_inspectionplots
(
task
,
expand_image
=
"
False
"
,
source
=
'
task_id
'
):
# translate the path to a url
try
:
srm_to_url
=
Configuration
.
objects
.
get
(
key
=
'
dcache:srm_to_url
'
).
value
except
:
srm_to_url
=
"
srm://srm.grid.sara.nl/pnfs/grid.sara.nl/data/lofar/ops/disk/ldv/::https://webdav.grid.surfsara.nl/
"
token
=
str
(
Configuration
.
objects
.
get
(
key
=
'
dcache:token
'
).
value
)
translation
=
srm_to_url
.
split
(
"
::
"
)
# find the plots in the quality json structure
if
source
==
'
task_id
'
:
results
=
"
<h4>Inspection Plots and Summary Logs</h4>
"
results
+=
"
<p>Clicking a link will redirect to SURF SARA in a new browser window. </p>
"
results
=
add_plots
(
task
,
token
,
translation
,
results
,
expand_image
)
results
=
add_plots
(
task
,
token
,
results
,
expand_image
)
elif
source
==
'
sas_id
'
:
sas_id
=
task
.
sas_id
...
...
@@ -767,7 +784,7 @@ def construct_inspectionplots(task, expand_image="False", source='task_id'):
try
:
results
+=
'
<tr style=
"
background-color:#7EB1C4
"
><td colspan=
"
3
"
><b>Task
'
+
str
(
task
.
id
)
+
'
</b></td></tr>
'
results
=
add_plots
(
task
,
token
,
translation
,
results
,
expand_image
)
results
=
add_plots
(
task
,
token
,
results
,
expand_image
)
except
Exception
as
error
:
logger
.
error
(
error
)
...
...
@@ -829,7 +846,7 @@ def construct_summary(task):
line
+=
'
<tr><td colspan=
"
3
"
>
'
for
filename
in
added
:
line
+=
'
<tr><td colspan=
"
3
"
>
'
+
filename
+
'
<td></tr>
'
except
Exception
as
error
:
except
:
pass
try
:
...
...
@@ -838,13 +855,14 @@ def construct_summary(task):
line
+=
'
<th>Deleted</th>
'
for
filename
in
deleted
:
line
+=
'
<tr><td colspan=
"
3
"
>
'
+
filename
+
'
<td></tr>
'
except
Exception
as
error
:
except
:
pass
results
+=
line
except
Exception
as
error
:
logger
.
error
(
error
)
except
:
pass
totals
+=
'
<th>Totals</th><th></th><th></th>
'
totals
+=
'
<tr><td colspan=
"
2
"
><b>Input size</b></td><td>
'
+
str
(
total_size_input
)
+
'
</td></tr>
'
...
...
This diff is collapsed.
Click to expand it.
atdb/taskdatabase/templates/taskdatabase/index.html
+
1
−
1
View file @
56cd89fc
...
...
@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p
class=
"footer"
>
Version
9
May 2023
<p
class=
"footer"
>
Version
10
May 2023
</div>
{% include 'taskdatabase/refresh.html' %}
...
...
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