fix: runtime timeout

This commit is contained in:
tao.chen
2026-08-07 18:50:48 +08:00
parent 37d89c74d6
commit 14c41a22b6
2 changed files with 19 additions and 10 deletions
+2 -2
View File
@@ -141,8 +141,8 @@ grep -rnE 'os\.(environ\[?["\x27][A-Z_]+|getenv\(["\x27][A-Z_]+)' --include="*.p
about `app.state.object_stores[bucket_name]`.
- The runtime's view of the workspace bucket on disk is exposed by
`common.storage.workspaces_root()`:
- `s3` mode: `${settings.local_storage_base_dir}/workspaces`
(default `/data/workspaces`, the rclone FUSE mount target).
- `s3` mode: `${settings.local_storage_base_dir}/workspace`
(default `/data/workspace`, the rclone FUSE mount target).
- `local` mode: `${settings.local_storage_base_dir}/workspace`
(default `/data/workspace`, a subdir of the shared local-storage
volume).
+17 -8
View File
@@ -68,9 +68,9 @@ services:
S3_ENDPOINT: ${S3_ENDPOINT:-http://s3:9000}
S3_ACCESS_KEY: ${S3_ACCESS_KEY:-}
S3_SECRET_KEY: ${S3_SECRET_KEY:-}
S3_WORKSPACE_BUCKET: ${S3_WORKSPACE_BUCKET:-workspaces}
S3_VERSION_BUCKET: ${S3_VERSION_BUCKET:-versions}
S3_RUN_LOG_BUCKET: ${S3_RUN_LOG_BUCKET:-run-logs}
S3_WORKSPACE_BUCKET: ${S3_WORKSPACE_BUCKET:-workspace}
S3_VERSION_BUCKET: ${S3_VERSION_BUCKET:-version}
S3_RUN_LOG_BUCKET: ${S3_RUN_LOG_BUCKET:-run-log}
S3_TRASH_BUCKET: ${S3_TRASH_BUCKET:-trash}
S3_TRASH_RETENTION_DAYS: ${S3_TRASH_RETENTION_DAYS:-30}
READINESS_TARGETS: ${MYSQL_HOST:?MYSQL_HOST is required}:${MYSQL_PORT:-3306},${S3_HOST:-s3}:${S3_PORT:-9000},runtime:8000
@@ -111,7 +111,7 @@ services:
SERVICE_NAME: runtime-manager
STORAGE_BACKEND: ${STORAGE_BACKEND:-s3}
LOCAL_STORAGE_BASE_DIR: ${LOCAL_STORAGE_BASE_DIR:-/data}
# WORKSPACES_ROOT defaults to /data/workspaces (settings.workspaces_root);
# WORKSPACES_ROOT defaults to /data/workspace (settings.workspaces_root);
# in local mode runtime skips the rclone mount and reads directly from
# ${LOCAL_STORAGE_BASE_DIR}/workspace instead.
PUBLIC_BASE_URL: http://runtime
@@ -134,7 +134,16 @@ services:
- ./data:/data
- /app/.venv
healthcheck:
test: ["CMD-SHELL", "grep -q ' /data/workspaces .* - fuse.rclone ' /proc/self/mountinfo && curl -fsS http://127.0.0.1:8000/api/v1/health >/dev/null"]
# Two-mode: s3 needs rclone FUSE mount; local skips rclone and uses a
# bind mount instead. In s3 mode the grep succeeds (mount must be up or
# startup would have crashed). In local mode the grep fails (no fuse.rclone)
# so the || branch runs: just verify /data/workspace is a directory.
test:
- CMD-SHELL
- |
grep -q ' /data/workspace .* - fuse.rclone ' /proc/self/mountinfo \
&& curl -fsS http://127.0.0.1:8000/api/v1/health \
|| { [ -d /data/workspace ] && curl -fsS http://127.0.0.1:8000/api/v1/health; }
interval: 10s
timeout: 5s
retries: 18
@@ -158,9 +167,9 @@ services:
S3_ENDPOINT: ${S3_ENDPOINT:-http://s3:9000}
S3_ACCESS_KEY: ${S3_ACCESS_KEY:-}
S3_SECRET_KEY: ${S3_SECRET_KEY:-}
S3_WORKSPACE_BUCKET: ${S3_WORKSPACE_BUCKET:-workspaces}
S3_VERSION_BUCKET: ${S3_VERSION_BUCKET:-versions}
S3_RUN_LOG_BUCKET: ${S3_RUN_LOG_BUCKET:-run-logs}
S3_WORKSPACE_BUCKET: ${S3_WORKSPACE_BUCKET:-workspace}
S3_VERSION_BUCKET: ${S3_VERSION_BUCKET:-version}
S3_RUN_LOG_BUCKET: ${S3_RUN_LOG_BUCKET:-run-log}
READINESS_TARGETS: ${MYSQL_HOST:?MYSQL_HOST is required}:${MYSQL_PORT:-3306},${S3_HOST:-s3}:${S3_PORT:-9000},backend:8000
depends_on:
backend: