BunnyConfiguration

Configuration

Bunny can be configured using environment variables. If you’re running Bunny as part of a composed stack of containers, these are set in the compose.yml.

services:
  bunny:
    image: ghcr.io/health-informatics-uon/hutch/bunny:edge
    environment:
      - DATASOURCE_DB_USERNAME=postgres
      - DATASOURCE_DB_PASSWORD=postgres
      - DATASOURCE_DB_DATABASE=postgres
      - DATASOURCE_DB_DRIVERNAME=postgresql
      - DATASOURCE_DB_SCHEMA=public
      - DATASOURCE_DB_PORT=5432
      - DATASOURCE_DB_HOST=db
      - TASK_API_BASE_URL=http://relay:8080/link_connector_api
      - TASK_API_USERNAME=username
      - TASK_API_PASSWORD=password
      - TASK_API_TYPE=a
      - COLLECTION_ID=collection_id
      - LOW_NUMBER_SUPPRESSION_THRESHOLD=10
      - ROUNDING_TARGET=10

Task API

NameTypeDescriptionDefault
TASK_API_BASE_URL*stringRQUEST API URL
TASK_API_USERNAME*stringAPI username
TASK_API_PASSWORD*stringAPI Password
COLLECTION_ID*stringAPI collection_id
TASK_API_TYPE"a,b,c"Specifies the task type to query for, needed if connecting to RQUEST
TASK_API_ENFORCE_HTTPSbooleanSpecifies whether to enforce a HTTPS TASK_API_BASE_URLtrue

To configure Bunny to communicate with a Task API, such as Relay or RQuest, the TASK_API variables must be set.

Host examples:

  • If Bunny and Relay are running in the same Docker Compose stack, the host should be the Relay service name in the stack, e.g. http://relay
  • If you have Relay running locally, and Bunny running locally, the host should be http://localhost
  • If you have any Task API running elsewhere, the host should be e.g. https://my-task-api.com with the correct hostname
  • The Base URL should include /link_connector_api at the end of the path
  • Requests from Bunny are authenticated by the TASK_API_USERNAME and TASK_API_PASSWORD, please put your Task API credentials here

Task Type

If you would like Bunny to connect directly with RQUEST, you need to add TASK_API_TYPE.

This can only be either a (Availability), b (Distribution and PHEWAS) or c (AnalyticsGwas, AnalyticsGwasQuantitiveTrait, AnalyticsBurdenTest).

Further guidance is available in the Connect to RQuest How To Guide.

Database

The database connection is configured by the variables prefixed with DATASOURCE_

NameTypeDescriptionDefault
DATASOURCE_DB_USERNAME*stringDatabase usernametrino-user
DATASOURCE_DB_PASSWORD*stringDatabase password
DATASOURCE_DB_DATABASE*stringDatabase name
DATASOURCE_DB_SCHEMA*stringDatabase schema
DATASOURCE_DB_PORT*stringDatabase port
DATASOURCE_DB_HOST*stringDatabase host
DATASOURCE_DB_DRIVERNAME"postgresql,mssql"Database dialectpostgresql
DATASOURCE_DB_CATALOGstringTrino catalog name
DATASOURCE_USE_TRINObooleanUse Trino to connectFalse

Disclosure Control

NameTypeDescriptionDefault
LOW_NUMBER_SUPPRESSION_THRESHOLDintegerSpecifies the minimum number of individuals required for a result to be returned; counts below this threshold are suppressed.10
ROUNDING_TARGETintegerSpecifies the value to which all returned counts are rounded10
  • Low number suppression defaults to ON with a value of 10 such that any result with a count below 10 will return 0.
  • Rounding defaults to ON with a value of 10 such that results are returned to the nearest 10.

Read more about disclosure controls.

Polling

NameTypeDescriptionDefault
POLLING_INTERVALintegerSpecifies how often (seconds) the Task API is polled for new jobs5
INITIAL_BACKOFFintegerSpecifies the starting wait time (seconds) before retrying after a network error5
MAX_BACKOFFintegerSets the maximum wait time (seconds) that exponential backoff can reach after repeated failures60

Logging

NameTypeDescriptionDefault
BUNNY_LOGGER_LEVEL"DEBUG,INFO,WARNING,ERROR,CRITICAL"Specifies the logging levelINFO