Skip to content

bento-platform/bento_drop_box_service

Repository files navigation

Bento Drop Box Service

Test Status Lint Status codecov

This is a small Quart 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 a minIO instance (or AWS S3 for that matter).

Requires: Python 3.10+ and Poetry 1.5+

Environment Variables

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).

Running in Development

Poetry is used to manage dependencies.

Getting set up

  1. Install poetry:
    pip install poetry
  2. Install project dependencies inside a Poetry-managed virtual environment:
    poetry install

Running the service locally

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 \
  --reload

Running tests

To run tests and linting/formatting checks, run Tox:

poetry run tox

Running the formatter

To format the code in the repository using the ruff formatter, run the following:

poetry run ruff format

Deploying

The 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.

About

Drop box and basic file management service for the Bento platform.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •