Some checks failed
build_docker / build_doctr (linux/amd64) (pull_request) Has been cancelled
build_docker / build_doctr (linux/arm64) (pull_request) Has been cancelled
build_docker / essential (pull_request) Has been cancelled
build_docker / build_cpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_cpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_cpu (pull_request) Has been cancelled
build_docker / manifest_gpu (pull_request) Has been cancelled
build_docker / build_easyocr (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr (linux/arm64) (pull_request) Has been cancelled
build_docker / build_doctr_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_easyocr_gpu (pull_request) Has been cancelled
build_docker / manifest_doctr_gpu (pull_request) Has been cancelled
build_docker / manifest_easyocr (pull_request) Has been cancelled
build_docker / manifest_doctr (pull_request) Has been cancelled
build_docker / build_easyocr_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / build_doctr_gpu (linux/amd64) (pull_request) Has been cancelled
141 lines
3.2 KiB
YAML
141 lines
3.2 KiB
YAML
# docker-compose.workers.yml - Multiple PaddleOCR workers for parallel Ray Tune
|
|
#
|
|
# Usage:
|
|
# GPU (4 workers sharing GPU):
|
|
# docker compose -f docker-compose.workers.yml up
|
|
#
|
|
# CPU (4 workers):
|
|
# docker compose -f docker-compose.workers.yml --profile cpu up
|
|
#
|
|
# Scale workers (e.g., 8 workers):
|
|
# NUM_WORKERS=8 docker compose -f docker-compose.workers.yml up
|
|
#
|
|
# Each worker runs on a separate port: 8001, 8002, 8003, 8004, ...
|
|
|
|
x-ocr-gpu-common: &ocr-gpu-common
|
|
image: seryus.ddns.net/unir/paddle-ocr-gpu:latest
|
|
volumes:
|
|
- ../dataset:/app/dataset:ro
|
|
- ../debugset:/app/debugset:rw
|
|
- paddlex-cache:/root/.paddlex
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
- CUDA_VISIBLE_DEVICES=0
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 120s
|
|
|
|
x-ocr-cpu-common: &ocr-cpu-common
|
|
image: seryus.ddns.net/unir/paddle-ocr-cpu:latest
|
|
volumes:
|
|
- ../dataset:/app/dataset:ro
|
|
- ../debugset:/app/debugset:rw
|
|
- paddlex-cache:/root/.paddlex
|
|
environment:
|
|
- PYTHONUNBUFFERED=1
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 120s
|
|
|
|
services:
|
|
# GPU Workers (gpu profile) - share single GPU
|
|
ocr-worker-1:
|
|
<<: *ocr-gpu-common
|
|
container_name: paddle-ocr-worker-1
|
|
ports:
|
|
- "8001:8000"
|
|
profiles:
|
|
- gpu
|
|
|
|
ocr-worker-2:
|
|
<<: *ocr-gpu-common
|
|
container_name: paddle-ocr-worker-2
|
|
ports:
|
|
- "8002:8000"
|
|
profiles:
|
|
- gpu
|
|
|
|
ocr-worker-3:
|
|
<<: *ocr-gpu-common
|
|
container_name: paddle-ocr-worker-3
|
|
ports:
|
|
- "8003:8000"
|
|
profiles:
|
|
- gpu
|
|
|
|
ocr-worker-4:
|
|
<<: *ocr-gpu-common
|
|
container_name: paddle-ocr-worker-4
|
|
ports:
|
|
- "8004:8000"
|
|
profiles:
|
|
- gpu
|
|
|
|
ocr-worker-5:
|
|
<<: *ocr-gpu-common
|
|
container_name: paddle-ocr-worker-5
|
|
ports:
|
|
- "8005:8000"
|
|
profiles:
|
|
- gpu
|
|
|
|
# CPU Workers (cpu profile) - for systems without GPU
|
|
ocr-cpu-worker-1:
|
|
<<: *ocr-cpu-common
|
|
container_name: paddle-ocr-cpu-worker-1
|
|
ports:
|
|
- "8001:8000"
|
|
profiles:
|
|
- cpu
|
|
|
|
ocr-cpu-worker-2:
|
|
<<: *ocr-cpu-common
|
|
container_name: paddle-ocr-cpu-worker-2
|
|
ports:
|
|
- "8002:8000"
|
|
profiles:
|
|
- cpu
|
|
|
|
ocr-cpu-worker-3:
|
|
<<: *ocr-cpu-common
|
|
container_name: paddle-ocr-cpu-worker-3
|
|
ports:
|
|
- "8003:8000"
|
|
profiles:
|
|
- cpu
|
|
|
|
ocr-cpu-worker-4:
|
|
<<: *ocr-cpu-common
|
|
container_name: paddle-ocr-cpu-worker-4
|
|
ports:
|
|
- "8004:8000"
|
|
profiles:
|
|
- cpu
|
|
|
|
ocr-cpu-worker-5:
|
|
<<: *ocr-cpu-common
|
|
container_name: paddle-ocr-cpu-worker-5
|
|
ports:
|
|
- "8005:8000"
|
|
profiles:
|
|
- cpu
|
|
|
|
volumes:
|
|
paddlex-cache:
|
|
name: paddlex-model-cache
|