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
90de1dd0
Commit
90de1dd0
authored
8 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #9607: move CEP4 pipelines way in the future to now
parent
28ac303e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py
+6
-6
6 additions, 6 deletions
...esourceAssignment/ResourceAssigner/lib/schedulechecker.py
with
6 additions
and
6 deletions
SAS/ResourceAssignment/ResourceAssigner/lib/schedulechecker.py
+
6
−
6
View file @
90de1dd0
...
...
@@ -39,8 +39,8 @@ logger = logging.getLogger(__name__)
def
movePipelineAfterItsPredecessors
(
task
,
radbrpc
,
min_start_timestamp
=
None
):
try
:
#only reschedule pipelines which
have resourceclaims and
run on cep4
if
task
and
task
[
'
type
'
]
==
'
pipeline
'
and
task
.
get
(
'
cluster
'
)
==
'
CEP4
'
and
radbrpc
.
getResourceClaims
(
task_ids
=
task
[
'
id
'
])
:
#only reschedule pipelines which run on cep4
if
task
and
task
[
'
type
'
]
==
'
pipeline
'
and
task
.
get
(
'
cluster
'
)
==
'
CEP4
'
:
logger
.
info
(
"
checking pipeline starttime radb_id=%s otdb_id=%s
"
,
task
[
'
id
'
],
task
[
'
otdb_id
'
])
predecessor_tasks
=
radbrpc
.
getTasks
(
task_ids
=
task
[
'
predecessor_ids
'
])
...
...
@@ -50,9 +50,9 @@ def movePipelineAfterItsPredecessors(task, radbrpc, min_start_timestamp=None):
max_pred_endtime
=
max
(
predecessor_endtimes
)
if
task
[
'
starttime
'
]
<
max_pred_endtime
:
if
(
task
[
'
starttime
'
]
<
max_pred_endtime
)
or
(
min_start_timestamp
and
task
[
'
starttime
'
]
>
min_start_timestamp
)
:
shift
=
max_pred_endtime
-
task
[
'
starttime
'
]
logger
.
info
(
"
Moving
ahead
%s pipeline radb_id=%s otdb_id=%s by %s
"
,
task
[
'
status
'
],
task
[
'
id
'
],
task
[
'
otdb_id
'
],
shift
)
logger
.
info
(
"
Moving %s pipeline radb_id=%s otdb_id=%s by %s
"
,
task
[
'
status
'
],
task
[
'
id
'
],
task
[
'
otdb_id
'
],
shift
)
radbrpc
.
updateTaskAndResourceClaims
(
task
[
'
id
'
],
starttime
=
task
[
'
starttime
'
]
+
shift
,
endtime
=
task
[
'
endtime
'
]
+
shift
)
updated_task
=
radbrpc
.
getTask
(
task
[
'
id
'
])
if
updated_task
[
'
status
'
]
not
in
[
u
'
scheduled
'
,
u
'
queued
'
]:
...
...
@@ -123,8 +123,8 @@ class ScheduleChecker():
now
=
datetime
.
utcnow
()
min_start_timestamp
=
now
+
timedelta
(
seconds
=
PIPELINE_CHECK_INTERVAL
)
scheduled_pipelines
=
self
.
_radbrpc
.
getTasks
(
task_status
=
'
scheduled
'
,
task_type
=
'
pipeline
'
)
queued_pipelines
=
self
.
_radbrpc
.
getTasks
(
task_status
=
'
queued
'
,
task_type
=
'
pipeline
'
)
scheduled_pipelines
=
self
.
_radbrpc
.
getTasks
(
task_status
=
'
scheduled
'
,
task_type
=
'
pipeline
'
,
cluster
=
'
CEP4
'
)
queued_pipelines
=
self
.
_radbrpc
.
getTasks
(
task_status
=
'
queued
'
,
task_type
=
'
pipeline
'
,
cluster
=
'
CEP4
'
)
sq_pipelines
=
scheduled_pipelines
+
queued_pipelines
if
sq_pipelines
:
...
...
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