perf: dual queue, GLB caching, WebP output, persistent BVH
Task 4: Dual render queue - render-worker: heavy (asset_pipeline, concurrency=1) — HQ 2048x2048, animations - render-worker-light: light (asset_pipeline_light, concurrency=2) — thumbnails, <=1024 - Thumbnails routed to light queue automatically - Order line renders routed by resolution at dispatch time Task 5: GLB caching (skip re-tessellation) - Before tessellating, check if gltf_geometry MediaAsset exists for the cad_file_id - If found, copy to expected path — render_blender.py finds it and skips tessellation - Saves 7-11s per re-render of the same product Task 6: WebP output format - New 'webp' option in output_format (OutputType admin) - Blender renders PNG intermediate, Pillow converts to WebP (quality=90, method=4) - 50-70% smaller files with no visible quality loss - Correct MIME type (image/webp) in MediaAsset Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -156,6 +156,47 @@ services:
|
||||
count: 1
|
||||
capabilities: [gpu, compute, utility, graphics]
|
||||
|
||||
render-worker-light:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: render-worker/Dockerfile
|
||||
args:
|
||||
- BLENDER_VERSION=${BLENDER_VERSION:-5.0.1}
|
||||
command: bash -c "python3 /check_version.py && celery -A app.tasks.celery_app worker --loglevel=info -Q asset_pipeline_light --autoscale=2,2 --concurrency=2"
|
||||
environment:
|
||||
- POSTGRES_DB=${POSTGRES_DB:-schaeffler}
|
||||
- POSTGRES_USER=${POSTGRES_USER:-schaeffler}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-schaeffler}
|
||||
- POSTGRES_HOST=postgres
|
||||
- POSTGRES_PORT=5432
|
||||
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
|
||||
- JWT_SECRET_KEY=${JWT_SECRET_KEY:-changeme-in-production}
|
||||
- UPLOAD_DIR=/app/uploads
|
||||
- BLENDER_BIN=/opt/blender/blender
|
||||
- RENDER_SCRIPTS_DIR=/render-scripts
|
||||
- CYCLES_DEVICE=${CYCLES_DEVICE:-auto}
|
||||
- MINIO_URL=${MINIO_URL:-http://minio:9000}
|
||||
- MINIO_USER=${MINIO_USER:-minioadmin}
|
||||
- MINIO_PASSWORD=${MINIO_PASSWORD:-minioadmin}
|
||||
- MINIO_BUCKET=${MINIO_BUCKET:-uploads}
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- uploads:/app/uploads
|
||||
- /opt/blender:/opt/blender:ro
|
||||
- optix-cache:/var/tmp/OptixCache_root
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities: [gpu, compute, utility, graphics]
|
||||
|
||||
beat:
|
||||
build:
|
||||
context: ./backend
|
||||
|
||||
Reference in New Issue
Block a user