Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
nomad-lab
nomad-FAIR
Commits
c7224e50
Commit
c7224e50
authored
Apr 01, 2020
by
Markus Scheidgen
Browse files
Added a parameter to reprocessing running processes.
parent
7b395ae1
Pipeline
#71898
passed with stages
in 13 minutes and 20 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/cli/admin/admin.py
View file @
c7224e50
...
...
@@ -40,7 +40,8 @@ from nomad.normalizing.springer import update_springer_data
def
__run_processing
(
uploads
,
parallel
:
int
,
process
:
Callable
[[
proc
.
Upload
],
None
],
label
:
str
):
uploads
,
parallel
:
int
,
process
:
Callable
[[
proc
.
Upload
],
None
],
label
:
str
,
reprocess_running
:
bool
=
False
):
if
isinstance
(
uploads
,
(
tuple
,
list
)):
uploads_count
=
len
(
uploads
)
...
...
@@ -64,7 +65,7 @@ def __run_processing(
logger
.
info
(
'%s started'
%
label
,
upload_id
=
upload
.
upload_id
)
completed
=
False
if
upload
.
process_running
:
if
upload
.
process_running
and
not
reprocess_running
:
logger
.
warn
(
'cannot trigger %s, since the upload is already/still processing'
%
label
,
current_process
=
upload
.
current_process
,
...
...
nomad/cli/admin/uploads.py
View file @
c7224e50
...
...
@@ -272,10 +272,13 @@ def msgpack(ctx, uploads):
@
uploads
.
command
(
help
=
'Reprocess selected uploads.'
)
@
click
.
argument
(
'UPLOADS'
,
nargs
=-
1
)
@
click
.
option
(
'--parallel'
,
default
=
1
,
type
=
int
,
help
=
'Use the given amount of parallel processes. Default is 1.'
)
@
click
.
option
(
'--reprocess-running'
,
is_flag
=
True
,
help
=
'Also reprocess already running processes.'
)
@
click
.
pass_context
def
re_process
(
ctx
,
uploads
,
parallel
:
int
):
def
re_process
(
ctx
,
uploads
,
parallel
:
int
,
reprocess_running
:
bool
):
_
,
uploads
=
query_uploads
(
ctx
,
uploads
)
__run_processing
(
uploads
,
parallel
,
lambda
upload
:
upload
.
re_process_upload
(),
're-processing'
)
__run_processing
(
uploads
,
parallel
,
lambda
upload
:
upload
.
re_process_upload
(),
're-processing'
,
reprocess_running
=
reprocess_running
)
@
uploads
.
command
(
help
=
'Repack selected uploads.'
)
...
...
nomad/processing/data.py
View file @
c7224e50
...
...
@@ -98,8 +98,10 @@ class Calc(Proc):
(
'upload_id'
,
'process_status'
),
(
'upload_id'
,
'metadata.nomad_version'
),
'parser'
,
'metadata.processed'
,
'metadata.last_processing'
,
'metadata.published'
,
'metadata.datasets'
'metadata.datasets'
,
'metadata.pid'
]
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment