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
genotoul-bioinfo
jflow
Commits
a176dc05
Commit
a176dc05
authored
Nov 16, 2015
by
Frédéric Escudié
Browse files
Manage wf postprocess status.
parent
a6c2b748
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/jflow/workflow.py
View file @
a176dc05
...
...
@@ -94,6 +94,7 @@ class Workflow(threading.Thread):
OLD_EXTENSION
=
".old"
DEFAULT_GROUP
=
"default"
STATUS_PENDING
=
"pending"
STATUS_STARTED
=
"started"
STATUS_COMPLETED
=
"completed"
STATUS_FAILED
=
"failed"
...
...
@@ -117,6 +118,7 @@ class Workflow(threading.Thread):
self
.
globals
=
{}
self
.
options
=
Options
()
self
.
status
=
self
.
STATUS_STARTED
self
.
postprocess_status
=
self
.
STATUS_PENDING
self
.
start_time
=
None
self
.
end_time
=
None
self
.
__step
=
None
...
...
@@ -507,8 +509,8 @@ class Workflow(threading.Thread):
else
:
completed
=
"completed:"
+
str
(
status_info
[
"completed"
])
if
display_errors
and
len
(
status_info
[
"failed_commands"
])
>
0
:
if
components_errors
==
""
:
components_errors
=
"Failed Commands :
\n
"
if
components_errors
==
""
:
components_errors
=
"Failed Commands :
\n
"
components_errors
+=
" - "
+
component
+
" :
\n
"
+
"
\n
"
.
join
(
status_info
[
"failed_commands"
])
+
"
\n
"
status
+=
" - "
+
component
+
", time elapsed "
+
time_format
(
status_info
[
"time"
])
+
\
" (total:"
+
str
(
status_info
[
"tasks"
])
+
", "
+
waiting
+
", "
+
running
+
", "
+
failed
+
\
...
...
@@ -820,6 +822,7 @@ class Workflow(threading.Thread):
self
.
start_time
=
time
.
time
()
self
.
__step
=
0
self
.
status
=
self
.
STATUS_STARTED
self
.
postprocess_status
=
self
.
STATUS_PENDING
self
.
end_time
=
None
# if some args are provided, let's fill the parameters
self
.
_set_parameters
(
self
.
args
)
...
...
@@ -835,6 +838,7 @@ class Workflow(threading.Thread):
self
.
reseted_components
=
[]
self
.
components
=
[]
self
.
status
=
self
.
STATUS_STARTED
self
.
postprocess_status
=
self
.
STATUS_PENDING
self
.
wf_execution_wrapper
()
except
SystemExit
:
self
.
status
=
self
.
STATUS_FAILED
...
...
@@ -855,6 +859,7 @@ class Workflow(threading.Thread):
self
.
reseted_components
=
[]
self
.
components
=
[]
self
.
status
=
self
.
STATUS_STARTED
self
.
postprocess_status
=
self
.
STATUS_PENDING
self
.
wf_execution_wrapper
()
except
SystemExit
:
self
.
status
=
self
.
STATUS_FAILED
...
...
@@ -868,11 +873,19 @@ class Workflow(threading.Thread):
self
.
_serialize
()
# if post processing has ne been done yet
if
self
.
__step
==
3
:
self
.
post_process
()
if
self
.
status
==
self
.
STATUS_STARTED
:
self
.
status
=
self
.
STATUS_COMPLETED
self
.
end_time
=
time
.
time
()
self
.
_serialize
()
self
.
_send_email
()
try
:
self
.
postprocess_status
=
self
.
STATUS_STARTED
self
.
post_process
()
self
.
postprocess_status
=
self
.
STATUS_COMPLETED
self
.
status
=
self
.
STATUS_COMPLETED
except
:
self
.
postprocess_status
=
self
.
STATUS_FAILED
raise
finally
:
self
.
end_time
=
time
.
time
()
self
.
_serialize
()
self
.
_send_email
()
except
Exception
as
e
:
self
.
_log
(
str
(
e
),
traceback
=
traceback
.
format_exc
(
chain
=
False
))
utils
.
display_error_message
(
str
(
e
))
...
...
@@ -894,6 +907,8 @@ class Workflow(threading.Thread):
self
.
status
=
self
.
STATUS_ABORTED
elif
self
.
STATUS_FAILED
in
make_states
:
self
.
status
=
self
.
STATUS_FAILED
elif
self
.
postprocess_status
==
self
.
STATUS_FAILED
:
self
.
status
=
self
.
STATUS_FAILED
elif
self
.
status
!=
self
.
STATUS_COMPLETED
:
self
.
status
=
self
.
STATUS_STARTED
except
:
pass
...
...
@@ -918,7 +933,7 @@ class Workflow(threading.Thread):
"tasks"
:
0
,
"waiting"
:
0
,
"running"
:
0
,
"failed"
:
0
,
"failed"
:
0
,
"aborted"
:
0
,
"completed"
:
0
,
"failed_commands"
:
list
()
}
...
...
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