A very simple Flask based server to monitor data volume(s) and respond to requests for TRs
It uses the Watchdog library to montior data volumes for new HDF5 files, and keeps a record of TriggerRecords that have passed through the Data Filter.
The server reponds to the following uris
Gets basic information about the operation of the service
This should be sent from the filesystem monitor processes, and contain the following JSON-formatted message:
{
"host": "string",
"file": "string",
"run_number": 1,
"record_type": "TriggerRecord or TimeSlice",
"record_ids": [(1,0), (2,0)]
}This should be sent from the filesystem monitor process, and contain the host and file name in JSON to remove from the active list.
{
"host": "string",
"file": "string"
}This should be sent from the Data Filter when it is ready for a TR to be sent from the Dispatcher. The Filter Orchestrator will then determine the next TR to send and when the Dispatcher requests a read, will provide the location of the next TR.
This should be sent from the Dispatcher, the response will contain the file name, trigger number, and sequence number of the next Trigger Record that the Dispatcher should read and send to the Data Filter. The hostname should be part of the request body
This should be sent from the Filter Writer process to indicate that a TR has completed the filtering process and should be removed from the active list. It will contain JSON-formatted data including the run number, trigger number, and sequence number of the TR to remove from the active list.
The server is intended to be run under the Gunicorn web server.
gunicorn -b 0.0.0.0:6000 --workers=1 --worker-class=gthread --threads=2 \
--timeout 5000000000 filter-orchestrator.orchestrator-flask:app
Some debug information will be printed by the orchestrator-flask if the environment variable 'ORCHESTRATOR_FLASK_DEBUG' is set to a number greater than 0.