Triển khai toàn bộ service bằng một docker compose
chandra + kie (vLLM, weights mount từ CHANDRA_MODEL_DIR/KIE_MODEL_DIR) và api + worker (image build từ Dockerfile, network_mode host, đọc .env) thay cho hai tmux run-api.sh/run-worker.sh và docker run chandra riêng. Worker mount native-hdfs của gói portable, đợi hai model healthy mới nhận trang. GPU chọn bằng GPU_DEVICE (driver nvidia) thay cho CDI GPU_UUID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
41
.env.example
Normal file
41
.env.example
Normal file
@@ -0,0 +1,41 @@
|
||||
# docker compose đọc file này (đổi tên thành .env) cho cả biến của compose lẫn env của api/worker.
|
||||
|
||||
# --- Model (compose) ---
|
||||
GPU_DEVICE=0 # index hoặc UUID card, như `docker run --gpus device=0`
|
||||
CHANDRA_MODEL_DIR=/path/to/chandra-dla-v2 # thư mục weights trên host
|
||||
KIE_MODEL_DIR=/path/to/Qwen3.5-4B # snapshot HF đã bung (không để symlink trỏ ra ngoài)
|
||||
GPU_UTIL=0.55 # chandra; GPU_UTIL + KIE_GPU_UTIL < phần card còn trống
|
||||
KIE_GPU_UTIL=0.3
|
||||
PORT=9222
|
||||
KIE_PORT=9224
|
||||
# IMAGE_TAG=chandra-dla-api:v2-20260906-024126
|
||||
# KIE_IMAGE=vllm/vllm-openai:v0.23.0
|
||||
# APP_IMAGE=idp-parsing-service:0.2.0
|
||||
|
||||
# --- HDFS native (worker) ---
|
||||
HDFS_NATIVE_DIR=/root/idp-portable/native-hdfs # bin/hdfs, conf/krb5.conf, conf/*.keytab
|
||||
IDP_STORAGE=hdfs_cli
|
||||
IDP_HDFS_NATIVE_URI=hdfs://vptwd
|
||||
HDFS_PRINCIPAL=searchengine@DATALAKE.DCS.VN
|
||||
|
||||
# --- Service ---
|
||||
IDP_HOST=0.0.0.0
|
||||
IDP_PORT=8001
|
||||
IDP_API_KEY= # bắt buộc đặt khi API mở ra mạng
|
||||
IDP_CALLBACK_HOSTS=10.1.18.104
|
||||
NO_PROXY=127.0.0.1,localhost,10.1.18.54,10.1.18.104
|
||||
IDP_CALLBACK_BASIC_USER=callback_handler
|
||||
IDP_CALLBACK_BASIC_PASSWORD=change-me
|
||||
|
||||
IDP_DATA_DIR=/data/idp-runtime # SQLite + file làm việc; đĩa local, không NFS
|
||||
|
||||
IDP_OCR_URL=http://127.0.0.1:9222/v1/chat/completions
|
||||
IDP_OCR_MODEL=chandra
|
||||
IDP_KIE_URL=http://127.0.0.1:9224/v1/chat/completions
|
||||
IDP_KIE_MODEL=qwen3.5-4b
|
||||
IDP_OCR_WORKERS=64
|
||||
IDP_OCR_TIMEOUT=180
|
||||
IDP_LEASE_SECONDS=1800
|
||||
|
||||
IDP_VOFFICE_DECRYPT_MODE=auto
|
||||
IDP_VOFFICE_DES_KEY_HEX=a1e3c21919adeeab
|
||||
Reference in New Issue
Block a user