Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
c4850c8c
Commit
c4850c8c
authored
2 years ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Replace 'R' status for correction with 'IP'
parent
c154570c
No related branches found
No related tags found
1 merge request
!800
Send 'E' and 'IP' statuses to myMdC for correction jobs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
webservice/job_monitor.py
+3
-4
3 additions, 4 deletions
webservice/job_monitor.py
webservice/webservice.py
+3
-3
3 additions, 3 deletions
webservice/webservice.py
with
6 additions
and
7 deletions
webservice/job_monitor.py
+
3
−
4
View file @
c4850c8c
...
@@ -285,12 +285,11 @@ class JobsMonitor:
...
@@ -285,12 +285,11 @@ class JobsMonitor:
status
=
'
F
'
if
success
else
'
E
'
# Finished/Error
status
=
'
F
'
if
success
else
'
E
'
# Finished/Error
self
.
mymdc_update_dark
(
r
[
'
mymdc_id
'
],
msg
,
status
)
self
.
mymdc_update_dark
(
r
[
'
mymdc_id
'
],
msg
,
status
)
def
mymdc_update_run
(
self
,
run_id
,
msg
,
status
=
'
R
'
):
def
mymdc_update_run
(
self
,
run_id
,
msg
,
status
=
'
IP
'
):
"""
Update correction status in MyMdC
"""
"""
Update correction status in MyMdC
"""
data
=
{
'
cal_pipeline_reply
'
:
msg
}
data
=
{
'
cal_pipeline_reply
'
:
msg
,
'
flg_cal_data_status
'
:
status
}
if
status
!=
'
R
'
:
if
status
!=
'
IP
'
:
data
[
'
cal_last_end_at
'
]
=
datetime
.
now
(
tz
=
timezone
.
utc
).
isoformat
()
data
[
'
cal_last_end_at
'
]
=
datetime
.
now
(
tz
=
timezone
.
utc
).
isoformat
()
data
[
'
flg_cal_data_status
'
]
=
status
response
=
self
.
mdc
.
update_run_api
(
run_id
,
data
)
response
=
self
.
mdc
.
update_run_api
(
run_id
,
data
)
if
response
.
status_code
!=
200
:
if
response
.
status_code
!=
200
:
log
.
error
(
"
Failed to update MDC run id %s
"
,
run_id
)
log
.
error
(
"
Failed to update MDC run id %s
"
,
run_id
)
...
...
This diff is collapsed.
Click to expand it.
webservice/webservice.py
+
3
−
3
View file @
c4850c8c
...
@@ -744,7 +744,7 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
...
@@ -744,7 +744,7 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
if
message
.
split
(
'
:
'
)[
0
]
in
(
'
FAILED
'
,
'
WARN
'
):
# Errors
if
message
.
split
(
'
:
'
)[
0
]
in
(
'
FAILED
'
,
'
WARN
'
):
# Errors
flag
=
'
E
'
flag
=
'
E
'
elif
message
.
split
(
'
:
'
)[
0
]
==
'
SUCCESS
'
:
# Success
elif
message
.
split
(
'
:
'
)[
0
]
==
'
SUCCESS
'
:
# Success
flag
=
'
R
'
if
action
==
'
correct
'
else
'
IP
'
flag
=
'
IP
'
if
'
Uploaded
'
in
message
or
'
Finished
'
in
message
:
if
'
Uploaded
'
in
message
or
'
Finished
'
in
message
:
flag
=
'
A
'
if
action
==
'
correct
'
else
'
F
'
flag
=
'
A
'
if
action
==
'
correct
'
else
'
F
'
else
:
# MDC Timeout
else
:
# MDC Timeout
...
@@ -753,8 +753,8 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
...
@@ -753,8 +753,8 @@ async def update_mdc_status(mdc: MetadataClient, action: str,
if
action
==
'
correct
'
:
if
action
==
'
correct
'
:
func
=
mdc
.
update_run_api
func
=
mdc
.
update_run_api
data
=
{
'
cal_pipeline_reply
'
:
message
}
data
=
{
'
cal_pipeline_reply
'
:
message
}
# Don't send
the 'R' status, as this may trigger another correction
# Don't send
In Progress; job_monitor will send this when jobs start.
if
flag
!=
'
R
'
:
if
flag
!=
'
IP
'
:
data
[
'
flg_cal_data_status
'
]
=
flag
data
[
'
flg_cal_data_status
'
]
=
flag
elif
action
==
'
dark_request
'
:
elif
action
==
'
dark_request
'
:
...
...
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