From fbde8b9338989a744837bd651d10776710b75cdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=89=BA=E4=B8=B9?= <53546877+Craven1701@users.noreply.github.com> Date: Thu, 5 Jun 2025 20:30:13 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9Load.create=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8exec=5Fattr=E5=92=8Cdefault=5Fconfig=E4=BD=9C=E4=B8=BA?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E7=BA=A6=E6=9D=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- omniadvisor/src/omniadvisor/repository/load_repository.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omniadvisor/src/omniadvisor/repository/load_repository.py b/omniadvisor/src/omniadvisor/repository/load_repository.py index d3fcd70c6..cd9d9689c 100644 --- a/omniadvisor/src/omniadvisor/repository/load_repository.py +++ b/omniadvisor/src/omniadvisor/repository/load_repository.py @@ -41,7 +41,7 @@ class LoadRepository(Repository): """ # 判断是否有相同name和default_config的Load存在 model_attr = { - Load.FieldName.name: name, + Load.FieldName.exec_attr: exec_attr, Load.FieldName.default_config: default_config } database_loads = cls._query(model_attr=model_attr) -- Gitee From 501c8abc431028a5d8c8d191e2eefb9e9181a680 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=89=BA=E4=B8=B9?= <53546877+Craven1701@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:08:18 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9hijack=E4=B8=ADspark=5Fru?= =?UTF-8?q?n=E7=9A=84=E7=BB=93=E6=9E=9C=E8=BE=93=E5=87=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../omniadvisor/interface/hijack_recommend.py | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/omniadvisor/src/omniadvisor/interface/hijack_recommend.py b/omniadvisor/src/omniadvisor/interface/hijack_recommend.py index 269abed4b..f2991db9a 100644 --- a/omniadvisor/src/omniadvisor/interface/hijack_recommend.py +++ b/omniadvisor/src/omniadvisor/interface/hijack_recommend.py @@ -108,17 +108,23 @@ def hijack_recommend(argv: list): # 根据配置和负载执行Spark任务 global_logger.info("Going to execute Spark load ……") exam_record, output = spark_run(load, exec_config) - # 执行结果分析 若执行失败则调度用户默认配置重新拉起任务 - if exam_record.status != OA_CONF.ExecStatus.success and exec_config != user_config: - global_logger.warning("Spark execute failed, ready to activate security protection mechanism.") - safe_exam_record, safe_output = spark_run(load, user_config) - global_logger.info("Spark execute success in security protection mechanism, going to print Spark output.") - # 打印安全机制下任务的输出 - print(safe_output) - else: + # 执行结果分析 + if exam_record.status == OA_CONF.ExecStatus.success: # 打印结果输出 global_logger.info("Spark execute success, going to print Spark output.") print(output) + # 若执行失败 则判断是否需要拉起安全机制 + else: + if exec_config != user_config: + global_logger.warning("Spark execute failed, ready to activate security protection mechanism.") + safe_exam_record, safe_output = spark_run(load, user_config) + global_logger.info("Spark execute in security protection mechanism, going to print Spark output.") + # 打印安全机制下任务的输出 + print(safe_output) + else: + global_logger("Spark execute failed in user config, going to print Spark output.") + print(output) + if exec_config == load.test_config: _process_load_config(load=load) -- Gitee From 06b9cb770f514eb241f969a651f1194613074b86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=89=BA=E4=B8=B9?= <53546877+Craven1701@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:14:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9hijack=E4=B8=ADspark=5Fru?= =?UTF-8?q?n=E7=9A=84=E7=BB=93=E6=9E=9C=E8=BE=93=E5=87=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- omniadvisor/src/omniadvisor/interface/hijack_recommend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/omniadvisor/src/omniadvisor/interface/hijack_recommend.py b/omniadvisor/src/omniadvisor/interface/hijack_recommend.py index f2991db9a..05bced3f9 100644 --- a/omniadvisor/src/omniadvisor/interface/hijack_recommend.py +++ b/omniadvisor/src/omniadvisor/interface/hijack_recommend.py @@ -122,7 +122,7 @@ def hijack_recommend(argv: list): # 打印安全机制下任务的输出 print(safe_output) else: - global_logger("Spark execute failed in user config, going to print Spark output.") + global_logger.warning("Spark execute failed in user config, going to print Spark output.") print(output) -- Gitee From cc48b0a7c1ad943c68878b9f0e5c85ae71173fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=89=BA=E4=B8=B9?= <53546877+Craven1701@users.noreply.github.com> Date: Fri, 6 Jun 2025 16:14:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9hijack=E4=B8=ADspark=5Fru?= =?UTF-8?q?n=E7=9A=84=E7=BB=93=E6=9E=9C=E8=BE=93=E5=87=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- omniadvisor/src/omniadvisor/interface/hijack_recommend.py | 1 - 1 file changed, 1 deletion(-) diff --git a/omniadvisor/src/omniadvisor/interface/hijack_recommend.py b/omniadvisor/src/omniadvisor/interface/hijack_recommend.py index 05bced3f9..7f260c0e1 100644 --- a/omniadvisor/src/omniadvisor/interface/hijack_recommend.py +++ b/omniadvisor/src/omniadvisor/interface/hijack_recommend.py @@ -125,7 +125,6 @@ def hijack_recommend(argv: list): global_logger.warning("Spark execute failed in user config, going to print Spark output.") print(output) - if exec_config == load.test_config: _process_load_config(load=load) -- Gitee