- Frontend: rewrite Home.vue to match backend POST /jobs API (remove single-stage options) - Frontend: add Monitor page (/monitor) for queue and job monitoring - Frontend: add job history with localStorage tracking (per-browser) - Frontend: fix Nginx proxy rewrite (/api -> /) and add 500MB upload limit - Backend: add MinIO storage support (STORAGE_BACKEND=minio) alongside local mode - Backend: add GET /queues/stats API for queue monitoring - Backend: fix download handler for MinIO (buffer mode for Node 18 compat) - Workers: add S3/MinIO download/upload in consumer.py with isolated temp dirs - Workers: add s3_storage.py helper with lifecycle rule (7-day TTL) - Docker: add docker-compose.yml with all services (web, scheduler, redis, workers) - Docker: ports mapped to 9500 (web) and 9501 (scheduler) - Config: add .env to .gitignore to protect secrets Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
133 lines
3.8 KiB
YAML
133 lines
3.8 KiB
YAML
##
|
|
# Kneron Model Converter — Development docker-compose
|
|
#
|
|
# Usage:
|
|
# docker-compose up # local mode (shared volume)
|
|
# STORAGE_BACKEND=s3 docker-compose up # S3/MinIO mode
|
|
# docker-compose up --scale bie-worker=3 # scale BIE workers
|
|
##
|
|
|
|
volumes:
|
|
job-data:
|
|
|
|
services:
|
|
# ---------- Infrastructure ----------
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
expose:
|
|
- "6379"
|
|
command: redis-server --save ""
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 3
|
|
|
|
# ---------- Web UI ----------
|
|
|
|
web:
|
|
build: ./apps/web
|
|
ports:
|
|
- "9500:3000"
|
|
depends_on:
|
|
scheduler:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# ---------- Scheduler ----------
|
|
|
|
scheduler:
|
|
build: ./apps/task-scheduler
|
|
ports:
|
|
- "9501:4000"
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- job-data:/data/jobs
|
|
environment:
|
|
- PORT=4000
|
|
- REDIS_URL=redis://redis:6379
|
|
- JOB_DATA_DIR=/data/jobs
|
|
- FRONTEND_URL=http://localhost:9500
|
|
- STORAGE_BACKEND=${STORAGE_BACKEND:-local}
|
|
- MINIO_ENDPOINT_URL=${MINIO_ENDPOINT_URL:-http://192.168.0.130:9000}
|
|
- MINIO_BUCKET=${MINIO_BUCKET:-convertet-working-space}
|
|
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-convuser}
|
|
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
|
- MINIO_REGION=${MINIO_REGION:-us-east-1}
|
|
- MINIO_LIFECYCLE_DAYS=${MINIO_LIFECYCLE_DAYS:-7}
|
|
restart: unless-stopped
|
|
|
|
# ---------- Workers (stub mode) ----------
|
|
|
|
onnx-worker:
|
|
build:
|
|
context: .
|
|
dockerfile: services/workers/Dockerfile.stub
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- job-data:/data/jobs
|
|
environment:
|
|
- STAGE=onnx
|
|
- REDIS_URL=redis://redis:6379
|
|
- JOB_DATA_DIR=/data/jobs
|
|
- WORKER_MODE=${WORKER_MODE:-stub}
|
|
- STORAGE_BACKEND=${STORAGE_BACKEND:-local}
|
|
- MINIO_ENDPOINT_URL=${MINIO_ENDPOINT_URL:-http://192.168.0.130:9000}
|
|
- MINIO_BUCKET=${MINIO_BUCKET:-convertet-working-space}
|
|
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-convuser}
|
|
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
|
- MINIO_REGION=${MINIO_REGION:-us-east-1}
|
|
- MINIO_LIFECYCLE_DAYS=${MINIO_LIFECYCLE_DAYS:-7}
|
|
restart: unless-stopped
|
|
|
|
bie-worker:
|
|
build:
|
|
context: .
|
|
dockerfile: services/workers/Dockerfile.stub
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- job-data:/data/jobs
|
|
environment:
|
|
- STAGE=bie
|
|
- REDIS_URL=redis://redis:6379
|
|
- JOB_DATA_DIR=/data/jobs
|
|
- WORKER_MODE=${WORKER_MODE:-stub}
|
|
- STORAGE_BACKEND=${STORAGE_BACKEND:-local}
|
|
- MINIO_ENDPOINT_URL=${MINIO_ENDPOINT_URL:-http://192.168.0.130:9000}
|
|
- MINIO_BUCKET=${MINIO_BUCKET:-convertet-working-space}
|
|
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-convuser}
|
|
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
|
- MINIO_REGION=${MINIO_REGION:-us-east-1}
|
|
- MINIO_LIFECYCLE_DAYS=${MINIO_LIFECYCLE_DAYS:-7}
|
|
restart: unless-stopped
|
|
|
|
nef-worker:
|
|
build:
|
|
context: .
|
|
dockerfile: services/workers/Dockerfile.stub
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
volumes:
|
|
- job-data:/data/jobs
|
|
environment:
|
|
- STAGE=nef
|
|
- REDIS_URL=redis://redis:6379
|
|
- JOB_DATA_DIR=/data/jobs
|
|
- WORKER_MODE=${WORKER_MODE:-stub}
|
|
- STORAGE_BACKEND=${STORAGE_BACKEND:-local}
|
|
- MINIO_ENDPOINT_URL=${MINIO_ENDPOINT_URL:-http://192.168.0.130:9000}
|
|
- MINIO_BUCKET=${MINIO_BUCKET:-convertet-working-space}
|
|
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-convuser}
|
|
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY}
|
|
- MINIO_REGION=${MINIO_REGION:-us-east-1}
|
|
- MINIO_LIFECYCLE_DAYS=${MINIO_LIFECYCLE_DAYS:-7}
|
|
restart: unless-stopped
|