Functionality

The required functionality of the scripting library is as follows.

Starting, monitoring and ending a script

At the start

  • Claim the processing block.

  • Get the parameters defined in the processing block. They should be checked against the parameter schema defined for the script.

Resource requests

  • Make requests for input and output buffer space. The script will calculate the resources it needs based on the parameters, then request them from the processing controller. This is currently a placeholder.

Declare script phases

  • Scripts will be divided into phases such as preparation, processing, and clean-up. In the current implementation, only one phase can be declared, which we refer to as the ‘work’ phase.

Execute the work phase

  • On entry to the work phase, it waits until the resources are available. Meanwhile it monitors the processing block to see it has been cancelled. For real-time scripts, it also checks if the execution block has been cancelled.

  • Deploys execution engines to execute a script/function.

  • Monitors the execution engines and processing block state. Waits until the execution is finished, or the processing block is cancelled.

  • Continuously updates the processing block state with the status of execution engine deployments. It provides aggregate information about these statuses to inform other components about the readiness of deployments.

At the end

  • Remove the execution engines to release the resources.

  • Update processing block state with information about the success or failure of the script.

Receive scripts

  • Get IP and MAC addresses for the receive processes.

  • Monitor receive processes. If any get restarted, then the addresses may need to be updated.

  • Write the addresses in the appropriate format into the processing block state.

Compatibility with the telescope model library

We keep the scripting library compatible with the latest version of the telescope model library. If you use a configuration string that is based on an older version of the telescope model, you may experience errors or unexpected behaviour.

Data flow entries

The ProcessingBlock object provides methods to create specific data flow entries in the Configuration Database. These cover objects that provide configuration for data generation and usage for different processes.

Currently, the following types can be created with the scripting library:

  • data_product: data products, e.g. Measurement Sets

  • data_queue: Kafka queue configuration

  • qa_display: QA Display configuration

  • tango_attribute: configuration with a tango attribute as a sink