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
ce3954e5
Commit
ce3954e5
authored
Apr 13, 2021
by
Markus Scheidgen
Browse files
Fixed CLI based re-processing.
parent
5c4bead7
Pipeline
#98263
passed with stages
in 26 minutes and 9 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/cli/admin/admin.py
View file @
ce3954e5
...
...
@@ -85,7 +85,8 @@ def __run_parallel(
def
__run_processing
(
uploads
,
parallel
:
int
,
process
,
label
:
str
,
reprocess_running
:
bool
=
False
):
uploads
,
parallel
:
int
,
process
,
label
:
str
,
reprocess_running
:
bool
=
False
,
wait_for_tasks
:
bool
=
True
):
def
run_process
(
upload
,
logger
):
logger
.
info
(
...
...
@@ -101,7 +102,10 @@ def __run_processing(
else
:
upload
.
reset
(
force
=
True
)
process
(
upload
)
upload
.
block_until_process_complete
(
interval
=
.
5
)
if
wait_for_tasks
:
upload
.
block_until_complete
(
interval
=
.
5
)
else
:
upload
.
block_until_process_complete
(
interval
=
.
5
)
if
upload
.
tasks_status
==
proc
.
FAILURE
:
logger
.
info
(
'%s with failure'
%
label
,
upload_id
=
upload
.
upload_id
)
...
...
@@ -198,7 +202,9 @@ def lift_embargo(dry, parallel):
search
.
index_all
(
entries
)
if
not
dry
:
__run_processing
(
uploads_to_repack
,
parallel
,
lambda
upload
:
upload
.
re_pack
(),
're-packing'
)
__run_processing
(
uploads_to_repack
,
parallel
,
lambda
upload
:
upload
.
re_pack
(),
're-packing'
,
wait_for_tasks
=
False
)
@
admin
.
command
()
...
...
nomad/cli/admin/uploads.py
View file @
ce3954e5
...
...
@@ -340,7 +340,9 @@ def re_process(ctx, uploads, parallel: int, reprocess_running: bool):
@
click
.
pass_context
def
re_pack
(
ctx
,
uploads
,
parallel
:
int
):
_
,
uploads
=
query_uploads
(
ctx
,
uploads
)
__run_processing
(
uploads
,
parallel
,
lambda
upload
:
upload
.
re_pack
(),
're-packing'
)
__run_processing
(
uploads
,
parallel
,
lambda
upload
:
upload
.
re_pack
(),
're-packing'
,
wait_for_tasks
=
False
)
@
uploads
.
command
(
help
=
'Attempt to abort the processing of uploads.'
)
...
...
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