Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nomad-FAIR
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
nomad-lab
nomad-FAIR
Commits
f7f98c71
Commit
f7f98c71
authored
5 years ago
by
Markus Scheidgen
Browse files
Options
Downloads
Patches
Plain Diff
Fixed broken reset on re-process.
parent
8a0387a4
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!87
V0.7.5
Pipeline
#68844
passed
5 years ago
Stage: build
Stage: test
Stage: release
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
nomad/cli/admin/uploads.py
+3
-4
3 additions, 4 deletions
nomad/cli/admin/uploads.py
nomad/processing/base.py
+4
-4
4 additions, 4 deletions
nomad/processing/base.py
nomad/processing/data.py
+10
-6
10 additions, 6 deletions
nomad/processing/data.py
with
17 additions
and
14 deletions
nomad/cli/admin/uploads.py
+
3
−
4
View file @
f7f98c71
...
...
@@ -162,10 +162,9 @@ def reset(ctx, uploads, with_calcs):
i
=
0
for
upload
in
uploads
:
if
with_calcs
:
for
calc
in
proc
.
Calc
.
objects
(
upload_id
=
upload
.
upload_id
):
calc
.
reset
()
calc
.
save
()
proc
.
Calc
.
_get_collection
().
update_many
(
dict
(
upload_id
=
upload
.
upload_id
),
{
'
$set
'
:
proc
.
Calc
.
reset_pymongo_update
()})
upload
.
reset
()
upload
.
save
()
...
...
This diff is collapsed.
Click to expand it.
nomad/processing/base.py
+
4
−
4
View file @
f7f98c71
...
...
@@ -166,8 +166,8 @@ class Proc(Document, metaclass=ProcMetaclass):
"""
Returns True of an asynchrounous process is currently running.
"""
return
self
.
process_status
is
not
None
and
self
.
process_status
!=
PROCESS_COMPLETED
@
static
method
def
process_running_mongoengine_query
():
@
class
method
def
process_running_mongoengine_query
(
cls
):
"""
Returns a mongoengine query dict (to be used in objects) to find running processes.
"""
return
dict
(
process_status__in
=
[
PROCESS_CALLED
,
PROCESS_RUNNING
])
...
...
@@ -203,8 +203,8 @@ class Proc(Document, metaclass=ProcMetaclass):
self
.
warnings
=
[]
self
.
worker_hostname
=
worker_hostname
@
static
method
def
reset_pymongo_update
(
worker_hostname
:
str
=
None
):
@
class
method
def
reset_pymongo_update
(
cls
,
worker_hostname
:
str
=
None
):
"""
Returns a pymongo update dict part to reset calculations.
"""
return
dict
(
current_task
=
None
,
tasks_status
=
PENDING
,
errors
=
[],
warnings
=
[],
...
...
This diff is collapsed.
Click to expand it.
nomad/processing/data.py
+
10
−
6
View file @
f7f98c71
...
...
@@ -515,9 +515,10 @@ class Upload(Proc):
logger
=
super
().
get_logger
()
user
=
self
.
uploader
user_name
=
'
%s %s
'
%
(
user
.
first_name
,
user
.
last_name
)
# We are not using 'user_id' because logstash (?) will filter these entries ?!
logger
=
logger
.
bind
(
upload_id
=
self
.
upload_id
,
upload_name
=
self
.
name
,
user_name
=
user_name
,
user
_id
=
user
.
user_id
,
**
kwargs
)
user
=
user
.
user_id
,
**
kwargs
)
return
logger
@classmethod
...
...
@@ -536,8 +537,7 @@ class Upload(Proc):
if
'
upload_id
'
not
in
kwargs
:
kwargs
.
update
(
upload_id
=
utils
.
create_uuid
())
# We are not using 'user_id' because logstash (?) will filter these entries ?!
kwargs
.
update
(
user
=
user
.
user_id
)
kwargs
.
update
(
user_id
=
user
.
user_id
)
self
=
super
().
create
(
**
kwargs
)
self
.
_continue_with
(
'
uploading
'
)
...
...
@@ -648,8 +648,6 @@ class Upload(Proc):
logger
=
self
.
get_logger
()
logger
.
info
(
'
started to re-process
'
)
logger
.
error
(
'
WHAAATTT
'
)
raise
Exception
(
'
break
'
)
# mock the steps of actual processing
self
.
_continue_with
(
'
uploading
'
)
...
...
@@ -668,7 +666,7 @@ class Upload(Proc):
logger
.
warn
(
'
a process is already running on calc
'
,
calc_id
=
calc
.
calc_id
)
# reset all calcs
Calc
.
_get_collection
().
update
(
Calc
.
_get_collection
().
update
_many
(
dict
(
upload_id
=
self
.
upload_id
),
{
'
$set
'
:
Calc
.
reset_pymongo_update
(
worker_hostname
=
self
.
worker_hostname
)})
...
...
@@ -886,6 +884,12 @@ class Upload(Proc):
self
.
joined
=
False
super
().
reset
()
@classmethod
def
reset_pymongo_update
(
cls
,
worker_hostname
:
str
=
None
):
update
=
super
().
reset_pymongo_update
()
update
.
update
(
joined
=
False
)
return
update
def
_cleanup_after_processing
(
self
):
# send email about process finish
user
=
self
.
uploader
...
...
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