Bunny Deployment
This page will guide you through getting Bunny deployed in a Virtual Machine (VM) or locally on your machine.
Prerequisites
- A VM with these apps installed
- Docker and Docker Compose
- wget
- A OMOP CDM database server up and running
Deployment Steps
Get the example Compose file
Download the sample Bunny Compose file* by running the command:
wget https://raw.githubusercontent.com/Health-Informatics-UoN/hutch/refs/heads/main/samples/Bunny/bunny-standalone.compose.yml
- This file runs a standalone Bunny instance. Other samples may be available.
Environment configuration
Modify the configuration of the newly downloaded bunny-standalone.compose.yml
file as described in Configuring Bunny
You will need to configure the database connection, and your Task API host connection
Running Bunny
At the directory containing the bunny-standalone.compose.yml
file, run the command to activate Bunny:
docker compose -f bunny-standalone.compose.yml up
You should then see a message in your console like this:
INFO - 12-Nov-24 12:36:24 - Setting up database connection...
INFO - 12-Nov-24 12:36:24 - Looking for job...
INFO - 12-Nov-24 12:36:29 - Job received. Resolving...
INFO - 12-Nov-24 12:36:29 - Processing query...
INFO - 12-Nov-24 12:36:30 - Solved availability query
INFO - 12-Nov-24 12:36:30 - Job resolved.
INFO - 12-Nov-24 12:36:35 - Looking for job...
INFO - 12-Nov-24 12:36:40 - Looking for job...
INFO - 12-Nov-24 12:36:45 - Looking for job...
Bunny establishes a connection to your OMOP-CDM database, then polls the Task API Host for a job. When it receives a job, it processes the query, queries the database, and sends the result back to Task API Host. You won’t see the results here, but if you see the messages, then it’s successfully contacting both the database and Task API Host.
Best Practices
When deploying Bunny, follow these best practices to ensure stability and consistency:
- Use Tagged Versions: We tag each container image with a version number upon release. Always deploy a specific tagged version rather than latest to avoid unintended updates.
- Check Available Versions: You can find a list of available version tags in the container registry.
- Environment Configuration: Ensure your deployment environment (for example database connections, API endpoints) is correctly configured via environment variables.
- Rolling Updates: If updating to a new version, consider using rolling deployments to minimise downtime.
- Monitor and Log: Use logging and monitoring tools to track service health and quickly diagnose issues.