Skip to content

eflumerf/filterorchestrator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Filter-orchestrator

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.

REST interface

The server reponds to the following uris

GET /

GET /stats

Gets basic information about the operation of the service

POST /new-file

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)]
}

POST /remove-file

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"
}

GET /request-tr

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.

GET /read-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

POST /tr-complete

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.

Running the server locally from the command line

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages