From 573bcf1a6c5595546959e00fe684e3fd43bcb954 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Mon, 11 Aug 2025 16:09:27 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9Euse=5Fremote=5Fresour?= =?UTF-8?q?ce=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- unilabos/app/main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/unilabos/app/main.py b/unilabos/app/main.py index e8c6e343..e565f86d 100644 --- a/unilabos/app/main.py +++ b/unilabos/app/main.py @@ -95,6 +95,11 @@ def parse_args(): action="store_true", help="启动unilab时同时报送注册表信息", ) + parser.add_argument( + "--use_remote_resource", + action="store_true", + help="启动unilab时使用远程资源启动", + ) parser.add_argument( "--config", type=str, @@ -195,6 +200,16 @@ def main(): print_status(f"当前工作目录为 {working_dir}", "info") load_config_from_file(config_path, args_dict["labid"]) + if args_dict["use_remote_resource"]: + print_status("使用远程资源启动", "info") + from unilabos.app.web import http_client + res = http_client.resource_get("host_node", False) + if str(res.get("code", 0)) == "0" and len(res.get("data", [])) > 0: + print_status("远程资源已存在,使用云端物料!", "info") + args_dict["graph"] = None + else: + print_status("远程资源不存在,本地将进行首次上报!", "info") + # 设置BasicConfig参数 BasicConfig.working_dir = working_dir BasicConfig.is_host_mode = not args_dict.get("without_host", False)