Skip to content
GitLab
Explore
Sign in
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
99f59462
"readme.md" did not exist on "26dc28e07b3e0812468755bfe82e61b2525baee6"
Commit
99f59462
authored
8 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
Task #8887: extra checks for cep2/cep4
parent
5a12800a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/ResourceAssignment/ResourceAssigner/lib/assignment.py
+13
-9
13 additions, 9 deletions
SAS/ResourceAssignment/ResourceAssigner/lib/assignment.py
with
13 additions
and
9 deletions
SAS/ResourceAssignment/ResourceAssigner/lib/assignment.py
+
13
−
9
View file @
99f59462
...
...
@@ -103,14 +103,20 @@ class ResourceAssigner():
otdb_id
=
specification_tree
[
'
otdb_id
'
]
taskType
=
specification_tree
.
get
(
'
task_type
'
,
''
).
lower
()
status
=
specification_tree
.
get
(
'
state
'
,
'
prescheduled
'
).
lower
()
status
=
specification_tree
.
get
(
'
state
'
,
''
).
lower
()
if
status
not
in
[
'
approved
'
,
'
prescheduled
'
]:
# cep2 accepts both, cep4 only prescheduled, see below
logger
.
info
(
'
skipping specification for otdb_id=%s because status=%s
'
,
(
otdb_id
,
status
))
#parse main parset...
mainParset
=
parameterset
(
specification_tree
[
'
specification
'
])
momId
=
mainParset
.
getInt
(
'
Observation.momID
'
,
-
1
)
startTime
=
datetime
.
strptime
(
mainParset
.
getString
(
'
Observation.startTime
'
),
'
%Y-%m-%d %H:%M:%S
'
)
endTime
=
datetime
.
strptime
(
mainParset
.
getString
(
'
Observation.stopTime
'
),
'
%Y-%m-%d %H:%M:%S
'
)
try
:
startTime
=
datetime
.
strptime
(
mainParset
.
getString
(
'
Observation.startTime
'
),
'
%Y-%m-%d %H:%M:%S
'
)
endTime
=
datetime
.
strptime
(
mainParset
.
getString
(
'
Observation.stopTime
'
),
'
%Y-%m-%d %H:%M:%S
'
)
except
ValueError
:
logger
.
warning
(
'
cannot parse for start/end time from specification for otdb_id=%s
'
,
(
otdb_id
,
))
# insert new task and specification in the radb
# any existing specification and task with same otdb_id will be deleted automatically
...
...
@@ -128,12 +134,10 @@ class ResourceAssigner():
# do not assign resources to task for other clusters than cep4
if
not
self
.
checkClusterIsCEP4
(
mainParset
):
try
:
#apply the most recent otdb status to this radb task
otdb_status
=
self
.
otdbrpc
.
taskGetStatus
(
otdb_id
)
self
.
radbrpc
.
updateTaskStatusForOtdbId
(
otdb_id
,
otdb_status
)
except
Exception
as
e
:
logger
.
error
(
e
)
return
if
status
!=
'
prescheduled
'
:
logger
.
info
(
'
skipping resource assignment for CEP4 task otdb_id=%s because status=%s
'
,
(
otdb_id
,
status
))
return
needed
=
self
.
getNeededResouces
(
specification_tree
)
...
...
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