Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
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
RadioObservatory
LOFAR
Commits
a6c1e445
Commit
a6c1e445
authored
4 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
TMSS-190
: estimate pipeline spec duration based on predecessor
parent
b946a74c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!252
Resolve TMSS-190
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/src/tmss/tmssapp/models/scheduling.py
+7
-4
7 additions, 4 deletions
SAS/TMSS/src/tmss/tmssapp/models/scheduling.py
with
7 additions
and
4 deletions
SAS/TMSS/src/tmss/tmssapp/models/scheduling.py
+
7
−
4
View file @
a6c1e445
...
@@ -165,13 +165,16 @@ class Subtask(BasicCommon):
...
@@ -165,13 +165,16 @@ class Subtask(BasicCommon):
@property
@property
def
specified_duration
(
self
)
->
timedelta
:
def
specified_duration
(
self
)
->
timedelta
:
'''
get the specified (or estimated) duration of this subtask based on the specified task duration and the subtask type
'''
'''
get the specified (or estimated) duration of this subtask based on the specified task duration and the subtask type
'''
if
self
.
specifications_template
.
type
.
value
in
[
SubtaskType
.
Choices
.
OBSERVATION
,
SubtaskType
.
Choices
.
PIPELINE
]:
if
self
.
specifications_template
.
type
.
value
==
SubtaskType
.
Choices
.
OBSERVATION
:
# observations (and sometimes pipelines) have a specified duration,
# observations have a specified duration, so grab it from the spec.
# so grab it from the spec.
return
timedelta
(
seconds
=
self
.
task_blueprint
.
specifications_doc
.
get
(
'
duration
'
,
0
))
return
timedelta
(
seconds
=
self
.
task_blueprint
.
specifications_doc
.
get
(
'
duration
'
,
0
))
if
self
.
specifications_template
.
type
.
value
==
SubtaskType
.
Choices
.
PIPELINE
:
# pipelines usually do not have a specified duration, so make a guess (half the obs duration?).
return
timedelta
(
seconds
=
self
.
task_blueprint
.
specifications_doc
.
get
(
'
duration
'
,
max
(
p
.
specified_duration
for
p
in
self
.
predecessors
)
/
2
))
# other subtasktypes usually depend on cpu/data/network etc. So, make a guess (for now)
# other subtasktypes usually depend on cpu/data/network etc. So, make a guess (for now)
return
timedelta
(
seconds
=
600
)
return
timedelta
(
minutes
=
5
)
@staticmethod
@staticmethod
def
_send_state_change_event_message
(
subtask_id
:
int
,
old_state
:
str
,
new_state
:
str
):
def
_send_state_change_event_message
(
subtask_id
:
int
,
old_state
:
str
,
new_state
:
str
):
...
...
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