chore: rollback mount path
This commit is contained in:
@@ -86,7 +86,7 @@ class Settings(BaseSettings):
|
|||||||
|
|
||||||
# ── local FS roots ────────────────────────────────────────────
|
# ── local FS roots ────────────────────────────────────────────
|
||||||
workspace_root: str = Field(
|
workspace_root: str = Field(
|
||||||
default="/workspace/workspaces",
|
default="/app/workspaces",
|
||||||
description=(
|
description=(
|
||||||
"Schedule subprocess cwd; staging area for notebook_runner. "
|
"Schedule subprocess cwd; staging area for notebook_runner. "
|
||||||
"Backend no longer writes here — workspace files live in "
|
"Backend no longer writes here — workspace files live in "
|
||||||
|
|||||||
+2
-2
@@ -88,7 +88,7 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
|
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
|
||||||
SERVICE_NAME: runtime-manager
|
SERVICE_NAME: runtime-manager
|
||||||
WORKSPACES_ROOT: /workspace/workspaces
|
WORKSPACES_ROOT: /app/workspaces
|
||||||
PUBLIC_BASE_URL: http://runtime
|
PUBLIC_BASE_URL: http://runtime
|
||||||
REMOTE_BUCKET: rustfs:${RUSTFS_WORKSPACE_BUCKET:-workspaces}
|
REMOTE_BUCKET: rustfs:${RUSTFS_WORKSPACE_BUCKET:-workspaces}
|
||||||
RCLONE_CONFIG_RUSTFS_TYPE: s3
|
RCLONE_CONFIG_RUSTFS_TYPE: s3
|
||||||
@@ -105,7 +105,7 @@ services:
|
|||||||
healthcheck:
|
healthcheck:
|
||||||
test:
|
test:
|
||||||
- CMD-SHELL
|
- CMD-SHELL
|
||||||
- grep -q ' /workspace/workspaces .* - fuse.rclone ' /proc/self/mountinfo && curl -fsS http://127.0.0.1:8000/api/v1/health >/dev/null
|
- grep -q ' /app/workspaces .* - fuse.rclone ' /proc/self/mountinfo && curl -fsS http://127.0.0.1:8000/api/v1/health >/dev/null
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 18
|
retries: 18
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ def start_rclone_mount() -> None:
|
|||||||
"rclone",
|
"rclone",
|
||||||
"mount",
|
"mount",
|
||||||
REMOTE_BUCKET,
|
REMOTE_BUCKET,
|
||||||
str(WORKSPACES_ROOT),
|
WORKSPACES_ROOT.as_posix(),
|
||||||
"--allow-other",
|
"--allow-other",
|
||||||
"--vfs-cache-mode", "full",
|
"--vfs-cache-mode", "full",
|
||||||
"--vfs-cache-max-size", "20G",
|
"--vfs-cache-max-size", "20G",
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ from common.utils import get_free_port, start_process
|
|||||||
from runtime.mount import WORKSPACES_ROOT
|
from runtime.mount import WORKSPACES_ROOT
|
||||||
|
|
||||||
PUBLIC_BASE_URL = settings.public_base_url
|
PUBLIC_BASE_URL = settings.public_base_url
|
||||||
JUPYTER_PROCESS_CWD = Path("/app")
|
|
||||||
|
|
||||||
|
|
||||||
class JupyterProcessRecord(TypedDict):
|
class JupyterProcessRecord(TypedDict):
|
||||||
@@ -108,7 +107,7 @@ async def start_workspace(ws_id: str) -> dict:
|
|||||||
"--allow-root",
|
"--allow-root",
|
||||||
f"--ServerApp.token={token}",
|
f"--ServerApp.token={token}",
|
||||||
f"--ServerApp.base_url={base_path}",
|
f"--ServerApp.base_url={base_path}",
|
||||||
f"--ServerApp.root_dir={workspace_path}",
|
"--notebook-dir=.",
|
||||||
"--ServerApp.terminals_enabled=False",
|
"--ServerApp.terminals_enabled=False",
|
||||||
"--NotebookApp.terminals_enabled=False",
|
"--NotebookApp.terminals_enabled=False",
|
||||||
"--ServerApp.allow_origin=*",
|
"--ServerApp.allow_origin=*",
|
||||||
@@ -118,11 +117,7 @@ async def start_workspace(ws_id: str) -> dict:
|
|||||||
]
|
]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Keep the server process cwd off the rclone/FUSE mount. Remote
|
process, log_file = start_process(cmd, workspace_path)
|
||||||
# S3 directory refreshes can replace a virtual directory inode,
|
|
||||||
# leaving a long-lived cwd marked "(deleted)" and making
|
|
||||||
# os.getcwd() fail while Jupyter starts kernels or nbconvert.
|
|
||||||
process, log_file = start_process(cmd, JUPYTER_PROCESS_CWD)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"Failed to start Jupyter for {ws_id}: {e}")
|
logger.error(f"Failed to start Jupyter for {ws_id}: {e}")
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|||||||
Reference in New Issue
Block a user