From 14c41a22b66b1d5a4d5b69de96bd45e4f6884843 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Fri, 7 Aug 2026 18:50:48 +0800 Subject: [PATCH] fix: runtime timeout --- DEVELOP.md | 4 ++-- docker-compose.yml | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/DEVELOP.md b/DEVELOP.md index c06f437..4e47ae6 100644 --- a/DEVELOP.md +++ b/DEVELOP.md @@ -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). diff --git a/docker-compose.yml b/docker-compose.yml index 13e0332..2a75930 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: