shaliz-kong commited on
Commit ·
fda4b64
1
Parent(s): 760a186
refactored for reddis
Browse files- .dockerignore +29 -0
- Dockerfile +8 -4
- requirements.txt +2 -5
- supervisord.conf +3 -5
.dockerignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.git
|
| 2 |
+
.gitignore
|
| 3 |
+
__pycache__/
|
| 4 |
+
*.pyc
|
| 5 |
+
*.pyo
|
| 6 |
+
*.pyd
|
| 7 |
+
build/
|
| 8 |
+
dist/
|
| 9 |
+
env/
|
| 10 |
+
.venv/
|
| 11 |
+
venv/
|
| 12 |
+
*.db
|
| 13 |
+
*.duckdb
|
| 14 |
+
*.sqlite
|
| 15 |
+
*.log
|
| 16 |
+
*.csv
|
| 17 |
+
*.parquet
|
| 18 |
+
*.h5
|
| 19 |
+
*.bin
|
| 20 |
+
*.pt
|
| 21 |
+
*.pth
|
| 22 |
+
node_modules/
|
| 23 |
+
.cache/
|
| 24 |
+
local_data/
|
| 25 |
+
uploads/
|
| 26 |
+
tmp/
|
| 27 |
+
analytics-data
|
| 28 |
+
.vscode
|
| 29 |
+
data
|
Dockerfile
CHANGED
|
@@ -1,15 +1,19 @@
|
|
| 1 |
-
FROM python:3.
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y redis-server supervisor && rm -rf /var/lib/apt/lists/*
|
| 4 |
|
|
|
|
| 5 |
COPY requirements.txt /tmp/
|
|
|
|
| 6 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 7 |
|
|
|
|
| 8 |
COPY . /app
|
| 9 |
WORKDIR /app
|
| 10 |
|
|
|
|
| 11 |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 12 |
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install Redis + Supervisor
|
| 4 |
RUN apt-get update && apt-get install -y redis-server supervisor && rm -rf /var/lib/apt/lists/*
|
| 5 |
|
| 6 |
+
# Install PyTorch CPU (version that exists for Python 3.10)
|
| 7 |
COPY requirements.txt /tmp/
|
| 8 |
+
RUN pip install --no-cache-dir torch==2.2.2 --index-url https://download.pytorch.org/whl/cpu
|
| 9 |
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 10 |
|
| 11 |
+
# Copy app
|
| 12 |
COPY . /app
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
+
# Copy supervisord config
|
| 16 |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 17 |
|
| 18 |
+
# Start
|
| 19 |
+
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
|
|
|
requirements.txt
CHANGED
|
@@ -8,13 +8,11 @@ pandas>=2.2
|
|
| 8 |
pyarrow>=15.0
|
| 9 |
numpy>=1.24,<2.0
|
| 10 |
scipy>=1.10
|
| 11 |
-
scikit-learn
|
| 12 |
-
statsmodels>=0.14
|
| 13 |
networkx>=3.0
|
| 14 |
-
|
| 15 |
|
| 16 |
# Local LLM (Free GPU)
|
| 17 |
-
torch>=2.2.0
|
| 18 |
transformers==4.40.0
|
| 19 |
accelerate==0.28.0
|
| 20 |
sentence-transformers==2.7.0
|
|
@@ -28,7 +26,6 @@ upstash-redis>=0.15.0
|
|
| 28 |
|
| 29 |
# HTTP Clients
|
| 30 |
requests>=2.31
|
| 31 |
-
aiohttp>=3.9.0
|
| 32 |
httpx>=0.27.0
|
| 33 |
|
| 34 |
# Utilities
|
|
|
|
| 8 |
pyarrow>=15.0
|
| 9 |
numpy>=1.24,<2.0
|
| 10 |
scipy>=1.10
|
| 11 |
+
scikit-learn==1.2.2
|
|
|
|
| 12 |
networkx>=3.0
|
| 13 |
+
|
| 14 |
|
| 15 |
# Local LLM (Free GPU)
|
|
|
|
| 16 |
transformers==4.40.0
|
| 17 |
accelerate==0.28.0
|
| 18 |
sentence-transformers==2.7.0
|
|
|
|
| 26 |
|
| 27 |
# HTTP Clients
|
| 28 |
requests>=2.31
|
|
|
|
| 29 |
httpx>=0.27.0
|
| 30 |
|
| 31 |
# Utilities
|
supervisord.conf
CHANGED
|
@@ -1,22 +1,20 @@
|
|
| 1 |
[supervisord]
|
| 2 |
nodaemon=true
|
|
|
|
| 3 |
|
| 4 |
[program:redis]
|
| 5 |
-
command=redis-server --bind
|
| 6 |
autostart=true
|
| 7 |
autorestart=true
|
| 8 |
-
priority=10
|
| 9 |
|
| 10 |
[program:app]
|
| 11 |
command=python -m uvicorn app.main:app --host 0.0.0.0 --port 7860
|
| 12 |
directory=/app
|
| 13 |
autostart=true
|
| 14 |
autorestart=true
|
| 15 |
-
priority=20
|
| 16 |
|
| 17 |
[program:scheduler]
|
| 18 |
command=python /app/scheduler_loop.py
|
| 19 |
directory=/app
|
| 20 |
autostart=true
|
| 21 |
-
autorestart=true
|
| 22 |
-
priority=30
|
|
|
|
| 1 |
[supervisord]
|
| 2 |
nodaemon=true
|
| 3 |
+
loglevel=info
|
| 4 |
|
| 5 |
[program:redis]
|
| 6 |
+
command=redis-server --bind 127.0.0.1 --port 6379 --maxmemory 128mb
|
| 7 |
autostart=true
|
| 8 |
autorestart=true
|
|
|
|
| 9 |
|
| 10 |
[program:app]
|
| 11 |
command=python -m uvicorn app.main:app --host 0.0.0.0 --port 7860
|
| 12 |
directory=/app
|
| 13 |
autostart=true
|
| 14 |
autorestart=true
|
|
|
|
| 15 |
|
| 16 |
[program:scheduler]
|
| 17 |
command=python /app/scheduler_loop.py
|
| 18 |
directory=/app
|
| 19 |
autostart=true
|
| 20 |
+
autorestart=true
|
|
|