- legacy_plantai_server_package/: phase_a–f + compile_* + bin/plantai_admin.py + tools/(audit/elf_visibility/smoke/build_delivery_manifest) 完整基线 - legacy_docker_packager/: protected 形态参考 - crypto/client/: plantai_core.py(AES-GCM 原语) + install_plantai.sh 参考 - secrets/provision 严格排除(gitignore),入 git 前已脱敏清理 - LEGACY_MAPPING.md 记录源与改造方向 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
225 lines
7.8 KiB
YAML
225 lines
7.8 KiB
YAML
name: plantai-protected
|
|
|
|
x-app-common: &app-common
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ./bbav5.env
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
security_opt:
|
|
- no-new-privileges:true
|
|
|
|
x-plantai-env: &plantai-env
|
|
PLANTAI_PROJECT_ROOT: /opt/plantai
|
|
BBAV5_PROJECT_ROOT: /opt/plantai
|
|
PLANTAI_RAG_ROOT: /opt/rag
|
|
GENE_FAMILY_ROOT: /opt/qa
|
|
PLANTAI_INPUT_ROOT: /opt/plantai/input
|
|
PLANTAI_WORKSPACE_ROOT: /opt/plantai/workspace
|
|
PLANTAI_DATA_ROOT: /runtime/data
|
|
PLANTAI_LOG_DIR: /opt/plantai/logs
|
|
PLANTAI_MEMORY_STORAGE_DIR: /runtime/service_data/memory_storage
|
|
PLANTAI_COST_LOG_DIR: /runtime/service_data/cost_logs
|
|
BBA_PFAM_DIR: /opt/plantai/data/hmm
|
|
BBAV5_TEST4_BIN: /usr/local/bin
|
|
BBAV5_DEFAULT_ENV: system
|
|
BBAV5_REDIS_URL: redis://redis:6379/0
|
|
REDIS_URL: redis://redis:6379/0
|
|
METHODOLOGY_RAG_API: http://rag:7900/api/v1
|
|
BBA_RAG_FAMILY_PFAM_URL: http://rag:7900/api/v1/rag/family/pfam
|
|
BBA_RAG_PFAM_URL: http://rag:7900/api/v1/rag/chat
|
|
DUAL_KB_QA_BASE_URL: http://qa:7925
|
|
DUAL_KB_QA_ROUTE: qa-v1-1-73
|
|
PYTHONUNBUFFERED: "1"
|
|
PYTHONDONTWRITEBYTECODE: "1"
|
|
|
|
x-plantai-volumes: &plantai-volumes
|
|
- ./input:/runtime/input
|
|
- ./input:/opt/plantai/input
|
|
- ./workspace:/runtime/workspace
|
|
- ./workspace:/opt/plantai/workspace
|
|
- ./data:/runtime/data
|
|
- ./logs:/runtime/logs
|
|
- ./logs:/opt/plantai/logs
|
|
- ./service_data/memory_storage:/runtime/service_data/memory_storage
|
|
- ./service_data/cost_logs:/runtime/service_data/cost_logs
|
|
- ./service_data/reproducibility:/runtime/service_data/reproducibility
|
|
|
|
services:
|
|
redis:
|
|
image: ${REDIS_IMAGE:-redis:7}
|
|
restart: unless-stopped
|
|
command: ["redis-server", "--appendonly", "yes"]
|
|
volumes:
|
|
- ./service_data/redis:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
qdrant:
|
|
image: ${QDRANT_IMAGE:-qdrant/qdrant:latest}
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./service_data/qdrant:/qdrant/storage
|
|
ports:
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${QDRANT_PORT:-16333}:6333"
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${QDRANT_GRPC_PORT:-16334}:6334"
|
|
|
|
neo4j:
|
|
image: ${NEO4J_IMAGE:-neo4j:5.15.0-community}
|
|
restart: unless-stopped
|
|
environment:
|
|
NEO4J_AUTH: neo4j/${NEO4J_PASSWORD:?set NEO4J_PASSWORD in bbav5.env}
|
|
volumes:
|
|
- ./service_data/neo4j:/data
|
|
ports:
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${NEO4J_HTTP_PORT:-17474}:7474"
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${NEO4J_BOLT_PORT:-17687}:7687"
|
|
|
|
rag:
|
|
<<: *app-common
|
|
image: ${RAG_IMAGE:?set RAG_IMAGE in bbav5.env}
|
|
working_dir: /opt/rag
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
qdrant:
|
|
condition: service_started
|
|
neo4j:
|
|
condition: service_started
|
|
environment:
|
|
PYTHONPATH: /opt/rag:/opt/rag/src
|
|
QDRANT_URL: http://qdrant:6333
|
|
NEO4J_URI: bolt://neo4j:7687
|
|
NEO4J_USER: neo4j
|
|
NEO4J_PASSWORD: ${NEO4J_PASSWORD}
|
|
ports:
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${RAG_PORT:-7900}:7900"
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7900/health', timeout=5).read()"]
|
|
interval: 15s
|
|
timeout: 8s
|
|
retries: 20
|
|
start_period: 30s
|
|
|
|
qa:
|
|
<<: *app-common
|
|
image: ${QA_IMAGE:?set QA_IMAGE in bbav5.env}
|
|
working_dir: /opt/qa
|
|
depends_on:
|
|
qdrant:
|
|
condition: service_started
|
|
neo4j:
|
|
condition: service_started
|
|
environment:
|
|
PYTHONPATH: /opt/qa
|
|
GENE_FAMILY_ROOT: /opt/qa
|
|
QDRANT_URL: http://qdrant:6333
|
|
V15_QDRANT_URL: http://qdrant:6333
|
|
V15_QDRANT_COLLECTION: ${V15_QDRANT_COLLECTION}
|
|
NEO4J_URI: bolt://neo4j:7687
|
|
NEO4J_USER: neo4j
|
|
NEO4J_PASSWORD: ${NEO4J_PASSWORD}
|
|
QA_V1_BGE_RERANKER_MODEL: /models/bge-reranker-base
|
|
QA_V1_ALIAS_CONFIG: /opt/qa/configs/rag/entity_alias.yaml
|
|
QA_V1_TAXONOMY_CONFIG: /opt/qa/configs/rag/relation_taxonomy.yaml
|
|
QA_V1_LLM_API_KEY: ${QA_V1_LLM_API_KEY:-ollama-local}
|
|
QA_V1_LLM_BASE_URL: ${QA_V1_LLM_BASE_URL:-http://host.docker.internal:11434/v1}
|
|
QA_V1_LLM_MODEL: ${QA_V1_LLM_MODEL}
|
|
V15_OLLAMA_EMBED_URL: ${V15_OLLAMA_EMBED_URL:-http://host.docker.internal:11434/api/embed}
|
|
V15_OLLAMA_EMBED_MODEL: ${V15_OLLAMA_EMBED_MODEL}
|
|
volumes:
|
|
- ./models:/models:ro
|
|
ports:
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${QA_PORT:-7925}:7925"
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7925/health', timeout=5).read()"]
|
|
interval: 15s
|
|
timeout: 8s
|
|
retries: 20
|
|
start_period: 30s
|
|
|
|
web:
|
|
<<: *app-common
|
|
image: ${PLANTAI_IMAGE:?set PLANTAI_IMAGE in bbav5.env}
|
|
working_dir: /opt/plantai
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
rag:
|
|
condition: service_healthy
|
|
qa:
|
|
condition: service_healthy
|
|
environment:
|
|
<<: *plantai-env
|
|
PLANTAI_ROLE: web
|
|
PLANTAI_WEB_PORT: "7880"
|
|
BBAV5_QUEUE_PREFIX: ${BBAV5_QUEUE_PREFIX:-plantai_protected}
|
|
volumes: *plantai-volumes
|
|
ports:
|
|
- "${BIND_ADDRESS:-127.0.0.1}:${PLANTAI_PORT:-7880}:7880"
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:7880/', timeout=5).read()"]
|
|
interval: 15s
|
|
timeout: 8s
|
|
retries: 20
|
|
start_period: 30s
|
|
|
|
worker-default:
|
|
<<: *app-common
|
|
image: ${PLANTAI_IMAGE:?set PLANTAI_IMAGE in bbav5.env}
|
|
working_dir: /opt/plantai
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
<<: *plantai-env
|
|
PLANTAI_ROLE: worker
|
|
BBAV5_QUEUE_PREFIX: ${BBAV5_QUEUE_PREFIX:-plantai_protected}
|
|
volumes: *plantai-volumes
|
|
command: ["sh", "-c", "python -m celery -A celery_app worker --loglevel=${BBAV5_CELERY_LOGLEVEL:-info} --hostname=plantai_protected_default@%h --queues=${BBAV5_QUEUE_PREFIX:-plantai_protected}.default --concurrency=${BBAV5_DEFAULT_CONCURRENCY:-1} --prefetch-multiplier=1"]
|
|
|
|
worker-heavy:
|
|
<<: *app-common
|
|
image: ${PLANTAI_IMAGE:?set PLANTAI_IMAGE in bbav5.env}
|
|
working_dir: /opt/plantai
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
<<: *plantai-env
|
|
PLANTAI_ROLE: worker
|
|
BBAV5_QUEUE_PREFIX: ${BBAV5_QUEUE_PREFIX:-plantai_protected}
|
|
volumes: *plantai-volumes
|
|
command: ["sh", "-c", "python -m celery -A celery_app worker --loglevel=${BBAV5_CELERY_LOGLEVEL:-info} --hostname=plantai_protected_heavy@%h --queues=${BBAV5_QUEUE_PREFIX:-plantai_protected}.heavy --concurrency=${BBAV5_HEAVY_CONCURRENCY:-1} --prefetch-multiplier=1"]
|
|
|
|
worker-medium:
|
|
<<: *app-common
|
|
image: ${PLANTAI_IMAGE:?set PLANTAI_IMAGE in bbav5.env}
|
|
working_dir: /opt/plantai
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
<<: *plantai-env
|
|
PLANTAI_ROLE: worker
|
|
BBAV5_QUEUE_PREFIX: ${BBAV5_QUEUE_PREFIX:-plantai_protected}
|
|
volumes: *plantai-volumes
|
|
command: ["sh", "-c", "python -m celery -A celery_app worker --loglevel=${BBAV5_CELERY_LOGLEVEL:-info} --hostname=plantai_protected_medium@%h --queues=${BBAV5_QUEUE_PREFIX:-plantai_protected}.medium --concurrency=${BBAV5_MEDIUM_CONCURRENCY:-2} --prefetch-multiplier=1"]
|
|
|
|
worker-light:
|
|
<<: *app-common
|
|
image: ${PLANTAI_IMAGE:?set PLANTAI_IMAGE in bbav5.env}
|
|
working_dir: /opt/plantai
|
|
depends_on:
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
<<: *plantai-env
|
|
PLANTAI_ROLE: worker
|
|
BBAV5_QUEUE_PREFIX: ${BBAV5_QUEUE_PREFIX:-plantai_protected}
|
|
volumes: *plantai-volumes
|
|
command: ["sh", "-c", "python -m celery -A celery_app worker --loglevel=${BBAV5_CELERY_LOGLEVEL:-info} --hostname=plantai_protected_light@%h --queues=${BBAV5_QUEUE_PREFIX:-plantai_protected}.light --concurrency=${BBAV5_LIGHT_CONCURRENCY:-2} --prefetch-multiplier=1"]
|