bricks-cloud / BricksLLM

🔒 Enterprise-grade API gateway that helps you monitor and impose cost or rate limits per API key. Get fine-grained access control and monitoring per user, application, or environment. Supports OpenAI, Azure OpenAI, Anthropic, vLLM, and open-source LLMs.
https://trybricks.ai/
MIT License
863 stars 60 forks source link

PostgreSQL not ready during Docker-up #52

Closed SalimovAlbert closed 5 months ago

SalimovAlbert commented 5 months ago

PostgreSQL container is not ready to accept connections when the BricksLLM container tries to connect to it.

BricksLLM-Docker (main) $ docker-compose up time="2024-04-05T14:01:36+05:00" level=warning msg="The \"OPENAI_API_KEY\" variable is not set. Defaulting to a blank string." [+] Running 22/22 ✔ bricksllm 4 layers [⣿⣿⣿⣿] 0B/0B Pulled 12.3s ✔ 3c854c8cbf46 Already exists 0.0s ✔ 2d02c7b1f0cc Pull complete 3.0s ✔ 4f4fb700ef54 Pull complete 3.0s ✔ 677203612e8c Pull complete 8.0s ✔ redis 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 14.0s ✔ 4abcf2066143 Already exists 0.0s ✔ 2c3a1d240687 Pull complete 3.5s ✔ 643f361aa308 Pull complete 4.8s ✔ a693cf0e318c Pull complete 6.0s ✔ ade57efb0b22 Pull complete 9.1s ✔ 2fa2e1566407 Pull complete 8.8s ✔ 4464e0709769 Pull complete 10.0s ✔ postgresql 8 layers [⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 17.7s ✔ 59bf1c3509f3 Pull complete 0.9s ✔ c50e01d57241 Pull complete 0.6s ✔ a0646b0f1ead Pull complete 0.7s ✔ 7433e5151e0c Pull complete 10.5s ✔ 8854018388d9 Pull complete 1.4s ✔ 8de463f7fd19 Pull complete 1.6s ✔ b39ee18abab9 Pull complete 2.2s ✔ 11d7473a0ff9 Pull complete 2.3s [+] Running 6/6 ✔ Network bricksllm-docker_default Created 0.1s ✔ Volume "bricksllm-docker_postgresql" Created 0.0s ✔ Volume "bricksllm-docker_redis" Created 0.0s ✔ Container bricksllm-docker-redis-1 Created 5.4s ✔ Container bricksllm-docker-postgresql-1 Created 5.6s ✔ Container bricksllm-docker-bricksllm-1 Created 0.3s Attaching to bricksllm-1, postgresql-1, redis-1 redis-1 | 1:C 05 Apr 2024 09:02:00.647 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis-1 | 1:C 05 Apr 2024 09:02:00.647 # Redis version=6.2.14, bits=64, commit=00000000, modified=0, pid=1, just started redis-1 | 1:C 05 Apr 2024 09:02:00.647 # Configuration loaded redis-1 | 1:M 05 Apr 2024 09:02:00.648 # Server initialized postgresql-1 | The files belonging to this database system will be owned by user "postgres". postgresql-1 | This user must also own the server process. postgresql-1 | postgresql-1 | The database cluster will be initialized with locale "en_US.utf8". postgresql-1 | The default database encoding has accordingly been set to "UTF8". postgresql-1 | The default text search configuration will be set to "english". postgresql-1 | postgresql-1 | Data page checksums are disabled. postgresql-1 | postgresql-1 | fixing permissions on existing directory /var/lib/postgresql/data ... ok postgresql-1 | creating subdirectories ... ok postgresql-1 | selecting dynamic shared memory implementation ... posix postgresql-1 | selecting default max_connections ... 100 postgresql-1 | selecting default shared_buffers ... 128MB postgresql-1 | selecting default time zone ... UTC postgresql-1 | creating configuration files ... ok postgresql-1 | running bootstrap script ... ok bricksllm-1 | [BRICKSLLM] FATAL | 2024-04-05T09:02:01Z | error creating custom providers table: dial tcp 172.x.x.x:5432: connect: connection refused

spikelu2016 commented 5 months ago

Thanks for helping fix the issue. Ignore the warning OPENAI_API_KEY is not set. It is used for a feature that is not officially documented yet