WrenAI icon indicating copy to clipboard operation
WrenAI copied to clipboard

Question: With Containers, how do I specify the Postgres Host (other than localhost)?

Open qdrddr opened this issue 1 year ago • 2 comments

Describe the bug When Deploying the docker-compose, I want to use my external Postgres DB. I do not see how can I do that with config files.

To Reproduce

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Ubuntu 22.04

WrenAI Information

  • WREN_PRODUCT_VERSION: 0.3.4

Additional context Currently, the app is trying to reach 127.0.0.1:5432

Background tracker started Error: connect ECONNREFUSED 127.0.0.1:5432 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '127.0.0.1', port: 5432 }

qdrddr avatar May 21 '24 17:05 qdrddr

Also, I want to know if the bootstrap init script is intended to be used with UI only, the engine, or both. I'm considering deploying this on my k8s, and for scalability reasons, you should consider making UI and the engine independent and not rely on the common files.

qdrddr avatar May 21 '24 17:05 qdrddr

Hi @qdrddr,

Thanks for reaching out.

Our current architecture aims to quickly bootstrap in a user's local environment. As such, you’ll notice that:

  • We use SQLite over PostgreSQL by default due to its portability.
  • We use a shared Docker volume. Using multiple volumes would complicate upgrades and maintenance.
  • In order to let users start the service easily, we use a bootstrap script to create some default configuration files required for the engine. This script initializes files specifically for the engine.

The good news is that we’re working on enhancing our architecture to the next level. We plan to make all our components (UI, Engine, AI Service) stateless and able to scale horizontally. I believe this will better suit a Kubernetes architecture.

Stay tuned for our future release. 😎 We'll also fix some issues you may have encountered when using PostgreSQL as the application database recently.

wwwy3y3 avatar May 22 '24 03:05 wwwy3y3

figured this out: PG_URL https://github.com/Canner/WrenAI/blob/main/deployment/kustomizations/examples/secret-wren_example.yaml#L22

qdrddr avatar Jun 14 '24 14:06 qdrddr