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
0df8d40f
Commit
0df8d40f
authored
1 year ago
by
Jan David Mol
Browse files
Options
Downloads
Patches
Plain Diff
L2SS-1444
: Check exit status of system commands
parent
7704aed2
No related branches found
No related tags found
1 merge request
!1131
L2SS-1444: Also send the observation parset to COBALT when starting an observation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
SAS/TMSS/backend/services/lobster/lib/message_handler.py
+10
-2
10 additions, 2 deletions
SAS/TMSS/backend/services/lobster/lib/message_handler.py
with
10 additions
and
2 deletions
SAS/TMSS/backend/services/lobster/lib/message_handler.py
+
10
−
2
View file @
0df8d40f
...
...
@@ -49,6 +49,14 @@ LOOK_AHEAD_WINDOW = timedelta(minutes=3)
POLL_INTERVAL
=
timedelta
(
seconds
=
15
)
def
_system
(
cmdline
:
str
):
"""
Wraps os.system to raise a RuntimeError on failure.
"""
exit_status
=
system
(
cmdline
)
if
exit_status
!=
0
:
raise
RuntimeError
(
f
"
Execution failed, got exit status
{
exit_status
}
when executing:
{
cmdline
}
"
)
class
L2TMSSObservationControlMessageHandler
(
TMSSEventMessageHandler
):
def
__init__
(
self
,
tmss_client_credentials_id
:
str
=
None
):
...
...
@@ -146,12 +154,12 @@ class L2TMSSObservationControlMessageHandler(TMSSEventMessageHandler):
parset
.
write
(
l2parset
)
# copy it to COBALT
system
(
f
"
scp
{
tmpdir
}
/
{
PARSET_FILENAME
}
{
COBALT_HEADNODE
}
:
{
COBALT_PARSET_DIR
}
/
{
PARSET_FILENAME
}
"
)
_
system
(
f
"
scp
{
tmpdir
}
/
{
PARSET_FILENAME
}
{
COBALT_HEADNODE
}
:
{
COBALT_PARSET_DIR
}
/
{
PARSET_FILENAME
}
"
)
# kickstart the observation on COBALT to start and stop at the
# times as provided in the parset.
# first 3 parameters are historical and ignored
system
(
f
"
ssh
{
COBALT_HEADNODE
}
{
COBALT_START_SCRIPT
}
1 2 3
{
COBALT_PARSET_DIR
}
/
{
PARSET_FILENAME
}
{
subtask_id
}
"
)
_
system
(
f
"
ssh
{
COBALT_HEADNODE
}
{
COBALT_START_SCRIPT
}
1 2 3
{
COBALT_PARSET_DIR
}
/
{
PARSET_FILENAME
}
{
subtask_id
}
"
)
def
enqueue_scheduled_observation_subtask
(
self
,
subtask
:
dict
):
...
...
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