From 0dea29e3afa4971a035ab818f11debfc00d47ae3 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 11 Jun 2026 17:46:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=20sage=20=E5=BC=95?= =?UTF-8?q?=E7=94=A8=EF=BC=8C=E6=94=B9=E4=B8=BA=E9=80=9A=E7=94=A8=20APP=5F?= =?UTF-8?q?ROOT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- scripts/load_path.py | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 55762a5..1d25a64 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ## 架构 ``` -宿主应用 (pipeline-app / sage / 其他) +宿主应用 (pipeline-app / 其他) │ ├── load_pipeline_service() ← 注册函数到 ServerEnv │ diff --git a/scripts/load_path.py b/scripts/load_path.py index 47c3b97..ea7ff0e 100644 --- a/scripts/load_path.py +++ b/scripts/load_path.py @@ -12,23 +12,22 @@ import subprocess SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) -# Find Sage root -SAGE_ROOT = None +# Find app root (pipeline-app or any ahserver app) +APP_ROOT = None for candidate in [ os.path.join(SCRIPT_DIR, "..", ".."), - os.path.expanduser("~/repos/sage"), - os.path.expanduser("~/sage"), + os.path.expanduser("~/test/pipeline-app"), ]: if os.path.isdir(os.path.join(candidate, "wwwroot")) and os.path.isdir(os.path.join(candidate, "py3")): - SAGE_ROOT = os.path.abspath(candidate) + APP_ROOT = os.path.abspath(candidate) break -if not SAGE_ROOT: - print("ERROR: Cannot find Sage root directory") +if not APP_ROOT: + print("ERROR: Cannot find app root directory") sys.exit(1) -SET_ROLE_PERM = os.path.join(SAGE_ROOT, "set_role_perm.py") -PYTHON = os.path.join(SAGE_ROOT, "py3", "bin", "python") +SET_ROLE_PERM = os.path.join(APP_ROOT, "set_role_perm.py") +PYTHON = os.path.join(APP_ROOT, "py3", "bin", "python") # pipeline_service is a backend-only module, no wwwroot paths needed. # The host app's load_path.py handles the dspy paths that call pipeline_submit etc. @@ -40,17 +39,17 @@ PATHS_ANY = [] def register_paths(): for path in PATHS_ANY: - subprocess.run([PYTHON, SET_ROLE_PERM, "any", path], cwd=SAGE_ROOT) + subprocess.run([PYTHON, SET_ROLE_PERM, "any", path], cwd=APP_ROOT) print(f" any: {path}") for path in PATHS_LOGINED: - subprocess.run([PYTHON, SET_ROLE_PERM, "logined", path], cwd=SAGE_ROOT) + subprocess.run([PYTHON, SET_ROLE_PERM, "logined", path], cwd=APP_ROOT) print(f" logined: {path}") if __name__ == "__main__": print(f"=== pipeline_service RBAC registration ===") - print(f"Sage root: {SAGE_ROOT}") + print(f"App root: {APP_ROOT}") if not PATHS_LOGINED and not PATHS_ANY: print("No paths to register (backend-only module)") else: