-
Notifications
You must be signed in to change notification settings - Fork 13
Set up RabbitMQ as Celery broker #1041
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ac67395
c7b0380
9742263
249c058
1c337cd
53d13eb
d8aa02d
539fd35
133515d
edbd7d2
efec9f3
e8d10ab
bfc0c23
82fdfd8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,8 +16,9 @@ services: | |
| - ./config:/app/config | ||
| ports: | ||
| - "5001:5000" | ||
| extra_hosts: | ||
| extra_hosts: # hostname aliases to the IPs of persistant services running outside docker network | ||
| - "db:${DATABASE_IP}" | ||
| - "rabbitmq:${RABBITMQ_IP}" | ||
| - "redis:${REDIS_IP}" | ||
|
Comment on lines
+19
to
22
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify RABBITMQ_IP is set in production environment. The extra_hosts configuration correctly follows the existing pattern for external service resolution. Ensure that the 🏁 Script executed: #!/bin/bash
# Description: Verify RABBITMQ_IP is referenced in production environment files
# Search for RABBITMQ_IP definition in production environment files
rg -n "RABBITMQ_IP" .envs/.production/Length of output: 0 🏁 Script executed: #!/bin/bash
# Description: Investigate environment variable configuration structure
# 1. Check if .envs directory exists and its structure
echo "=== Directory structure of .envs/ ==="
fd . .envs/ -type f -name "*" 2>/dev/null | head -20
# 2. Search entire repo for RABBITMQ_IP (not just .envs/.production/)
echo -e "\n=== All occurrences of RABBITMQ_IP in repo ==="
rg -n "RABBITMQ_IP" . 2>/dev/null
# 3. Search for DATABASE_IP and REDIS_IP to understand the pattern
echo -e "\n=== How DATABASE_IP is referenced ==="
rg -n "DATABASE_IP" . 2>/dev/null | head -10
echo -e "\n=== How REDIS_IP is referenced ==="
rg -n "REDIS_IP" . 2>/dev/null | head -10Length of output: 473 🏁 Script executed: #!/bin/bash
# Description: Search for environment configuration and documentation
# 1. Look for .env files in repo root
echo "=== .env files in repo root ==="
fd -t f "^\.env" . -max-depth 1 2>/dev/null
# 2. Search for documentation about environment setup
echo -e "\n=== README or documentation files ==="
fd -t f "(README|INSTALL|SETUP|DEPLOY)" . -iname "*" 2>/dev/null | head -10
# 3. Check docker-compose.worker.yml for rabbitmq references
echo -e "\n=== Full extra_hosts section in docker-compose.worker.yml ==="
rg -A 5 "extra_hosts" ./docker-compose.worker.yml 2>/dev/null
# 4. Check for any comments in docker-compose.production.yml about these variables
echo -e "\n=== Comments in docker-compose.production.yml around extra_hosts ==="
rg -B 5 -A 5 "extra_hosts" ./docker-compose.production.yml 2>/dev/nullLength of output: 821 🏁 Script executed: #!/bin/bash
# Description: Check if Celery worker should connect to RabbitMQ
# 1. Search for celery/rabbitmq configuration in codebase
echo "=== Celery/RabbitMQ references ==="
rg -n -i "celery|rabbitmq|broker" . --type=py --type=yml 2>/dev/null | head -20
# 2. Check docker-compose.worker.yml full configuration
echo -e "\n=== Full docker-compose.worker.yml ==="
cat ./docker-compose.worker.yml 2>/dev/nullLength of output: 887 Add RABBITMQ_IP mapping to docker-compose.worker.yml extra_hosts The celeryworker service requires RABBITMQ_IP hostname mapping to connect to the external RabbitMQ broker, but this is missing from docker-compose.worker.yml. The celeryworker inherits from the django service which currently only includes DATABASE_IP and REDIS_IP. Add the rabbitmq hostname mapping to lines 16-17 to match the production configuration: extra_hosts:
- "db:${DATABASE_IP}"
- "rabbitmq:${RABBITMQ_IP}"
- "redis:${REDIS_IP}"Without this, the Celery worker will fail to resolve the rabbitmq hostname and cannot connect to the broker. 🤖 Prompt for AI Agents |
||
| command: /start | ||
| scale: 1 # Can't scale until the load balancer is within the compose config | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.