Pipeline Communication Manager

class ska_pss_lmc.manager.communication_manager.PipelineCommunicationManager(logger=None)

Bases: ABC

Communicate with Cheetah

_pid = None
property get_pid: int

Return process id

Return type

int

abstract connect()

Establish connection

Return type

bool

Returns

successful of connection

abstract disconnect()

Close connection

abstract start(cmd)

Start Cheetah pipeline

Parameters

cmd (str) – command to be executed

abstract is_running()

Return if cheetah is currently running

Return type

bool

Returns

if cheetah process is running

abstract kill()

Kill Cheetah pipeline process

shutdown()

Gracefully shutdown cheetah, not yet supported in cheetah

abstract write_config(config)

Write cheetah configuration

Parameters

config (xml.etree.ElementTree) – cheetah xml config

reload_config()

Reload configuration while cheetah is running. Mentioned by chris as future potential addition to cheetahs signals Unclear if this actually can be mapped to the obs state machine Maybe we would just shut down cheetah, and reload with the new config

delete_config()

Delete the configuration file from the PSS node. To be invoked by ObsReset

abstract get_logs()

Get logs from Cheetah process

Return type

Iterator[str]

Returns

iterator over lines of log entry

_abc_impl = <_abc_data object>
class ska_pss_lmc.manager.communication_manager.SshAccess(host, user, password=None, private_key_path=None, logger=None)

Bases: PipelineCommunicationManager

Access Cheetah over ssh

NOTE: there are several exceptions that paramiko library might throw when trying to connect to the ssh server, executing commands, etc. They shall be handled at component manager level.

log_input = None
client = None
host = None
user = None
password = None
private_key_path = None
connect()

Establish connection

Return type

bool

disconnect()

Close connection

start(cmd)

Start Cheetah pipeline

fetch_pid()

Fetch pid stored on cheetah host

is_running()

Check if the pipeline is running on the server

return: a flag that states whether the pipeline is running

Return type

bool

kill()

Kill Cheetah pipeline process

get_logs()

Get logs from Cheetah process

Returns

iterator over lines of log entry

_close_logs()

Send Ctrl+c to the tail process

Close the log reading process

write_config(config)

Write cheetah configuration file.

Parameters

config (xml.etree.ElementTree) – cheetah xml config

delete_config()

Delete cheetah configuration file. TODO: to be implemented

_abc_impl = <_abc_data object>
class ska_pss_lmc.manager.communication_manager.SubprocessAccess(pid=None, logger=None)

Bases: PipelineCommunicationManager

Access Cheetah via a subprocess

process = None
connect()

Connect

_abc_impl = <_abc_data object>
disconnect()

Disconnect

start(cmd)

Start cheetah process

kill()

kill cheetah process

write_config(config)

write cheetah config

delete_config()

Delete cheetah configuration file. TODO: to be implemented