From b688416c187ee659138980912bbabfe49cd4fc5d Mon Sep 17 00:00:00 2001 From: zhoupengcheng Date: Sat, 28 Oct 2023 16:23:28 +0800 Subject: [PATCH] bugfix for tuning --restore --- ...e-of-the-parameter-with-the-suffix-0.patch | 37 +++++++++++++++++++ atune.spec | 7 +++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 The-primary-node-changes-the-parameter-to-be-optimized-to-the-value-of-the-parameter-with-the-suffix-0.patch diff --git a/The-primary-node-changes-the-parameter-to-be-optimized-to-the-value-of-the-parameter-with-the-suffix-0.patch b/The-primary-node-changes-the-parameter-to-be-optimized-to-the-value-of-the-parameter-with-the-suffix-0.patch new file mode 100644 index 0000000..97cb97b --- /dev/null +++ b/The-primary-node-changes-the-parameter-to-be-optimized-to-the-value-of-the-parameter-with-the-suffix-0.patch @@ -0,0 +1,37 @@ +From e03c6c0b6fd470e0f927c9c218aee350508e086c Mon Sep 17 00:00:00 2001 +From: tanghan +Date: Wed, 17 Aug 2022 08:48:04 +0000 +Subject: [PATCH] The primary node changes the parameter to be optimized to the value of the parameter with the suffix - 0. +--- + common/project/projet.go | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +diff --git a/common/project/projet.go b/common/project/projet.go +index e10b3b2..22396dd 100644 +--- a/common/project/projet.go ++++ b/common/project/projet.go +@@ -353,12 +353,16 @@ func (y *YamlPrjSvr) RunSet(optStr string) (error, string) { + } + + newScript = strings.Replace(newScript, "$name", objName, -1) +- log.Info("set script:", newScript) +- _, err = ExecCommand(newScript) +- if err != nil { +- return fmt.Errorf("failed to exec %s, err: %v", newScript, err), "" ++ obj_len := len(obj.Name) ++ if obj.Name[obj_len-1:obj_len] == "0" { ++ log.Infof("set script for %s: %s", obj.Name, newScript) ++ _, err = ExecCommand(newScript) ++ if err != nil { ++ return fmt.Errorf("failed to exec %s, err: %v", newScript, err), "" ++ } ++ } else { ++ scripts = append(scripts, newScript) + } +- scripts = append(scripts, newScript) + } + log.Infof("after change paraMap: %+v\n", paraMap) + return nil, strings.Join(scripts, ",") +-- +2.33.0 + diff --git a/atune.spec b/atune.spec index 54d7302..931b256 100755 --- a/atune.spec +++ b/atune.spec @@ -3,7 +3,7 @@ Summary: AI auto tuning system Name: atune Version: 1.0.0 -Release: 14 +Release: 15 License: MulanPSL-2.0 URL: https://gitee.com/openeuler/A-Tune Source: https://gitee.com/openeuler/A-Tune/repository/archive/v%{version}.tar.gz @@ -19,6 +19,7 @@ Patch9007: 0002-bugfix-training-model-can-only-save-file-to-specifie.patch Patch9008: 0003-bugfix-collection-res-can-only-save-file-to-specifie.patch Patch9009: 0004-atune-add-service-restart-mode.patch Patch9010: 0005-atune-update-Makefile-and-logs.patch +Patch9011: The-primary-node-changes-the-parameter-to-be-optimized-to-the-value-of-the-parameter-with-the-suffix-0.patch BuildRequires: rpm-build golang-bin procps-ng @@ -92,6 +93,7 @@ atune engine tool for manage atuned AI tuning system. %patch9008 -p1 %patch9009 -p1 %patch9010 -p1 +%patch9011 -p1 %build %make_build @@ -181,6 +183,9 @@ atune engine tool for manage atuned AI tuning system. %exclude /etc/atuned/rest_certs %changelog +* Sat Oct 28 2023 zhoupengcheng - 1.0.0-15 +- bugfix for tuning --restore (https://gitee.com/openeuler/A-Tune/issues/I6AY86) + * Tue Oct 17 2023 sunchendong - 1.0.0-14 - atune update Makefile and logs