From 9c8aa31f49eb033523ae8a47e8005c00c64c43d0 Mon Sep 17 00:00:00 2001 From: supreme0597 Date: Sun, 15 Mar 2026 20:48:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=86=99=E5=85=A5=E9=97=AE=E9=A2=98=EF=BC=88=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/sandbox_provisioner/app.py | 19 ++++++++++++++----- docs/.vitepress/config.mts | 3 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/docker/sandbox_provisioner/app.py b/docker/sandbox_provisioner/app.py index f8631068..568f484f 100644 --- a/docker/sandbox_provisioner/app.py +++ b/docker/sandbox_provisioner/app.py @@ -203,12 +203,16 @@ class LocalContainerProvisionerBackend: def _ensure_user_data_writable(container) -> None: cmd = ( "sh -lc " - "\"mkdir -p /mnt/user-data/workspace /mnt/user-data/uploads /mnt/user-data/outputs " - "&& chmod -R a+rwX /mnt/user-data\"" + '"mkdir -p /mnt/user-data/workspace /mnt/user-data/uploads /mnt/user-data/outputs ' + '&& chmod -R a+rwX /mnt/user-data"' ) result = container.exec_run(cmd, user="0:0") if result.exit_code != 0: - output = result.output.decode("utf-8", errors="ignore") if isinstance(result.output, bytes) else str(result.output) + output = ( + result.output.decode("utf-8", errors="ignore") + if isinstance(result.output, bytes) + else str(result.output) + ) raise RuntimeError(f"failed to ensure writable thread user-data mount: {output}") def _get_container(self, sandbox_id: str): @@ -238,7 +242,7 @@ class LocalContainerProvisionerBackend: # 检测是否是 Windows 绝对路径 (如 D:/ 或 D:\) threads_root_str = self._threads_host_path - is_windows_path = len(threads_root_str) >= 2 and threads_root_str[1] == ':' + is_windows_path = len(threads_root_str) >= 2 and threads_root_str[1] == ":" if is_windows_path: # Windows 路径,直接使用,不调用 resolve() @@ -255,7 +259,7 @@ class LocalContainerProvisionerBackend: thread_user_data.mkdir(parents=True, exist_ok=True) skills_path_str = self._skills_host_path - is_skills_windows = len(skills_path_str) >= 2 and skills_path_str[1] == ':' + is_skills_windows = len(skills_path_str) >= 2 and skills_path_str[1] == ":" if is_skills_windows: skills_path = Path(skills_path_str) else: @@ -276,6 +280,11 @@ class LocalContainerProvisionerBackend: str(thread_user_data): {"bind": "/mnt/user-data", "mode": "rw"}, str(skills_path): {"bind": "/mnt/skills", "mode": "ro"}, }, + "tmpfs": "/tmp:size=256m,mode=1777", + "environment": { + "HOME": "/mnt/user-data", + "TMPDIR": "/tmp", + }, "ports": {f"{self._container_port}/tcp": None}, "security_opt": ["seccomp=unconfined"], } diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 164b7ff6..78d60817 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -60,7 +60,8 @@ export default defineConfig({ { text: '文档解析', link: '/latest/advanced/document-processing' }, { text: '品牌自定义', link: '/latest/advanced/branding' }, { text: '其他配置', link: '/latest/advanced/misc' }, - { text: '生产部署', link: '/latest/advanced/deployment' } + { text: '生产部署', link: '/latest/advanced/deployment' }, + { text: 'Kubernetes 部署', link: '/latest/advanced/kubernetes-deployment' } ] }, {