Strax data to json microservice
Created by: JelleAalbers
This adds a microservice microstrax
based on hug, which serves arbitrary strax data over HTTP as json. To run it, just type microstrax
in the command line, then go to e.g. http://localhost:8000/get_data?run_id=XXXX&target=raw_records
. Hopefully this will help @darrylmasson @jorana with the online monitoring.
Features:
-
--port
sets the HTTP port to listen to -
--context
sets which context in straxen.contexts.... we should use; - API supports start, end, and selection_str arguments to customize data selection;
- API supports
max_n
to limit the number of rows returned (defaults 1000); - Requests aren't allowed to load more than 1 GB of data;
- Requests won't convert to jsons larger than 10 MB;
- Requests aren't allowed to build new data. This requires the latest strax master (for 86552f).
This also moves some XENONnT-rundb authentication specifics from straxen.contexts into the RunDB class, so that we can run on the eventbuilders without claiming to be bootstrax.