This is a small FastAPI application providing files for ingestion (through bento_web,
for bento_wes). By default, the file served are read on the existing filesystem, but
these can also be read from an S3-compatible backend.
Requires: Python 3.12+ and Poetry 2.2+
Set SERVICE_URL to the base URL of the service (e.g. https://bentov2.local/api/drop-box).
This is used for file URI generation.
If using the current filesystem to serve file, you can use the SERVICE_DATA
environment variable to point to some location (./data by default).
Poetry is used to manage dependencies.
- Install
poetry:pip install poetry
- Install project dependencies inside a Poetry-managed virtual environment:
poetry install
To run the service in development mode, use the following command:
poetry run python -m debugpy --listen "0.0.0.0:5678" -m uvicorn \
"bento_drop_box_service.app:application" \
--host 0.0.0.0 \
--port 5000 \
--reloadTo run tests and linting/formatting checks, run Tox:
poetry run toxTo format the code in the repository using the ruff formatter, run the following:
poetry run ruff formatThe bento_drop_box_service service can be deployed with an ASGI server like
Uvicorn, specifying bento_drop_box_service.app:application as the
ASGI application.
It is best to then put an HTTP server software such as NGINX in front of Hypercorn.