Kiro AI commited on
Commit ·
4661ac1
1
Parent(s): d92dd26
Fix: Use entrypoint.py to start Celery worker + Redis sidecar
Browse files- Root cause: Dockerfile was calling uvicorn directly, skipping entrypoint.py
- entrypoint.py starts 3 processes: redis-server, celery worker, uvicorn
- Without worker, bulk validation tasks queue but never process
- Adds redis-server to apt-get install for sidecar mode
- Fixes bulk validation failures at ~49% progress (timeout after 10min)
Issue: Supply chain_valid CSV failed at 2000/4041 emails
Health check showed: celery.available = false
- Dockerfile +27 -24
Dockerfile
CHANGED
|
@@ -1,24 +1,27 @@
|
|
| 1 |
-
FROM python:3.11-slim
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
-
|
| 12 |
-
# Install Python dependencies
|
| 13 |
-
# torch CPU FIRST (the PyPI default wheel is the CUDA build, ~2.5 GB) — the
|
| 14 |
-
# DistilBERT advisory layer runs on PyTorch (the ONNX export was unreliable).
|
| 15 |
-
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.11-slim
|
| 2 |
+
WORKDIR /app
|
| 3 |
+
|
| 4 |
+
# Install system dependencies + redis-server for sidecar
|
| 5 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 6 |
+
curl \
|
| 7 |
+
git \
|
| 8 |
+
build-essential \
|
| 9 |
+
redis-server \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
+
|
| 12 |
+
# Install Python dependencies
|
| 13 |
+
# torch CPU FIRST (the PyPI default wheel is the CUDA build, ~2.5 GB) — the
|
| 14 |
+
# DistilBERT advisory layer runs on PyTorch (the ONNX export was unreliable).
|
| 15 |
+
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
| 16 |
+
|
| 17 |
+
COPY requirements.txt .
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
+
|
| 20 |
+
# Copy app source AND entrypoint
|
| 21 |
+
COPY app/ ./app/
|
| 22 |
+
COPY entrypoint.py .
|
| 23 |
+
|
| 24 |
+
EXPOSE 7860
|
| 25 |
+
|
| 26 |
+
# Use the entrypoint that starts redis + celery worker + uvicorn
|
| 27 |
+
CMD ["python3", "entrypoint.py"]
|