feat(mcp): queue long-running calculations
This commit is contained in:
@@ -21,6 +21,26 @@ services:
|
||||
- timescaledb
|
||||
- postgis
|
||||
|
||||
# Enable after provisioning calculation storage and explicit project scopes.
|
||||
calculation-worker:
|
||||
profiles: [calculations]
|
||||
image: ${TJWATER_SERVER_IMAGE:-tjwater-server:local}
|
||||
init: true
|
||||
restart: on-failure
|
||||
command: ["python", "scripts/run_calculation_worker.py"]
|
||||
env_file:
|
||||
- ../../.env
|
||||
environment:
|
||||
- PYTHONPATH=/app
|
||||
volumes:
|
||||
- ../../app:/app/app
|
||||
- ../../resources:/app/resources
|
||||
- calculation-state:/app/temp/calculation-jobs
|
||||
stop_grace_period: 30s
|
||||
depends_on:
|
||||
- timescaledb
|
||||
- postgis
|
||||
|
||||
# ==========================================
|
||||
# Infrastructure Services
|
||||
# ==========================================
|
||||
@@ -127,6 +147,9 @@ services:
|
||||
volumes:
|
||||
- ./mapservice/geoserver_data:/opt/geoserver_data
|
||||
|
||||
volumes:
|
||||
calculation-state:
|
||||
|
||||
networks:
|
||||
default:
|
||||
driver: bridge
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=TJWater queued calculation worker
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
WorkingDirectory=%h/NextTJWater/next-tjwater-server
|
||||
ExecStart=%h/miniconda3/envs/server/bin/python scripts/run_calculation_worker.py
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
KillMode=control-group
|
||||
TimeoutStopSec=30
|
||||
UMask=0077
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
Reference in New Issue
Block a user