Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
13d114768f
!162 [sync] PR-160: fix atune-adm analyse failed problem
From: @openeuler-sync-bot 
Reviewed-by: @pshysimon 
Signed-off-by: @pshysimon
2025-04-29 02:47:31 +00:00
PshySimon
cdebc92897 fix atune-adm analyse failed problem
(cherry picked from commit 8402ae3b7f611fd9e32226a866c7c3c0702e5287)
2025-04-28 15:44:21 +08:00
openeuler-ci-bot
c9f06f282a
!157 修复scikit-learn-1.4导致的接口不兼容,atune-tuning 功能失败问题
From: @tong_1001 
Reviewed-by: @hubin95 
Signed-off-by: @hubin95
2025-03-21 02:19:42 +00:00
dongjiao
059db02f6b fix bug cause scikit-learn-1.2 rename the parameter 'base_estimator' to 'estimator'. 2025-03-21 09:10:55 +08:00
openeuler-ci-bot
b6009cae85
!146 fix-skopt.Optimizer-incompatible-with-numpy-1.24
From: @dongjiao-joan 
Reviewed-by: @znzjugod, @yangyongguang 
Signed-off-by: @znzjugod, @yangyongguang
2024-09-18 01:30:58 +00:00
dongjiao_joan
b107f475af fix-skopt.Optimizer-incompatible-with-numpy-1.24 2024-07-29 12:59:20 +08:00
openeuler-ci-bot
5bb6c68992
!142 [sync] PR-141: import os for app.py and fix build failure
From: @openeuler-sync-bot 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
2024-03-19 03:26:36 +00:00
zhoupengcheng
f2b9ff331c import os for app.py and fix build failure
(cherry picked from commit c875bbcf8a04c7f8b025611d6543162322353822)
2024-03-19 10:46:25 +08:00
openeuler-ci-bot
dbdcb0a2ab
!140 update v1.2.0
From: @zhoupengcheng11 
Reviewed-by: @gaoruoshu 
Signed-off-by: @gaoruoshu
2024-02-26 08:15:02 +00:00
root
3a27221f4a update v1.2.0 2024-02-26 15:24:49 +08:00
21 changed files with 875 additions and 1116 deletions

View File

@ -1,47 +0,0 @@
From 34007d0d2fba94e43fbaf294d18cb2fc68857116 Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Wed, 9 Aug 2023 15:07:04 +0800
Subject: [PATCH 1/3] bugfix: transfer can only save file to specified dir
---
analysis/engine/transfer.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/analysis/engine/transfer.py b/analysis/engine/transfer.py
index 7fa5777..154f3df 100644
--- a/analysis/engine/transfer.py
+++ b/analysis/engine/transfer.py
@@ -31,7 +31,7 @@ LOGGER = logging.getLogger(__name__)
class Transfer(Resource):
"""restful api for transfer"""
- file_path = "/etc/atuned/"
+ file_path = "/etc/atuned/{service}"
def post(self):
"""provide the method of post"""
@@ -40,15 +40,19 @@ class Transfer(Resource):
file_obj = request.files.get("file")
service = request.form.get("service")
+ target_path = self.file_path.format(service=service)
+ dir_name, _ = os.path.split(os.path.abspath(save_path))
+ if not dir_name == target_path:
+ return "illegal path to save file", 400
+
if service == "classification":
os.makedirs(ANALYSIS_DATA_PATH, exist_ok=True)
- file_name = ANALYSIS_DATA_PATH + save_path.split(self.file_path + service)[1][1:]
+ file_name = ANALYSIS_DATA_PATH + save_path.split(target_path)[1][1:]
current_app.logger.info(file_name)
file_obj.save(file_name)
return file_name, 200
file_obj.save(save_path)
- target_path = self.file_path + service
res = utils.extract_file(save_path, target_path)
os.remove(save_path)
return res, 200
--
2.27.0

View File

@ -1,58 +0,0 @@
From 09c719964b362fa358c705a7b7e24bb02a1259bb Mon Sep 17 00:00:00 2001
From: zhoupengcheng <zhoupengcheng11@huawei.com>
Date: Wed, 8 Nov 2023 12:32:43 +0800
Subject: [PATCH] 0001-define-fix-privilege-escalation.patch
---
modules/client/profile/profile_define.go | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/modules/client/profile/profile_define.go b/modules/client/profile/profile_define.go
index 87b3781..24e31d3 100644
--- a/modules/client/profile/profile_define.go
+++ b/modules/client/profile/profile_define.go
@@ -19,6 +19,7 @@ import (
SVC "gitee.com/openeuler/A-Tune/common/service"
"gitee.com/openeuler/A-Tune/common/utils"
"fmt"
+ "regexp"
"io/ioutil"
"github.com/go-ini/ini"
@@ -88,11 +89,22 @@ func profileDefined(ctx *cli.Context) error {
if err := profileDefineCheck(ctx); err != nil {
return err
}
+
+
+ detectRule := `[./].*`
+ detectPathchar := regexp.MustCompile(detectRule)
+
serviceType := ctx.Args().Get(0)
+ if detectPathchar.MatchString(serviceType) {
+ return fmt.Errorf("serviceType:%s cannot contain special path characters '/' or '.' ", serviceType)
+ }
if !utils.IsInputStringValid(serviceType) {
return fmt.Errorf("input:%s is invalid", serviceType)
}
applicationName := ctx.Args().Get(1)
+ if detectPathchar.MatchString(applicationName) {
+ return fmt.Errorf("applicationName:%s cannot contain special path characters '/' or '.' ", applicationName)
+ }
if !utils.IsInputStringValid(applicationName) {
return fmt.Errorf("input:%s is invalid", applicationName)
}
@@ -100,7 +112,9 @@ func profileDefined(ctx *cli.Context) error {
if !utils.IsInputStringValid(scenarioName) {
return fmt.Errorf("input:%s is invalid", scenarioName)
}
-
+ if detectPathchar.MatchString(scenarioName) {
+ return fmt.Errorf("scenarioName:%s cannot contain special path characters '/' or '.' ", scenarioName)
+ }
data, err := ioutil.ReadFile(ctx.Args().Get(3))
if err != nil {
return err
--
2.33.0

View File

@ -0,0 +1,25 @@
From e755095a5d32688e28edf708aa6fc77e0b978896 Mon Sep 17 00:00:00 2001
From: dongjiao_joan <dongjiao@kylinos.cn>
Date: Wed, 24 Jul 2024 16:04:49 +0800
Subject: [PATCH] fix skopt.Optimizer incompatible with numpy 1.24
---
analysis/optimizer/optimizer.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/analysis/optimizer/optimizer.py b/analysis/optimizer/optimizer.py
index 4afa8e4..4c5f6b7 100755
--- a/analysis/optimizer/optimizer.py
+++ b/analysis/optimizer/optimizer.py
@@ -36,6 +36,8 @@ from analysis.optimizer.variance_reduction_feature_selector import VarianceReduc
LOGGER = logging.getLogger(__name__)
+# skopt.Optimizer incompatible with numpy >=1.24 ,avoid error : use int replace np.int
+np.int = int
class Optimizer(multiprocessing.Process):
"""find optimal settings and generate optimized profile"""
--
2.43.0

View File

@ -1,290 +0,0 @@
From 65d2dc509e851d138154ee6a8a3ff3acb3780a30 Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Wed, 9 Aug 2023 19:15:07 +0800
Subject: [PATCH 2/3] bugfix: training model can only save file to specified
dir
---
analysis/default_config.py | 1 +
analysis/engine/parser.py | 4 +--
analysis/engine/train.py | 38 ++++++++++++++++++----
api/profile/profile.pb.go | 6 ++--
api/profile/profile.proto | 2 +-
common/models/training.go | 2 +-
modules/client/profile/profile_train.go | 42 +++++++++----------------
modules/server/profile/profile.go | 4 +--
8 files changed, 56 insertions(+), 43 deletions(-)
diff --git a/analysis/default_config.py b/analysis/default_config.py
index cf56ac2..7c921cc 100644
--- a/analysis/default_config.py
+++ b/analysis/default_config.py
@@ -23,6 +23,7 @@ GRPC_CERT_PATH = '/etc/atuned/grpc_certs'
ANALYSIS_DATA_PATH = '/var/atune_data/analysis/'
TUNING_DATA_PATH = '/var/atune_data/tuning/'
TUNING_DATA_DIRS = ['running', 'finished', 'error']
+TRAINING_MODEL_PATH = '/usr/libexec/atuned/analysis/models/'
def get_or_default(config, section, key, value):
diff --git a/analysis/engine/parser.py b/analysis/engine/parser.py
index c16089f..c36c74d 100644
--- a/analysis/engine/parser.py
+++ b/analysis/engine/parser.py
@@ -69,8 +69,8 @@ CLASSIFICATION_POST_PARSER.add_argument('model',
TRAIN_POST_PARSER = reqparse.RequestParser()
TRAIN_POST_PARSER.add_argument('datapath', required=True,
help="The datapath can not be null")
-TRAIN_POST_PARSER.add_argument('outputpath', required=True,
- help="The output path can not be null")
+TRAIN_POST_PARSER.add_argument('modelname', required=True,
+ help="The model name can not be null")
TRAIN_POST_PARSER.add_argument('modelpath', required=True,
help="The model path can not be null")
diff --git a/analysis/engine/train.py b/analysis/engine/train.py
index 9fdca46..7608660 100644
--- a/analysis/engine/train.py
+++ b/analysis/engine/train.py
@@ -22,6 +22,7 @@ from flask_restful import Resource
from analysis.optimizer.workload_characterization import WorkloadCharacterization
from analysis.engine.parser import TRAIN_POST_PARSER
+from analysis.default_config import TRAINING_MODEL_PATH
LOGGER = logging.getLogger(__name__)
@@ -29,7 +30,7 @@ LOGGER = logging.getLogger(__name__)
class Training(Resource):
"""provide the method of post for training"""
model_path = "modelpath"
- output_path = "outputpath"
+ model_name = "modelname"
data_path = "datapath"
def post(self):
@@ -40,18 +41,43 @@ class Training(Resource):
LOGGER.info(args)
model_path = args.get(self.model_path)
- output_path = args.get(self.output_path)
+ model_name = args.get(self.model_name)
data_path = args.get(self.data_path)
+ valid, err = valid_model_name(model_name)
+ if not valid:
+ return "Illegal model name provide: {}".format(err), 400
+
characterization = WorkloadCharacterization(model_path)
try:
+ output_path = TRAINING_MODEL_PATH + model_name
characterization.retrain(data_path, output_path)
except Exception as err:
LOGGER.error(err)
abort(500)
- if os.path.isdir(data_path):
- shutil.rmtree(data_path)
- else:
- os.remove(data_path)
return {}, 200
+
+
+def valid_model_name(name):
+ file_name, file_ext = os.path.splitext(name)
+
+ if file_ext != ".m":
+ return False, "the ext of model name should be .m"
+
+ if file_name in ['scaler', 'aencoder', 'tencoder', 'default_clf', 'total_clf', 'throughput_performance_clf']:
+ return False, "model name cannot be set as default_clf/scaler/aencoder/tencoder/throughput_performance_clf/total_clf"
+
+ for ind, char in enumerate(file_name):
+ if 'a' <= char <= 'z':
+ continue
+ if 'A' <= char <= 'Z':
+ continue
+ if '0' <= char <= '9':
+ continue
+ if ind != 0 and ind != len(file_name) - 1 and char == '_':
+ continue
+ return False, "model name cannot contains special character"
+
+ return True, None
+
diff --git a/api/profile/profile.pb.go b/api/profile/profile.pb.go
index dba166d..81a6757 100644
--- a/api/profile/profile.pb.go
+++ b/api/profile/profile.pb.go
@@ -493,7 +493,7 @@ func (m *CollectFlag) GetType() string {
type TrainMessage struct {
DataPath string `protobuf:"bytes,1,opt,name=DataPath,proto3" json:"DataPath,omitempty"`
- OutputPath string `protobuf:"bytes,2,opt,name=OutputPath,proto3" json:"OutputPath,omitempty"`
+ ModelName string `protobuf:"bytes,2,opt,name=ModelName,proto3" json:"ModelName,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
@@ -531,9 +531,9 @@ func (m *TrainMessage) GetDataPath() string {
return ""
}
-func (m *TrainMessage) GetOutputPath() string {
+func (m *TrainMessage) GetModelName() string {
if m != nil {
- return m.OutputPath
+ return m.ModelName
}
return ""
}
diff --git a/api/profile/profile.proto b/api/profile/profile.proto
index 2a6e751..29cf91e 100755
--- a/api/profile/profile.proto
+++ b/api/profile/profile.proto
@@ -84,7 +84,7 @@ message CollectFlag {
message TrainMessage {
string DataPath = 1;
- string OutputPath = 2;
+ string ModelName = 2;
}
message DetectMessage {
diff --git a/common/models/training.go b/common/models/training.go
index 3cc9d60..9497261 100644
--- a/common/models/training.go
+++ b/common/models/training.go
@@ -24,7 +24,7 @@ import (
type Training struct {
DataPath string `json:"datapath"`
ModelPath string `json:"modelpath"`
- OutputPath string `json:"outputpath"`
+ ModelName string `json:"modelname"`
}
// Post method call training service
diff --git a/modules/client/profile/profile_train.go b/modules/client/profile/profile_train.go
index f4e68cb..a645bc3 100644
--- a/modules/client/profile/profile_train.go
+++ b/modules/client/profile/profile_train.go
@@ -18,9 +18,9 @@ import (
"gitee.com/openeuler/A-Tune/common/client"
SVC "gitee.com/openeuler/A-Tune/common/service"
"gitee.com/openeuler/A-Tune/common/utils"
+ "gitee.com/openeuler/A-Tune/common/config"
"fmt"
"io"
- "os"
"path/filepath"
"github.com/urfave/cli"
@@ -39,8 +39,8 @@ var trainCommand = cli.Command{
Value: "",
},
cli.StringFlag{
- Name: "output_file,o",
- Usage: "the model to be generated",
+ Name: "model_name,m",
+ Usage: "the model name of generate model",
Value: "",
},
},
@@ -48,9 +48,9 @@ var trainCommand = cli.Command{
desc := `
training a new model with the self collected data, data_path option specified
the path that storage the collected data, the collected data must have more
- than two workload type. output_file specified the file path where to store
+ than two workload type. model_name specified the name of model to be generated
the trained model, which must be end with .m.
- example: atune-adm train --data_path=./data --output_file=./model/trained.m`
+ example: atune-adm train --data_path=/home/data --model_name=trained.m`
return desc
}(),
Action: train,
@@ -82,13 +82,13 @@ func checkTrainCtx(ctx *cli.Context) error {
return fmt.Errorf("input:%s is invalid", dataPath)
}
- outputPath := ctx.String("output_file")
- if outputPath == "" {
+ modelName := ctx.String("model_name")
+ if modelName == "" {
_ = cli.ShowCommandHelp(ctx, "train")
- return fmt.Errorf("error: output_file must be specified")
+ return fmt.Errorf("error: model_name must be specified")
}
- if !utils.IsInputStringValid(outputPath) {
- return fmt.Errorf("input:%s is invalid", outputPath)
+ if !utils.IsInputStringValid(modelName) {
+ return fmt.Errorf("input:%s is invalid", modelName)
}
return nil
@@ -103,23 +103,8 @@ func train(ctx *cli.Context) error {
if err != nil {
return err
}
- outputPath, err := filepath.Abs(ctx.String("output_file"))
- if err != nil {
- return err
- }
-
- dir := filepath.Dir(outputPath)
- exist, err := utils.PathExist(dir)
- if err != nil {
- return err
- }
- if !exist {
- err = os.MkdirAll(dir, utils.FilePerm)
- if err != nil {
- return err
- }
- }
+ modelName := ctx.String("model_name")
c, err := client.NewClientFromContext(ctx)
if err != nil {
@@ -128,7 +113,7 @@ func train(ctx *cli.Context) error {
defer c.Close()
svc := PB.NewProfileMgrClient(c.Connection())
- stream, err := svc.Training(CTX.Background(), &PB.TrainMessage{DataPath: dataPath, OutputPath: outputPath})
+ stream, err := svc.Training(CTX.Background(), &PB.TrainMessage{DataPath: dataPath, ModelName: modelName})
if err != nil {
return err
}
@@ -145,6 +130,7 @@ func train(ctx *cli.Context) error {
}
utils.Print(reply)
}
- fmt.Println("the model generate path:", outputPath)
+ modelPath := fmt.Sprintf("%s/models/%s", config.DefaultAnalysisPath, modelName)
+ fmt.Println("the model generate path:", modelPath)
return nil
}
diff --git a/modules/server/profile/profile.go b/modules/server/profile/profile.go
index 3264167..70047ca 100644
--- a/modules/server/profile/profile.go
+++ b/modules/server/profile/profile.go
@@ -1137,7 +1137,7 @@ func (s *ProfileServer) Training(message *PB.TrainMessage, stream PB.ProfileMgr_
}
DataPath := message.GetDataPath()
- OutputPath := message.GetOutputPath()
+ ModelName := message.GetModelName()
compressPath, err := utils.CreateCompressFile(DataPath)
if err != nil {
@@ -1156,7 +1156,7 @@ func (s *ProfileServer) Training(message *PB.TrainMessage, stream PB.ProfileMgr_
trainBody := new(models.Training)
trainBody.DataPath = trainPath
- trainBody.OutputPath = OutputPath
+ trainBody.ModelName = ModelName
trainBody.ModelPath = path.Join(config.DefaultAnalysisPath, "models")
success, err := trainBody.Post()
--
2.27.0

View File

@ -1,50 +0,0 @@
From 8c411e610d702daf9e7505c1500163c481f7ed69 Mon Sep 17 00:00:00 2001
From: zhoupengcheng <zhoupengcheng11@huawei.com>
Date: Wed, 1 Nov 2023 17:45:05 +0800
Subject: [PATCH] 0002-define-fix-privilege-escalation.patch
---
modules/server/profile/profile.go | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
diff --git a/modules/server/profile/profile.go b/modules/server/profile/profile.go
index 5cdaa9a..cbf48b9 100644
--- a/modules/server/profile/profile.go
+++ b/modules/server/profile/profile.go
@@ -1277,8 +1277,32 @@ func (s *ProfileServer) Define(ctx context.Context, message *PB.DefineMessage) (
applicationName := message.GetApplicationName()
scenarioName := message.GetScenarioName()
content := string(message.GetContent())
- profileName := serviceType + "-" + applicationName + "-" + scenarioName
+ detectRule := `[./].*`
+ detectPathchar := regexp.MustCompile(detectRule)
+
+ if detectPathchar.MatchString(serviceType) {
+ return &PB.Ack{}, fmt.Errorf("serviceType:%s cannot contain special path characters '/' or '.' ", serviceType)
+ }
+ if !utils.IsInputStringValid(serviceType) {
+ return &PB.Ack{}, fmt.Errorf("input:%s is invalid", serviceType)
+ }
+
+ if detectPathchar.MatchString(applicationName) {
+ return &PB.Ack{}, fmt.Errorf("applicationName:%s cannot contain special path characters '/' or '.' ", applicationName)
+ }
+ if !utils.IsInputStringValid(applicationName) {
+ return &PB.Ack{}, fmt.Errorf("input:%s is invalid", applicationName)
+ }
+
+ if detectPathchar.MatchString(scenarioName) {
+ return &PB.Ack{}, fmt.Errorf("scenarioName:%s cannot contain special path characters '/' or '.' ", scenarioName)
+ }
+ if !utils.IsInputStringValid(scenarioName) {
+ return &PB.Ack{}, fmt.Errorf("input:%s is invalid", scenarioName)
+ }
+
+ profileName := serviceType + "-" + applicationName + "-" + scenarioName
workloadTypeExist, err := sqlstore.ExistWorkloadType(profileName)
if err != nil {
return &PB.Ack{}, err
--
2.33.0

View File

@ -0,0 +1,26 @@
From b274e3e2455df84a95ed34acd118dd72c5e14313 Mon Sep 17 00:00:00 2001
From: dongjiao <dongjiao@kylinos.cn>
Date: Tue, 11 Mar 2025 11:09:07 +0800
Subject: [PATCH] scikit-learn-1.2 rename the parameter 'base_estimator' to
'estimator'.
---
analysis/optimizer/weighted_ensemble_feature_selector.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/analysis/optimizer/weighted_ensemble_feature_selector.py b/analysis/optimizer/weighted_ensemble_feature_selector.py
index cb39561..4137fe4 100644
--- a/analysis/optimizer/weighted_ensemble_feature_selector.py
+++ b/analysis/optimizer/weighted_ensemble_feature_selector.py
@@ -86,7 +86,7 @@ class WeightedEnsembleFeatureSelector:
graboo = GradientBoostingRegressor(n_estimators=10000, learning_rate=0.1)
adb = AdaBoostRegressor(DecisionTreeRegressor(max_depth=16),
n_estimators=10000, random_state=0)
- bag = BaggingRegressor(base_estimator=ExtraTreeRegressor(max_depth=16),
+ bag = BaggingRegressor(estimator=ExtraTreeRegressor(max_depth=16),
n_estimators=10000, random_state=0, n_jobs=-1)
self._regressors = [dtree, ranfor, graboo, adb, bag]
self._ensemble_model = Ridge(alpha=10, max_iter=1000000)
--
2.43.0

View File

@ -1,211 +0,0 @@
From 4b357a57599ed623abbe094838d22895dc22fb5a Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Wed, 9 Aug 2023 21:41:10 +0800
Subject: [PATCH 3/3] bugfix: collection res can only save file to specified
dir
---
Makefile | 3 +++
api/profile/profile.pb.go | 6 ++---
api/profile/profile.proto | 2 +-
common/config/config.go | 1 +
modules/client/profile/profile_collection.go | 24 ++++++--------------
modules/server/profile/profile.go | 11 +++++----
6 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/Makefile b/Makefile
index 5d9d317..bcac447 100755
--- a/Makefile
+++ b/Makefile
@@ -53,6 +53,7 @@ cleanall: clean
rm -rf $(DESTDIR)/var/lib/atuned/
rm -rf $(DESTDIR)/var/run/atuned/
rm -rf $(DESTDIR)/var/atuned/
+ rm -rf $(DESTDIR)/var/atune_data/
db:
sqlite3 database/atuned.db ".read database/init.sql"
@@ -78,6 +79,7 @@ libinstall:
rm -rf $(DESTDIR)/var/lib/atuned/
rm -rf $(DESTDIR)/var/run/atuned/
rm -rf $(DESTDIR)/var/atuned/
+ rm -rf $(DESTDIR)/var/atune_data/
mkdir -p $(DESTDIR)/etc/atuned/tuning
mkdir -p $(DESTDIR)/etc/atuned/rules
mkdir -p $(DESTDIR)/etc/atuned/training
@@ -90,6 +92,7 @@ libinstall:
mkdir -p $(DESTDIR)/var/lib/atuned
mkdir -p $(DESTDIR)/var/run/atuned
mkdir -p $(DESTDIR)/var/atuned
+ mkdir -p $(DESTDIR)/var/atune_data/collection
mkdir -p $(DESTDIR)$(PREFIX)/share/bash-completion/completions
install -m 640 pkg/daemon_profile_server.so $(DESTDIR)$(PREFIX)/lib/atuned/modules
install -m 750 pkg/atune-adm $(BINDIR)
diff --git a/api/profile/profile.pb.go b/api/profile/profile.pb.go
index dba166d..4e70c41 100644
--- a/api/profile/profile.pb.go
+++ b/api/profile/profile.pb.go
@@ -408,7 +408,7 @@ type CollectFlag struct {
Interval int64 `protobuf:"varint,1,opt,name=Interval,proto3" json:"Interval,omitempty"`
Duration int64 `protobuf:"varint,2,opt,name=Duration,proto3" json:"Duration,omitempty"`
Workload string `protobuf:"bytes,3,opt,name=Workload,proto3" json:"Workload,omitempty"`
- OutputPath string `protobuf:"bytes,4,opt,name=OutputPath,proto3" json:"OutputPath,omitempty"`
+ OutputDir string `protobuf:"bytes,4,opt,name=OutputDir,proto3" json:"OutputDir,omitempty"`
Block string `protobuf:"bytes,5,opt,name=Block,proto3" json:"Block,omitempty"`
Network string `protobuf:"bytes,6,opt,name=Network,proto3" json:"Network,omitempty"`
Type string `protobuf:"bytes,7,opt,name=Type,proto3" json:"Type,omitempty"`
@@ -463,9 +463,9 @@ func (m *CollectFlag) GetWorkload() string {
return ""
}
-func (m *CollectFlag) GetOutputPath() string {
+func (m *CollectFlag) GetOutputDir() string {
if m != nil {
- return m.OutputPath
+ return m.OutputDir
}
return ""
}
diff --git a/api/profile/profile.proto b/api/profile/profile.proto
index 2a6e751..71d8ceb 100755
--- a/api/profile/profile.proto
+++ b/api/profile/profile.proto
@@ -76,7 +76,7 @@ message CollectFlag {
int64 Interval = 1;
int64 Duration = 2;
string Workload = 3;
- string OutputPath = 4;
+ string OutputDir = 4;
string Block = 5;
string Network = 6;
string Type = 7;
diff --git a/common/config/config.go b/common/config/config.go
index 4bd70a6..b9d2b66 100644
--- a/common/config/config.go
+++ b/common/config/config.go
@@ -55,6 +55,7 @@ const (
DefaultCheckerPath = "/usr/share/atuned/checker/"
DefaultBackupPath = "/usr/share/atuned/backup/"
DefaultTuningLogPath = "/var/atuned"
+ DefaultCollectionPath = "/var/atune_data/collection/"
)
// log config
diff --git a/modules/client/profile/profile_collection.go b/modules/client/profile/profile_collection.go
index 26b8d65..2873dac 100644
--- a/modules/client/profile/profile_collection.go
+++ b/modules/client/profile/profile_collection.go
@@ -20,7 +20,6 @@ import (
"gitee.com/openeuler/A-Tune/common/utils"
"fmt"
"io"
- "path/filepath"
"github.com/urfave/cli"
CTX "golang.org/x/net/context"
@@ -48,8 +47,8 @@ var collectionCommand = cli.Command{
Value: 1200,
},
cli.StringFlag{
- Name: "output_path,o",
- Usage: "the output path of the collecting data",
+ Name: "output_dir,o",
+ Usage: "the output dir name of the collecting data, full dir path would be /var/atune_data/collection/{output_dir}",
Value: "",
},
cli.StringFlag{
@@ -71,8 +70,8 @@ var collectionCommand = cli.Command{
Description: func() string {
desc := `
collect data for train machine learning model, you must set the command options
- which has no default value, the output_path must be a absolute path.
- example: atune-adm collection -f mysql -i 5 -d 1200 -o /home -b sda -n eth0 -t mysql`
+ which has no default value.
+ example: atune-adm collection -f mysql -i 5 -d 1200 -o tmp -b sda -n eth0 -t mysql`
return desc
}(),
Action: collection,
@@ -118,9 +117,9 @@ func checkCollectionCtx(ctx *cli.Context) error {
return fmt.Errorf("error: app type must be specified")
}
- if ctx.String("output_path") == "" {
+ if ctx.String("output_dir") == "" {
_ = cli.ShowCommandHelp(ctx, "collection")
- return fmt.Errorf("error: output_path must be specified")
+ return fmt.Errorf("error: output_dir must be specified")
}
if ctx.Int64("interval") < 1 || ctx.Int64("interval") > 60 {
@@ -131,10 +130,6 @@ func checkCollectionCtx(ctx *cli.Context) error {
return fmt.Errorf("error: collection duration value must be bigger than interval*10")
}
- if !filepath.IsAbs(ctx.String("output_path")) {
- return fmt.Errorf("error: output path must be absolute path")
- }
-
return nil
}
@@ -149,16 +144,11 @@ func collection(ctx *cli.Context) error {
}
defer c.Close()
- outputPath := ctx.String("output_path")
- outputPath, err = filepath.Abs(outputPath)
- if err != nil {
- return err
- }
message := PB.CollectFlag{
Interval: ctx.Int64("interval"),
Duration: ctx.Int64("duration"),
Workload: ctx.String("filename"),
- OutputPath: outputPath,
+ OutputDir: ctx.String("output_dir"),
Block: ctx.String("disk"),
Network: ctx.String("network"),
Type: ctx.String("app_type"),
diff --git a/modules/server/profile/profile.go b/modules/server/profile/profile.go
index 3264167..ec1e739 100644
--- a/modules/server/profile/profile.go
+++ b/modules/server/profile/profile.go
@@ -1019,8 +1019,8 @@ func (s *ProfileServer) Collection(message *PB.CollectFlag, stream PB.ProfileMgr
return fmt.Errorf("input:%s is invalid", message.GetWorkload())
}
- if valid := utils.IsInputStringValid(message.GetOutputPath()); !valid {
- return fmt.Errorf("input:%s is invalid", message.GetOutputPath())
+ if valid, _ := regexp.MatchString("^[a-zA-Z]+(_[a-zA-Z0-9]+)*$", message.GetOutputDir()); !valid {
+ return fmt.Errorf("output dir:%s is invalid", message.GetOutputDir())
}
if valid := utils.IsInputStringValid(message.GetType()); !valid {
@@ -1049,12 +1049,13 @@ func (s *ProfileServer) Collection(message *PB.CollectFlag, stream PB.ProfileMgr
return err
}
- exist, err := utils.PathExist(message.GetOutputPath())
+ outputDir := path.Join(config.DefaultCollectionPath, message.GetOutputDir())
+ exist, err := utils.PathExist(message.GetOutputDir())
if err != nil {
return err
}
if !exist {
- return fmt.Errorf("output_path %s is not exist", message.GetOutputPath())
+ _ = os.MkdirAll(outputDir, 0755)
}
if err = utils.InterfaceByName(message.GetNetwork()); err != nil {
@@ -1106,7 +1107,7 @@ func (s *ProfileServer) Collection(message *PB.CollectFlag, stream PB.ProfileMgr
collectorBody.Monitors = monitors
nowTime := time.Now().Format("20060702-150405")
fileName := fmt.Sprintf("%s-%s.csv", message.GetWorkload(), nowTime)
- collectorBody.File = path.Join(message.GetOutputPath(), fileName)
+ collectorBody.File = path.Join(outputDir, fileName)
if include == "" {
include = "default"
}
--
2.27.0

View File

@ -0,0 +1,54 @@
From 2cc1896225cec667893068a3be5d8e7d09043af5 Mon Sep 17 00:00:00 2001
From: Pshysimon <caixiaomeng2@huawei.com>
Date: Sat, 12 Apr 2025 16:44:11 +0800
Subject: [PATCH] fix atune-adm analyse failed problem
---
analysis/optimizer/app_characterization.py | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/analysis/optimizer/app_characterization.py b/analysis/optimizer/app_characterization.py
index 80b6752..738320f 100644
--- a/analysis/optimizer/app_characterization.py
+++ b/analysis/optimizer/app_characterization.py
@@ -202,16 +202,9 @@ class AppCharacterization(WorkloadCharacterization):
:param feature_selection: whether to perform feature extraction
:param consider_perf: whether to consider perf indicators
"""
- if consider_perf == None:
- consider_perf = self.consider_perf
-
- data_features = self.get_consider_perf(consider_perf)
-
cpu_exist, mem_exist, net_quality_exist, net_io_exist, disk_io_exist = self.bottleneck.search_bottleneck(data)
bottleneck_binary = (int(cpu_exist) << 4) | (int(mem_exist) << 3) | (int(net_quality_exist) << 2) | (int(net_io_exist) << 1) | int(disk_io_exist)
- data = data[data_features]
-
tencoder_path = os.path.join(self.model_path, "tencoder.pkl")
aencoder_path = os.path.join(self.model_path, "aencoder.pkl")
scaler_path = os.path.join(self.model_path, "scaler.pkl")
@@ -226,6 +219,13 @@ class AppCharacterization(WorkloadCharacterization):
type_model_clf = joblib.load(type_model_path)
app_model_clf = joblib.load(app_model_path)
+ if consider_perf is None:
+ consider_perf = (len(self.scaler.mean_) == len(data.columns))
+
+ data_features = self.get_consider_perf(consider_perf)
+
+ data = data[data_features]
+
data = self.scaler.transform(data)
if feature_selection:
@@ -290,4 +290,4 @@ class AppCharacterization(WorkloadCharacterization):
confidence = prediction[1] / len(result)
if confidence > 0.5:
return bottleneck_binary, prediction[0], confidence
- return bottleneck_binary, "default", confidence
\ No newline at end of file
+ return bottleneck_binary, "default", confidence
--
2.27.0

View File

@ -1,26 +0,0 @@
From 6aae35d592388924f5ab92db90912a1b7962d665 Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Wed, 16 Aug 2023 10:26:19 +0800
Subject: [PATCH] [atune]add service restart mode
---
misc/atuned.service | 3 +++
1 file changed, 3 insertions(+)
diff --git a/misc/atuned.service b/misc/atuned.service
index bc5de9b..58fb022 100644
--- a/misc/atuned.service
+++ b/misc/atuned.service
@@ -7,6 +7,9 @@ Requires=polkit.service
Type=notify
ExecStart=/usr/bin/atuned
SuccessExitStatus=100
+Restart=on-failure
+RestartSec=3s
+TimeoutSec=1m
[Install]
WantedBy=multi-user.target
--
2.27.0

View File

@ -1,64 +0,0 @@
From f1fa941597af1b27278b430c1f7172fc5820d0ac Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Wed, 16 Aug 2023 12:39:37 +0800
Subject: [PATCH] [atune]update Makefile and logs
---
Makefile | 10 ++++------
common/profile/profile.go | 2 +-
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index bcac447..5c76b4e 100755
--- a/Makefile
+++ b/Makefile
@@ -46,14 +46,13 @@ clean:
rm -rf $(PKGPATH)/*
cleanall: clean
- rm -rf $(DESTDIR)/etc/atuned/
+ rm -rf $(DESTDIR)/etc/atune*
rm -rf $(DESTDIR)$(PREFIX)/lib/atuned/
rm -rf $(DESTDIR)$(PREFIX)/share/atuned/
rm -rf $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/
rm -rf $(DESTDIR)/var/lib/atuned/
rm -rf $(DESTDIR)/var/run/atuned/
- rm -rf $(DESTDIR)/var/atuned/
- rm -rf $(DESTDIR)/var/atune_data/
+ rm -rf $(DESTDIR)/var/atune*
db:
sqlite3 database/atuned.db ".read database/init.sql"
@@ -72,14 +71,13 @@ libinstall:
@echo "BEGIN INSTALL A-Tune..."
mkdir -p $(BINDIR)
mkdir -p $(SYSTEMDDIR)
- rm -rf $(DESTDIR)/etc/atuned/
+ rm -rf $(DESTDIR)/etc/atune*
rm -rf $(DESTDIR)$(PREFIX)/lib/atuned/
rm -rf $(DESTDIR)$(PREFIX)/share/atuned/
rm -rf $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/
rm -rf $(DESTDIR)/var/lib/atuned/
rm -rf $(DESTDIR)/var/run/atuned/
- rm -rf $(DESTDIR)/var/atuned/
- rm -rf $(DESTDIR)/var/atune_data/
+ rm -rf $(DESTDIR)/var/atune*
mkdir -p $(DESTDIR)/etc/atuned/tuning
mkdir -p $(DESTDIR)/etc/atuned/rules
mkdir -p $(DESTDIR)/etc/atuned/training
diff --git a/common/profile/profile.go b/common/profile/profile.go
index 264fdd8..43a4e77 100644
--- a/common/profile/profile.go
+++ b/common/profile/profile.go
@@ -294,7 +294,7 @@ func (p *Profile) ItemSort() error {
} else {
itemQuery, err := sqlstore.GetPropertyItem(key.Name())
if err != nil {
- log.Errorf("key %s is not exist in tuned_item", key.Name())
+ log.Infof("key %s is not exist in tuned_item", key.Name())
itemName = "OTHERS"
} else {
itemName = itemQuery
--
2.27.0

View File

@ -0,0 +1,603 @@
From d5eb70924f87963c80c7a4677048f2bcd4581534 Mon Sep 17 00:00:00 2001
From: zhoupengcheng <zhoupengcheng11@huawei.com>
Date: Mon, 18 Mar 2024 20:44:27 +0800
Subject: [PATCH] adapt sqlite 3.42 to resolve the build failure.
---
database/init.sql | 562 +++++++++++++++++++++++-----------------------
1 file changed, 281 insertions(+), 281 deletions(-)
diff --git a/database/init.sql b/database/init.sql
index b8edb3a..688743c 100755
--- a/database/init.sql
+++ b/database/init.sql
@@ -77,305 +77,305 @@ CREATE TABLE IF NOT EXISTS schedule(
-- class_apps:
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("encryption_AES", "encryption", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("encryption_MD5", "encryption", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("encryption_RSAPublic", "encryption", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("default", "default", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("ceph", "storage-ceph", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("hadoop_hdd", "big-data-hadoop-hdfs", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("hadoop_ssd", "big-data-hadoop-hdfs", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("spark", "big-data-hadoop-spark", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("mongodb", "database-mongodb", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("mariadb", "database-mariadb", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("mysql", "database-mysql", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("postgresql", "database-postgresql", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("nginx_https_long", "web-nginx", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("nginx_https_short", "web-nginx", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("nginx_http_long", "web-nginx", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("nginx_http_short", "web-nginx", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("apache", "web-apache-traffic-server", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("redis", "in-memory-database-redis", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("speccpu", "basic-test-suite-speccpu", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("specjbb", "basic-test-suite-specjbb", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("dubbo", "middleware-dubbo", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("robox", "arm-native-android-container", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("kvm", "cloud-compute-kvm", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("hpc", "hpc-gatk4", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("olc", "virtualization-consumer-cloud", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("mariadb_kvm", "virtualization-mariadb", "", 0);
-INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES("mariadb_docker", "docker-mariadb", "", 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('encryption_AES', 'encryption', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('encryption_MD5', 'encryption', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('encryption_RSAPublic', 'encryption', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('default', 'default', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('ceph', 'storage-ceph', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('hadoop_hdd', 'big-data-hadoop-hdfs', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('hadoop_ssd', 'big-data-hadoop-hdfs', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('spark', 'big-data-hadoop-spark', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('mongodb', 'database-mongodb', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('mariadb', 'database-mariadb', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('mysql', 'database-mysql', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('postgresql', 'database-postgresql', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('nginx_https_long', 'web-nginx', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('nginx_https_short', 'web-nginx', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('nginx_http_long', 'web-nginx', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('nginx_http_short', 'web-nginx', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('apache', 'web-apache-traffic-server', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('redis', 'in-memory-database-redis', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('speccpu', 'basic-test-suite-speccpu', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('specjbb', 'basic-test-suite-specjbb', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('dubbo', 'middleware-dubbo', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('robox', 'arm-native-android-container', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('kvm', 'cloud-compute-kvm', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('hpc', 'hpc-gatk4', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('olc', 'virtualization-consumer-cloud', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('mariadb_kvm', 'virtualization-mariadb', '', 0);
+INSERT INTO class_apps(class, apps, resource_limit, deletable) VALUES('mariadb_docker', 'docker-mariadb', '', 0);
-- class_profile:
-INSERT INTO class_profile(class, profile_type, active) VALUES("encryption_AES", "encryption-AES-chauffeur", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("encryption_MD5", "encryption-MD5-chauffeur", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("encryption_RSAPublic", "encryption-RSAPublic-chauffeur", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("default", "default-default", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("ceph", "storage-ceph-vdbench-hdd", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("hadoop_hdd", "big-data-hadoop-hdfs-dfsio-hdd", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("hadoop_ssd", "big-data-hadoop-hdfs-dfsio-ssd", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("spark", "big-data-hadoop-spark-kmeans", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("mongodb", "database-mongodb-2p-sysbench", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("mariadb", "database-mariadb-2p-tpcc-c3", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("mysql", "database-mysql-2p-sysbench-hdd", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("postgresql", "database-postgresql-2p-sysbench-hdd", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("nginx_https_short", "web-nginx-https-short-connection", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("nginx_https_long", "web-nginx-https-long-connection", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("nginx_http_short", "web-nginx-http-short-connection", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("nginx_http_long", "web-nginx-http-long-connection", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("apache", "web-apache-traffic-server-spirent-pingpo", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("redis", "in-memory-database-redis-redis-benchmark", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("speccpu", "basic-test-suite-speccpu-speccpu2006", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("specjbb", "basic-test-suite-specjbb-specjbb2015", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("dubbo", "middleware-dubbo-dubbo-benchmark", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("robox", "arm-native-android-container-robox", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("kvm", "cloud-compute-kvm-host", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("hpc", "hpc-gatk4-human-genome", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("olc", "virtualization-consumer-cloud-olc", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("mariadb_kvm", "virtualization-mariadb-2p-tpcc-c3", 0);
-INSERT INTO class_profile(class, profile_type, active) VALUES("mariadb_docker", "docker-mariadb-2p-tpcc-c3", 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('encryption_AES', 'encryption-AES-chauffeur', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('encryption_MD5', 'encryption-MD5-chauffeur', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('encryption_RSAPublic', 'encryption-RSAPublic-chauffeur', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('default', 'default-default', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('ceph', 'storage-ceph-vdbench-hdd', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('hadoop_hdd', 'big-data-hadoop-hdfs-dfsio-hdd', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('hadoop_ssd', 'big-data-hadoop-hdfs-dfsio-ssd', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('spark', 'big-data-hadoop-spark-kmeans', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('mongodb', 'database-mongodb-2p-sysbench', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('mariadb', 'database-mariadb-2p-tpcc-c3', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('mysql', 'database-mysql-2p-sysbench-hdd', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('postgresql', 'database-postgresql-2p-sysbench-hdd', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('nginx_https_short', 'web-nginx-https-short-connection', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('nginx_https_long', 'web-nginx-https-long-connection', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('nginx_http_short', 'web-nginx-http-short-connection', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('nginx_http_long', 'web-nginx-http-long-connection', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('apache', 'web-apache-traffic-server-spirent-pingpo', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('redis', 'in-memory-database-redis-redis-benchmark', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('speccpu', 'basic-test-suite-speccpu-speccpu2006', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('specjbb', 'basic-test-suite-specjbb-specjbb2015', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('dubbo', 'middleware-dubbo-dubbo-benchmark', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('robox', 'arm-native-android-container-robox', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('kvm', 'cloud-compute-kvm-host', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('hpc', 'hpc-gatk4-human-genome', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('olc', 'virtualization-consumer-cloud-olc', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('mariadb_kvm', 'virtualization-mariadb-2p-tpcc-c3', 0);
+INSERT INTO class_profile(class, profile_type, active) VALUES('mariadb_docker', 'docker-mariadb-2p-tpcc-c3', 0);
-- Performance Point
-INSERT INTO tuned_item(property, item) VALUES("check_environment", "Check");
+INSERT INTO tuned_item(property, item) VALUES('check_environment', 'Check');
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_HZ", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_ARM64_64K_PAGES", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_NUMA_AWARE_SPINLOCKS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_CGROUP_FILES", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_SLUB_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_PM_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_PM_SLEEP_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_STACKPROTECTOR", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_STACKPROTECTOR_STRONG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_VMAP_STACK", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_BLK_DEBUG_FS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_BLK_DEBUG_FS_ZONED", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_NET_DROP_MONITOR", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DM_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_MLX4_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_VIDEO_ADV_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_INFINIBAND_IPOIB_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_NFS_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_SUNRPC_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_CIFS_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_BINARY_PRINTF", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DEBUG_INFO_DWARF4", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DEBUG_MEMORY_INIT", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_SCHED_DEBUG", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DEBUG_BUGVERBOSE", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DEBUG_LIST", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_TRACEPOINTS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_NOP_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_TRACER_MAX_TRACE", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_TRACE_CLOCK", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_RING_BUFFER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_EVENT_TRACING", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_CONTEXT_SWITCH_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_TRACING", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_GENERIC_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_FTRACE", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_FUNCTION_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_FUNCTION_GRAPH_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_SCHED_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_HWLAT_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_FTRACE_SYSCALLS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_TRACER_SNAPSHOT", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_BRANCH_PROFILE_NONE", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_STACK_TRACER", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_BLK_DEV_IO_TRACE", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_KPROBE_EVENTS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_UPROBE_EVENTS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_BPF_EVENTS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_PROBE_EVENTS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DYNAMIC_FTRACE", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_FTRACE_MCOUNT_RECORD", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_TRACING_MAP", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_HIST_TRIGGERS", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_RING_BUFFER_BENCHMARK", "Kernel");
-INSERT INTO tuned_item(property, item) VALUES("CONFIG_DEBUG_ALIGN_RODATA", "Kernel");
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_HZ', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_ARM64_64K_PAGES', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_NUMA_AWARE_SPINLOCKS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_CGROUP_FILES', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_SLUB_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_PM_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_PM_SLEEP_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_STACKPROTECTOR', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_STACKPROTECTOR_STRONG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_VMAP_STACK', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_BLK_DEBUG_FS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_BLK_DEBUG_FS_ZONED', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_NET_DROP_MONITOR', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DM_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_MLX4_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_VIDEO_ADV_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_INFINIBAND_IPOIB_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_NFS_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_SUNRPC_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_CIFS_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_BINARY_PRINTF', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DEBUG_INFO_DWARF4', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DEBUG_MEMORY_INIT', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_SCHED_DEBUG', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DEBUG_BUGVERBOSE', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DEBUG_LIST', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_TRACEPOINTS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_NOP_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_TRACER_MAX_TRACE', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_TRACE_CLOCK', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_RING_BUFFER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_EVENT_TRACING', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_CONTEXT_SWITCH_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_TRACING', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_GENERIC_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_FTRACE', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_FUNCTION_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_FUNCTION_GRAPH_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_SCHED_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_HWLAT_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_FTRACE_SYSCALLS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_TRACER_SNAPSHOT', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_BRANCH_PROFILE_NONE', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_STACK_TRACER', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_BLK_DEV_IO_TRACE', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_KPROBE_EVENTS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_UPROBE_EVENTS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_BPF_EVENTS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_PROBE_EVENTS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DYNAMIC_FTRACE', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_FTRACE_MCOUNT_RECORD', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_TRACING_MAP', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_HIST_TRIGGERS', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_RING_BUFFER_BENCHMARK', 'Kernel');
+INSERT INTO tuned_item(property, item) VALUES('CONFIG_DEBUG_ALIGN_RODATA', 'Kernel');
-INSERT INTO tuned_item(property, item) VALUES("iommu.passthrough", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("iommu.strict", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("default_hugepagesz", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("hugepagesz", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("hugepages", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("selinux", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("skew_tick", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("numa_spinlock", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("scsi_mod.use_blk_mq", "Bootloader");
-INSERT INTO tuned_item(property, item) VALUES("sched_steal_node_limit", "Bootloader");
+INSERT INTO tuned_item(property, item) VALUES('iommu.passthrough', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('iommu.strict', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('default_hugepagesz', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('hugepagesz', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('hugepages', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('selinux', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('skew_tick', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('numa_spinlock', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('scsi_mod.use_blk_mq', 'Bootloader');
+INSERT INTO tuned_item(property, item) VALUES('sched_steal_node_limit', 'Bootloader');
-INSERT INTO tuned_item(property, item) VALUES("openssl_hpre", "Script");
-INSERT INTO tuned_item(property, item) VALUES("hinic", "Script");
+INSERT INTO tuned_item(property, item) VALUES('openssl_hpre', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('hinic', 'Script');
-INSERT INTO tuned_item(property, item) VALUES("NUMA", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("SRIOV", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Custom Refresh Rate", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Stream Write Mode", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Support Smmu", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Support SPCR", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Max Payload Size", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Power Policy", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Rank Interleaving", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Read Policy", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Write Policy", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("I/O Policy", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Access Policy", "Bios");
-INSERT INTO tuned_item(property, item) VALUES("Drive Cache", "Bios");
+INSERT INTO tuned_item(property, item) VALUES('NUMA', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('SRIOV', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Custom Refresh Rate', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Stream Write Mode', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Support Smmu', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Support SPCR', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Max Payload Size', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Power Policy', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Rank Interleaving', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Read Policy', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Write Policy', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('I/O Policy', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Access Policy', 'Bios');
+INSERT INTO tuned_item(property, item) VALUES('Drive Cache', 'Bios');
-INSERT INTO tuned_item(property, item) VALUES("vm.nr_hugepages", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.swappiness", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.dirty_ratio", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.max_map_count", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.panic_on_oom", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.dirty_background_ratio", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.dirty_writeback_centisecs", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.dirty_expire_centisecs", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.overcommit_memory", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.zone_reclaim_mode", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.min_free_kbytes", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel/mm/transparent_hugepage/defrag", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("kernel/mm/transparent_hugepage/enabled", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("kernel/debug/sched_features", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/scheduler", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/read_ahead_kb", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/nr_requests", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/device/queue_depth", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/write_cache", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/nomerges", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/iosched/slice_idle", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/iosched/low_latency", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/rq_affinity", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("block/{disk}/queue/max_sectors_kb", "Sysfs");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_max_syn_backlog", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.somaxconn", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_keepalive_time", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_keepalive_probes", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_keepalive_intvl", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_retries2", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.ip_forward", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.conf.default.rp_filter", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.conf.default.accept_source_route", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_tw_reuse", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_syncookies", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_low_latency", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_tcp_timeout_established", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.bridge.bridge-nf-call-ip6tables", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.bridge.bridge-nf-call-iptables", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.bridge.bridge-nf-call-arptables", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.ip_local_port_range", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_max_tw_buckets", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.netdev_max_backlog", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_max_orphans", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_timestamps", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_synack_retries", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_syn_retries", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_fin_timeout", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_mem", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_rmem", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_wmem", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.udp_mem", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_sack", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.tcp_fastopen", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.wmem_default", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.rmem_default", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.rmem_max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.wmem_max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_tcp_timeout_close_wait", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_tcp_timeout_fin_wait", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_tcp_timeout_time_wait", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.ipv4.conf.default.forwarding", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_buckets", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.netfilter.nf_conntrack_count", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.nf_conntrack_max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.dev_weight", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.optmem_max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.netdev_budget", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.busy_read", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.busy_poll", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("net.core.rps_sock_flow_entries", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("ethtool", "Script");
-INSERT INTO tuned_item(property, item) VALUES("ifconfig", "Script");
-INSERT INTO tuned_item(property, item) VALUES("fs.file-max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("fs.nr_open", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("fs.suid_dumpable", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("fs.aio-max-nr", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("fs.inotify.max_user_instances", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.threads-max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sem", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.msgmnb", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.msgmax", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.shmmax", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.shmall", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.shmmni", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.pid_max", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.numa_balancing", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("{user}.hard.nofile", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.soft.nofile", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.soft.stack", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.hard.stack", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.soft.nproc", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.hard.nproc", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.soft.memlock", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("{user}.hard.memlock", "Ulimit");
-INSERT INTO tuned_item(property, item) VALUES("swap", "Script");
-INSERT INTO tuned_item(property, item) VALUES("kernel.randomize_va_space", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_cfs_bandwidth_slice_us", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_migration_cost_ns", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_latency_ns", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_nr_migrate", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_min_granularity_ns", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_wakeup_granularity_ns", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sysrq", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.kstack_depth_to_print", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.panic_on_oops", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.panic", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.hung_task_timeout_secs", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.hung_task_panic", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.oom_dump_tasks", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.softlockup_panic", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.core_uses_pid", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.nmi_watchdog", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_rt_runtime_us", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("vm.stat_interval", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.timer_migration", "Sysctl");
-INSERT INTO tuned_item(property, item) VALUES("kernel.sched_autogroup_enabled", "Sysctl");
+INSERT INTO tuned_item(property, item) VALUES('vm.nr_hugepages', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.swappiness', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.dirty_ratio', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.max_map_count', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.panic_on_oom', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.dirty_background_ratio', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.dirty_writeback_centisecs', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.dirty_expire_centisecs', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.overcommit_memory', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.zone_reclaim_mode', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.min_free_kbytes', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel/mm/transparent_hugepage/defrag', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('kernel/mm/transparent_hugepage/enabled', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('kernel/debug/sched_features', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/scheduler', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/read_ahead_kb', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/nr_requests', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/device/queue_depth', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/write_cache', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/nomerges', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/iosched/slice_idle', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/iosched/low_latency', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/rq_affinity', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('block/{disk}/queue/max_sectors_kb', 'Sysfs');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_max_syn_backlog', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.somaxconn', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_keepalive_time', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_keepalive_probes', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_keepalive_intvl', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_retries2', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.ip_forward', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.conf.default.rp_filter', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.conf.default.accept_source_route', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_tw_reuse', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_syncookies', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_low_latency', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_tcp_timeout_established', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.bridge.bridge-nf-call-ip6tables', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.bridge.bridge-nf-call-iptables', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.bridge.bridge-nf-call-arptables', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.ip_local_port_range', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_max_tw_buckets', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.netdev_max_backlog', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_max_orphans', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_timestamps', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_synack_retries', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_syn_retries', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_fin_timeout', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_mem', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_rmem', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_wmem', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.udp_mem', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_sack', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.tcp_fastopen', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.wmem_default', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.rmem_default', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.rmem_max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.wmem_max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_tcp_timeout_close_wait', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_tcp_timeout_fin_wait', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_tcp_timeout_time_wait', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.ipv4.conf.default.forwarding', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_buckets', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.netfilter.nf_conntrack_count', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.nf_conntrack_max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.dev_weight', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.optmem_max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.netdev_budget', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.busy_read', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.busy_poll', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('net.core.rps_sock_flow_entries', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('ethtool', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('ifconfig', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('fs.file-max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('fs.nr_open', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('fs.suid_dumpable', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('fs.aio-max-nr', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('fs.inotify.max_user_instances', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.threads-max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sem', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.msgmnb', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.msgmax', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.shmmax', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.shmall', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.shmmni', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.pid_max', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.numa_balancing', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('{user}.hard.nofile', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.soft.nofile', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.soft.stack', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.hard.stack', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.soft.nproc', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.hard.nproc', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.soft.memlock', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('{user}.hard.memlock', 'Ulimit');
+INSERT INTO tuned_item(property, item) VALUES('swap', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('kernel.randomize_va_space', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_cfs_bandwidth_slice_us', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_migration_cost_ns', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_latency_ns', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_nr_migrate', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_min_granularity_ns', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_wakeup_granularity_ns', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sysrq', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.kstack_depth_to_print', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.panic_on_oops', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.panic', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.hung_task_timeout_secs', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.hung_task_panic', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.oom_dump_tasks', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.softlockup_panic', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.core_uses_pid', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.nmi_watchdog', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_rt_runtime_us', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('vm.stat_interval', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.timer_migration', 'Sysctl');
+INSERT INTO tuned_item(property, item) VALUES('kernel.sched_autogroup_enabled', 'Sysctl');
-INSERT INTO tuned_item(property, item) VALUES("prefetch", "Script");
-INSERT INTO tuned_item(property, item) VALUES("logind", "Script");
-INSERT INTO tuned_item(property, item) VALUES("blockdev", "Script");
-INSERT INTO tuned_item(property, item) VALUES("hugepage", "Script");
-INSERT INTO tuned_item(property, item) VALUES("rps_cpus", "Script");
-INSERT INTO tuned_item(property, item) VALUES("sched_domain", "Script");
-INSERT INTO tuned_item(property, item) VALUES("hdparm", "Script");
+INSERT INTO tuned_item(property, item) VALUES('prefetch', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('logind', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('blockdev', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('hugepage', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('rps_cpus', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('sched_domain', 'Script');
+INSERT INTO tuned_item(property, item) VALUES('hdparm', 'Script');
-INSERT INTO tuned_item(property, item) VALUES("sysmonitor", "Systemctl");
-INSERT INTO tuned_item(property, item) VALUES("irqbalance", "Systemctl");
-INSERT INTO tuned_item(property, item) VALUES("firewalld", "Systemctl");
-INSERT INTO tuned_item(property, item) VALUES("tuned", "Systemctl");
+INSERT INTO tuned_item(property, item) VALUES('sysmonitor', 'Systemctl');
+INSERT INTO tuned_item(property, item) VALUES('irqbalance', 'Systemctl');
+INSERT INTO tuned_item(property, item) VALUES('firewalld', 'Systemctl');
+INSERT INTO tuned_item(property, item) VALUES('tuned', 'Systemctl');
-INSERT INTO tuned_item(property, item) VALUES("compile_optimization", "Compiler");
-INSERT INTO tuned_item(property, item) VALUES("compile_security", "Compiler");
+INSERT INTO tuned_item(property, item) VALUES('compile_optimization', 'Compiler');
+INSERT INTO tuned_item(property, item) VALUES('compile_security', 'Compiler');
-INSERT INTO tuned_item(property, item) VALUES("/etc/profile", "Profile");
+INSERT INTO tuned_item(property, item) VALUES('/etc/profile', 'Profile');
-- collection table
-INSERT INTO collection(name, module, purpose, metrics) VALUES("cpu", "CPU", "STAT", "--interval={interval}; --fields=usr --fields=nice --fields=sys --fields=iowait --fields=irq --fields=soft --fields=steal --fields=guest --threshold=30 --fields=util --fields=cutil");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("storage", "STORAGE", "STAT", "--interval={interval};--device={disk} --fields=rs --fields=ws --fields=rMBs --fields=wMBs --fields=rrqm --fields=wrqm --fields=rareq-sz --fields=wareq-sz --fields=r_await --fields=w_await --fields=util --fields=aqu-sz");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("network", "NET", "STAT", "--interval={interval};--nic={network} --fields=rxkBs --fields=txkBs --fields=rxpcks --fields=txpcks --fields=ifutil");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("network-err", "NET", "ESTAT", "--interval={interval};--nic={network} --fields=errs --fields=util");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("mem.band", "MEM", "BANDWIDTH", "--interval={interval};--fields=Total_Util");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("perf", "PERF", "STAT", "--interval={interval};--fields=IPC --fields=CACHE-MISS-RATIO --fields=MPKI --fields=ITLB-LOAD-MISS-RATIO --fields=DTLB-LOAD-MISS-RATIO --fields=SBPI --fields=SBPC");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("vmstat", "MEM", "VMSTAT", "--interval={interval};--fields=procs.b --fields=memory.swpd --fields=io.bo --fields=system.in --fields=system.cs --fields=util.swap --fields=util.cpu --fields=procs.r");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("sys.task", "SYS", "TASKS", "--interval={interval};--fields=procs --fields=cswchs");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("sys.ldavg", "SYS", "LDAVG", "--interval={interval};--fields=runq-sz --fields=plist-sz --fields=ldavg-1 --fields=ldavg-5");
-INSERT INTO collection(name, module, purpose, metrics) VALUES("file.util", "SYS", "FDUTIL", "--interval={interval};--fields=fd-util");
+INSERT INTO collection(name, module, purpose, metrics) VALUES('cpu', 'CPU', 'STAT', '--interval={interval}; --fields=usr --fields=nice --fields=sys --fields=iowait --fields=irq --fields=soft --fields=steal --fields=guest --threshold=30 --fields=util --fields=cutil');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('storage', 'STORAGE', 'STAT', '--interval={interval};--device={disk} --fields=rs --fields=ws --fields=rMBs --fields=wMBs --fields=rrqm --fields=wrqm --fields=rareq-sz --fields=wareq-sz --fields=r_await --fields=w_await --fields=util --fields=aqu-sz');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('network', 'NET', 'STAT', '--interval={interval};--nic={network} --fields=rxkBs --fields=txkBs --fields=rxpcks --fields=txpcks --fields=ifutil');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('network-err', 'NET', 'ESTAT', '--interval={interval};--nic={network} --fields=errs --fields=util');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('mem.band', 'MEM', 'BANDWIDTH', '--interval={interval};--fields=Total_Util');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('perf', 'PERF', 'STAT', '--interval={interval};--fields=IPC --fields=CACHE-MISS-RATIO --fields=MPKI --fields=ITLB-LOAD-MISS-RATIO --fields=DTLB-LOAD-MISS-RATIO --fields=SBPI --fields=SBPC');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('vmstat', 'MEM', 'VMSTAT', '--interval={interval};--fields=procs.b --fields=memory.swpd --fields=io.bo --fields=system.in --fields=system.cs --fields=util.swap --fields=util.cpu --fields=procs.r');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('sys.task', 'SYS', 'TASKS', '--interval={interval};--fields=procs --fields=cswchs');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('sys.ldavg', 'SYS', 'LDAVG', '--interval={interval};--fields=runq-sz --fields=plist-sz --fields=ldavg-1 --fields=ldavg-5');
+INSERT INTO collection(name, module, purpose, metrics) VALUES('file.util', 'SYS', 'FDUTIL', '--interval={interval};--fields=fd-util');
-- Dynamic_tuned table
-INSERT INTO rule_tuned(name, class, expression, action, opposite_action, monitor, field) VALUES("hpre", "webserver", "object in ('libssl', 'libcrypto')", "openssl_hpre=1", "openssl_hpre=0","PERF.TOP", ";--fields=overhead --fields=object --fields=symbol --addr-merge=0x3f");
+INSERT INTO rule_tuned(name, class, expression, action, opposite_action, monitor, field) VALUES('hpre', 'webserver', 'object in (''libssl'', ''libcrypto'')', 'openssl_hpre=1', 'openssl_hpre=0','PERF.TOP', ';--fields=overhead --fields=object --fields=symbol --addr-merge=0x3f');
-- AI search table
--- INSERT INTO tuned (class, name, type, value, range) VALUES("single_computer_intensive_jobs", "prefetech", "ENUM", "off", "on,off" );
+-- INSERT INTO tuned (class, name, type, value, range) VALUES('single_computer_intensive_jobs', 'prefetech', 'ENUM', 'off', 'on,off' );
-- Schedule table
-INSERT INTO schedule (type, strategy) VALUES("all", "auto");
+INSERT INTO schedule (type, strategy) VALUES('all', 'auto');
--
2.33.0

View File

@ -1,185 +0,0 @@
From d14414365e8fa9590e46b63a29754fb29f81778c Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Wed, 16 Feb 2022 14:41:47 +0800
Subject: [PATCH] add FAQ and self signature certificate manufacturing
---
Documentation/UserGuide/A-Tune-User-Guide.md | 70 ++++++++++++++++++
...50\346\210\267\346\214\207\345\215\227.md" | 72 +++++++++++++++++++
2 files changed, 142 insertions(+)
diff --git a/Documentation/UserGuide/A-Tune-User-Guide.md b/Documentation/UserGuide/A-Tune-User-Guide.md
index cd99cd4..cbb9d66 100644
--- a/Documentation/UserGuide/A-Tune-User-Guide.md
+++ b/Documentation/UserGuide/A-Tune-User-Guide.md
@@ -1235,6 +1235,12 @@ Perform tuning.
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
```
+**Q4: The atuned or atune-engine service cannot be started, and the message "Startup failed. Please provide the authentication certificate." is displayed.**
+
+**Cause:** Missing the certificate file during communication. The default communication protocol of REST APIs in the atuned or atune-engine service is HTTPS.
+
+**Solution:** Providing the certificate file issued by the authority and saving it to the corresponding configuration directory. The default certificate directory of the atuned service is /etc/atuned/rest_certs/, and the default certificate directory of the atune-engine service is /etc/atuned/engine_certs/. You can also change the default certificate directory and certificate file name in the atuned.cnf and engine.cnf files under the /etc/atuned/ directory. For the development and commissioning environment, you can also make self-service signature certificate by following section 5.2.
+
# 5 Appendixes
@@ -1248,3 +1254,67 @@ Perform tuning.
| profile | Set of optimization items and optimal parameter configuration. |
+## 5.2 Self-signature Certificate Manufacturing Method
+
+### 5.2.1 Creating a Certificate Directory
+
+```shell
+CERT_PATH=demo
+mkdir $CERT_PATH
+```
+
+### 5.2.2 Generating the RSA Key Pair for the CA
+
+```shell
+openssl genrsa -out $CERT_PATH/ca.key 2048
+```
+
+### 5.2.3 Generating the CA Root Certificate
+
+```shell
+openssl req -new -x509 -days 3650 -subj "/CN=ca" -key $CERT_PATH/ca.key -out $CERT_PATH/ca.crt
+```
+
+### 5.2.4 Generating the Server Certificate
+
+```shell
+# The IP address can be changed according to the actual situation.
+IP_ADDR=localhost
+openssl genrsa -out $CERT_PATH/server.key 2048
+cp /etc/pki/tls/openssl.cnf $CERT_PATH
+if test $IP_ADDR == localhost; then
+ echo "[SAN]\nsubjectAltName=DNS:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=DNS:$IP_ADDR" > $CERT_PATH/extfile.cnf
+else
+ echo "[SAN]\nsubjectAltName=IP:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=IP:$IP_ADDR" > $CERT_PATH/extfile.cnf
+fi
+openssl req -new -subj "/CN=$IP_ADDR" -config $CERT_PATH/openssl.cnf \
+ -key $CERT_PATH/server.key -out $CERT_PATH/server.csr
+openssl x509 -req -sha256 -CA $CERT_PATH/ca.crt -CAkey $CERT_PATH/ca.key -CAcreateserial -days 3650 \
+ -extfile $CERT_PATH/extfile.cnf -in $CERT_PATH/server.csr -out $CERT_PATH/server.crt
+rm -rf $CERT_PATH/*.srl $CERT_PATH/*.csr $CERT_PATH/*.cnf
+```
+
+### 5.2.5 Generating the Client Certificate
+
+```shell
+# The IP address can be changed according to the actual situation.
+IP_ADDR=localhost
+openssl genrsa -out $CERT_PATH/client.key 2048
+cp /etc/pki/tls/openssl.cnf $CERT_PATH
+if test $IP_ADDR == localhost; then
+ echo "[SAN]\nsubjectAltName=DNS:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=DNS:$IP_ADDR" > $CERT_PATH/extfile.cnf
+else
+ echo "[SAN]\nsubjectAltName=IP:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=IP:$IP_ADDR" > $CERT_PATH/extfile.cnf
+fi
+openssl req -new -subj "/CN=$IP_ADDR" -config $CERT_PATH/openssl.cnf \
+ -key $CERT_PATH/client.key -out $CERT_PATH/client.csr
+openssl x509 -req -sha256 -CA $CERT_PATH/ca.crt -CAkey $CERT_PATH/ca.key -CAcreateserial -days 3650 \
+ -extfile $CERT_PATH/extfile.cnf -in $CERT_PATH/client.csr -out $CERT_PATH/client.crt
+rm -rf $CERT_PATH/*.srl $CERT_PATH/*.csr $CERT_PATH/*.cnf
+```
+
+
diff --git "a/Documentation/UserGuide/A-Tune\347\224\250\346\210\267\346\214\207\345\215\227.md" "b/Documentation/UserGuide/A-Tune\347\224\250\346\210\267\346\214\207\345\215\227.md"
index 59b25e0..064708c 100644
--- "a/Documentation/UserGuide/A-Tune\347\224\250\346\210\267\346\214\207\345\215\227.md"
+++ "b/Documentation/UserGuide/A-Tune\347\224\250\346\210\267\346\214\207\345\215\227.md"
@@ -1247,6 +1247,15 @@ evaluations :
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
```
+**问题4atuned或atune-engine服务无法启动提示“Startup failed. Please provide the authentication certificate.”。**
+
+**原因:** atuned或atune-engine服务中的REST API默认通信协议为https通信中缺少证书文件
+
+**解决方法:** 用户提供权威机构签发的证书文件并放入对应的配置目录下其中atuned服务的默认证书>目录为/etc/atuned/rest_certs/atune-engine服务的默认证书目录为/etc/atuned/engine_certs/,也可
+以通过/etc/atuned/目录下的atuned.cnf和engine.cnf配置文件修改默认证书目录和证书文件名。对于开发
+调试环境也可以通过5.2节方法制作的自签名证书进行服务通信。
+
+
# 5 附录
## 5.1 术语和缩略语
@@ -1258,3 +1267,66 @@ evaluations :
| profile | 优化项集合,最佳的参数配置 |
+## 5.2 自签名证书制作方法
+
+### 5.2.1 证书目录创建
+
+```shell
+CERT_PATH=demo
+mkdir $CERT_PATH
+```
+
+### 5.2.2 生成CA的RSA密钥对
+
+```shell
+openssl genrsa -out $CERT_PATH/ca.key 2048
+```
+
+### 5.2.3 生成CA根证书
+
+```shell
+openssl req -new -x509 -days 3650 -subj "/CN=ca" -key $CERT_PATH/ca.key -out $CERT_PATH/ca.crt
+```
+
+### 5.2.4 生成服务器证书
+
+```shell
+# ip地址可以根据实际情况修改
+IP_ADDR=localhost
+openssl genrsa -out $CERT_PATH/server.key 2048
+cp /etc/pki/tls/openssl.cnf $CERT_PATH
+if test $IP_ADDR == localhost; then
+ echo "[SAN]\nsubjectAltName=DNS:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=DNS:$IP_ADDR" > $CERT_PATH/extfile.cnf
+else
+ echo "[SAN]\nsubjectAltName=IP:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=IP:$IP_ADDR" > $CERT_PATH/extfile.cnf
+fi
+openssl req -new -subj "/CN=$IP_ADDR" -config $CERT_PATH/openssl.cnf \
+ -key $CERT_PATH/server.key -out $CERT_PATH/server.csr
+openssl x509 -req -sha256 -CA $CERT_PATH/ca.crt -CAkey $CERT_PATH/ca.key -CAcreateserial -days 3650 \
+ -extfile $CERT_PATH/extfile.cnf -in $CERT_PATH/server.csr -out $CERT_PATH/server.crt
+rm -rf $CERT_PATH/*.srl $CERT_PATH/*.csr $CERT_PATH/*.cnf
+```
+
+### 5.2.5 生成客户端证书
+
+```shell
+# ip地址可以根据实际情况修改
+IP_ADDR=localhost
+openssl genrsa -out $CERT_PATH/client.key 2048
+cp /etc/pki/tls/openssl.cnf $CERT_PATH
+if test $IP_ADDR == localhost; then
+ echo "[SAN]\nsubjectAltName=DNS:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=DNS:$IP_ADDR" > $CERT_PATH/extfile.cnf
+else
+ echo "[SAN]\nsubjectAltName=IP:$IP_ADDR" >> $CERT_PATH/openssl.cnf
+ echo "subjectAltName=IP:$IP_ADDR" > $CERT_PATH/extfile.cnf
+fi
+openssl req -new -subj "/CN=$IP_ADDR" -config $CERT_PATH/openssl.cnf \
+ -key $CERT_PATH/client.key -out $CERT_PATH/client.csr
+openssl x509 -req -sha256 -CA $CERT_PATH/ca.crt -CAkey $CERT_PATH/ca.key -CAcreateserial -days 3650 \
+ -extfile $CERT_PATH/extfile.cnf -in $CERT_PATH/client.csr -out $CERT_PATH/client.crt
+rm -rf $CERT_PATH/*.srl $CERT_PATH/*.csr $CERT_PATH/*.cnf
+```
+
--
2.30.0

View File

@ -0,0 +1,37 @@
From 769eb65a6849b6663885fff1ab8dafbc1b3c92dd Mon Sep 17 00:00:00 2001
From: root <zhoupengcheng11@huawei.com>
Date: Sun, 25 Feb 2024 14:59:21 +0800
Subject: [PATCH] Adjust the startup sequence of atune-rest
---
misc/atune-rest.service | 2 +-
misc/atuned.service | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/misc/atune-rest.service b/misc/atune-rest.service
index 3cf0794..7774683 100644
--- a/misc/atune-rest.service
+++ b/misc/atune-rest.service
@@ -1,6 +1,6 @@
[Unit]
Description=A-Tune AI service
-After=network.target
+After=network.target atuned.service
Requires=polkit.service
[Service]
diff --git a/misc/atuned.service b/misc/atuned.service
index 58fb022..1677d30 100644
--- a/misc/atuned.service
+++ b/misc/atuned.service
@@ -1,6 +1,6 @@
[Unit]
Description=A-Tune Daemon
-After=systemd-sysctl.service network.target atune-rest.service
+After=systemd-sysctl.service network.target
Requires=polkit.service
[Service]
--
2.27.0

View File

@ -2,33 +2,28 @@
Summary: AI auto tuning system
Name: atune
Version: 1.0.0
Release: 16
Version: 1.2.0
Release: 5
License: MulanPSL-2.0
URL: https://gitee.com/openeuler/A-Tune
Source: https://gitee.com/openeuler/A-Tune/repository/archive/v%{version}.tar.gz
Patch9000: check-whether-the-certificate-file-exists.patch
Patch9001: add-FAQ-and-self-signature-certificate-manufacturing.patch
Patch9002: change-Makefile-A-Tune-version-to-1.0.0.patch
Patch9003: fix-start-failed-of-atuned-service.patch
Patch9004: A-Tune-Add-sw64-architecture.patch
Patch9005: add-riscv64-support.patch
Patch9006: 0001-bugfix-transfer-can-only-save-file-to-specified-dir.patch
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: 0001-define-fix-privilege-escalation.patch
Patch9012: 0002-define-fix-privilege-escalation.patch
Patch9013: fix-collection-train-file-overwriting-through-soft-links.patch
Patch9000: A-Tune-Add-sw64-architecture.patch
Patch9001: add-riscv64-support.patch
Patch9002: remove-the-installation-of-atune-ui-related-files.patch
Patch9003: adjust-the-startup-sequence-of-atune-rest.patch
Patch9004: import-os-for-app.py.patch
Patch9005: adapt-sqlite-3.42-to-resolve-the-build-failure.patch
Patch9006: 0001-fix-skopt.Optimizer-incompatible-with-numpy-1.24.patch
Patch9007: 0002-scikit-learn-1.2-rename-the-parameter-base_estimator.patch
Patch9008: 0003-fix-atune-adm-analyse-failed-problem.patch
BuildRequires: rpm-build golang-bin procps-ng
BuildRequires: sqlite >= 3.24.0 openssl
BuildRequires: python3-scikit-optimize python3-pandas python3-xgboost
BuildRequires: python3-pyyaml
BuildRequires: systemd
BuildRequires: perf
Requires: systemd
Requires: atune-client = %{version}-%{release}
Requires: atune-db = %{version}-%{release}
@ -44,7 +39,7 @@ Requires: sysstat
Requires: hwloc-gui
Requires: psmisc
Requires: atune-collector
Requires: atune-rest
%define debug_package %{nil}
@ -73,31 +68,34 @@ Requires: python3-xgboost
Requires: python3-flask-restful
Requires: python3-pandas
Requires: python3-lhsmdu
Conflicts: atune < 0.3-0.9
Conflicts: atune < 1.1.0
%description engine
atune engine tool for manage atuned AI tuning system.
%package rest
Summary: restful api for communication between atuned and atune-engine
License: MuLan PSL v2
Conflicts: atune < 1.1.0
%description rest
atune restful api for manage atuned AI tuning system.
%prep
%setup -n A-Tune-v%{version}
%patch9000 -p1
%patch9001 -p1
%patch9002 -p1
%patch9003 -p1
%ifarch sw_64
%patch9004 -p1
%patch9000 -p1
%endif
%ifarch riscv64
%patch9005 -p1
%patch9001 -p1
%endif
%patch9002 -p1
%patch9003 -p1
%patch9004 -p1
%patch9005 -p1
%patch9006 -p1
%patch9007 -p1
%patch9008 -p1
%patch9009 -p1
%patch9010 -p1
%patch9011 -p1
%patch9012 -p1
%patch9013 -p1
%build
%make_build
@ -125,24 +123,26 @@ atune engine tool for manage atuned AI tuning system.
%postun engine
%systemd_postun_with_restart atune-engine.service
%post rest
%systemd_post atune-rest.service
%preun rest
%systemd_preun atune-rest.service
%postun rest
%systemd_postun_with_restart atune-rest.service
%files
%license License/LICENSE
%defattr(0640,root,root,0750)
%attr(0550,root,root) /usr/lib/atuned/modules/daemon_profile_server.so
%attr(0640,root,root) %{_unitdir}/atuned.service
%attr(0550,root,root) %{_bindir}/atuned
%attr(0550,root,root) /usr/libexec/atuned/analysis/*
/usr/lib/atuned/profiles/*
%exclude /usr/libexec/atuned/analysis/app_engine.py
%exclude /usr/libexec/atuned/analysis/models/
%exclude /usr/libexec/atuned/analysis/optimizer/
%exclude /usr/libexec/atuned/analysis/engine/
%exclude /usr/libexec/atuned/analysis/dataset/
%attr(0750,root,root) %dir /usr/lib/atuned
%attr(0550,root,root) %dir /usr/lib/atuned/modules
%attr(0750,root,root) %dir /usr/lib/atuned/profiles
%attr(0750,root,root) %dir /usr/libexec/atuned
%attr(0550,root,root) %dir /usr/libexec/atuned/analysis
%attr(0750,root,root) %dir /usr/share/atuned
%attr(0750,root,root) %dir /etc/atuned
%attr(0750,root,root) %dir /etc/atuned/rules
@ -154,6 +154,15 @@ atune engine tool for manage atuned AI tuning system.
%exclude /etc/atuned/engine_certs/*
%exclude /etc/atuned/rest_certs/*
%files rest
%attr(0550,root,root) %dir /usr/libexec/atuned/analysis
%attr(0550,root,root) /usr/libexec/atuned/analysis/*
%exclude /usr/libexec/atuned/analysis/app_engine.py
%exclude /usr/libexec/atuned/analysis/models/
%exclude /usr/libexec/atuned/analysis/optimizer/
%exclude /usr/libexec/atuned/analysis/engine/
%exclude /usr/libexec/atuned/analysis/dataset/
%attr(0640,root,root) %{_unitdir}/atune-rest.service
%files client
%attr(0550,root,root) %{_bindir}/atune-adm
@ -187,6 +196,21 @@ atune engine tool for manage atuned AI tuning system.
%exclude /etc/atuned/rest_certs
%changelog
* Mon Apr 21 2025 caixiaomeng <caixiaomeng2@huawei.com> - 1.2.0-5
- fix atune-adm analyse failed problem
* Thu Mar 20 2025 dongjiao <dongjiao@kylinos.cn> - 1.2.0-4
- fix bug cause scikit-learn-1.2 rename the parameter 'base_estimator' to 'estimator'.
* Mon Jul 29 2024 dongjiao <dongjiao@kylinos.cn> - 1.2.0-3
- fix skopt.Optimizer incompatible with numpy-1.24
* Mon Mar 11 2024 zhoupengcheng <zhoupengcheng11@huawei.com> - 1.2.0-2
- add import and fix build failure
* Tue Feb 6 2024 zhoupengcheng <zhoupengcheng11@huawei.com> - 1.2.0-1
- update atune-v1.2.0
* Wed Nov 8 2023 zhoupengcheng <zhoupengcheng11@huawei.com> - 1.0.0-16
- fix-collection-train-file-overwriting-through-soft-links

View File

@ -1,23 +0,0 @@
From 5b8ec9d923096e0ad6302e27d21d4de40087dfce Mon Sep 17 00:00:00 2001
From: hubin73 <hubin73@huawei.com>
Date: Thu, 3 Mar 2022 20:41:08 +0800
Subject: [PATCH] change Makefile A-Tune version to 1.0.0
Signed-off-by: hubin73 <hubin73@huawei.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 8e43062..715f698 100755
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-VERSION = 0.3
+VERSION = 1.0.0
.PHONY: all clean modules
PKGPATH=pkg
--
2.27.0

View File

@ -1,34 +0,0 @@
From 8d7596125161bea13641644fca2384411e00a4e5 Mon Sep 17 00:00:00 2001
From: gaoruoshu <gaoruoshu@huawei.com>
Date: Tue, 15 Feb 2022 17:03:40 +0800
Subject: [PATCH] check whether the certificate file exists
---
analysis/app.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/analysis/app.py b/analysis/app.py
index 31b5f51..b25e784 100644
--- a/analysis/app.py
+++ b/analysis/app.py
@@ -22,6 +22,8 @@ from logging.handlers import SysLogHandler
from flask import Flask
from flask_restful import Api
+LOGGER = logging.getLogger(__name__)
+
class App:
"""flask application"""
@@ -51,6 +51,9 @@ class App:
def startup_app(self, host, port, tls, cert_file, key_file, ca_file, log_level):
"""start flask app"""
+ if not os.path.exists(cert_file) or not os.path.exists(key_file) or not os.path.exists(ca_file):
+ LOGGER.error("Startup failed. Please provide the authentication certificate.")
+ raise FileNotFoundError("Startup failed. Please provide the authentication certificate.")
level = logging.getLevelName(log_level.upper())
self.config_log(level)
self.add_resource()
--
2.30.0

View File

@ -1,57 +0,0 @@
From c5e491e5dffab4dda814f2e1ba11c21714cac0c6 Mon Sep 17 00:00:00 2001
From: zhoupengcheng <zhoupengcheng11@huawei.com>
Date: Wed, 1 Nov 2023 11:14:37 +0800
Subject: [PATCH] fix-collection-train-file-overwriting-through-soft-links.patch
---
analysis/atuned/collector.py | 10 +++++++++-
analysis/engine/train.py | 4 +++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/analysis/atuned/collector.py b/analysis/atuned/collector.py
index 4749284..9a264dd 100755
--- a/analysis/atuned/collector.py
+++ b/analysis/atuned/collector.py
@@ -39,6 +39,15 @@ class Collector(Resource):
args = COLLECTOR_POST_PARSER.parse_args()
current_app.logger.info(args)
n_pipe = get_npipe(args.get("pipe"))
+
+ path = args.get("file")
+ path = os.path.abspath(path)
+ if not path.startswith("/var/atune_data/collection/"):
+ return "Files outside the /var/atune_data/collection/ directory cannot be modified.", 400
+
+ if os.path.exists(path):
+ return "File already exists!", 400
+
monitors = []
mpis = []
field_name = []
@@ -91,7 +100,6 @@ class Collector(Resource):
if n_pipe is not None:
n_pipe.close()
- path = args.get("file")
save_file(path, data, field_name)
result = {}
result["path"] = path
diff --git a/analysis/engine/train.py b/analysis/engine/train.py
index 7608660..462b16c 100644
--- a/analysis/engine/train.py
+++ b/analysis/engine/train.py
@@ -49,8 +49,10 @@ class Training(Resource):
return "Illegal model name provide: {}".format(err), 400
characterization = WorkloadCharacterization(model_path)
+ output_path = TRAINING_MODEL_PATH + model_name
+ if os.path.exists(output_path):
+ return "File already exists!", 400
try:
- output_path = TRAINING_MODEL_PATH + model_name
characterization.retrain(data_path, output_path)
except Exception as err:
LOGGER.error(err)
--
2.33.0

View File

@ -1,34 +0,0 @@
From 945560933e7e118b9113f152a5f133e1ff0af183 Mon Sep 17 00:00:00 2001
From: g00563147 <gaoruoshu@huawei.com>
Date: Thu, 3 Mar 2022 16:52:04 +0800
Subject: [PATCH] fix start failed of atuned service
---
analysis/app.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/analysis/app.py b/analysis/app.py
index e82e2b2..3a0c248 100644
--- a/analysis/app.py
+++ b/analysis/app.py
@@ -53,14 +53,14 @@ class App:
def startup_app(self, host, port, tls, cert_file, key_file, ca_file, log_level):
"""start flask app"""
- if not os.path.exists(cert_file) or not os.path.exists(key_file) or not os.path.exists(ca_file):
- LOGGER.error("Startup failed. Please provide the authentication certificate.")
- raise FileNotFoundError("Startup failed. Please provide the authentication certificate.")
level = logging.getLevelName(log_level.upper())
self.config_log(level)
self.add_resource()
context = None
if tls:
+ if not os.path.exists(cert_file) or not os.path.exists(key_file) or not os.path.exists(ca_file):
+ LOGGER.error("Startup failed. Please provide the authentication certificate.")
+ raise FileNotFoundError("Startup failed. Please provide the authentication certificate.")
context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
context.load_cert_chain(certfile=cert_file, keyfile=key_file)
context.load_verify_locations(ca_file)
--
1.8.3.1

View File

@ -0,0 +1,24 @@
From a5c7aac7035df2448170bcd7a1beab8cbfcde761 Mon Sep 17 00:00:00 2001
From: zhoupengcheng <zhoupengcheng11@huawei.com>
Date: Thu, 7 Mar 2024 20:07:47 +0800
Subject: [PATCH] import os for app.py
---
analysis/app.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/analysis/app.py b/analysis/app.py
index 1a4ebf6..3a0c248 100644
--- a/analysis/app.py
+++ b/analysis/app.py
@@ -14,6 +14,7 @@
"""
Flask application initialization, including log configuration, restful api registration.
"""
+import os
import ssl
import logging
from logging.handlers import SysLogHandler
--
2.33.0

View File

@ -0,0 +1,45 @@
From 33dc1c15e65c0212635a5063a95206376e97e2bc Mon Sep 17 00:00:00 2001
From: root <zhoupengcheng11@huawei.com>
Date: Wed, 7 Feb 2024 10:53:14 +0800
Subject: [PATCH] remove-the-installation-of-atune-ui-related-files
---
Makefile | 4 ----
1 file changed, 4 deletions(-)
diff --git a/Makefile b/Makefile
index 4c70a9f..cb1d16c 100755
--- a/Makefile
+++ b/Makefile
@@ -28,7 +28,6 @@ abs-python:
@if [ $(PYDIR) ] ; then \
sed -i "s?ExecStart=.*python3?ExecStart=$(PYDIR)?g" $(CURDIR)/misc/atune-engine.service; \
sed -i "s?ExecStart=.*python3?ExecStart=$(PYDIR)?g" $(CURDIR)/misc/atune-rest.service; \
- sed -i "s?ExecStart=.*python3?ExecStart=$(PYDIR)?g" $(CURDIR)/misc/atune-ui.service; \
else \
echo "no python3 exists."; \
fi
@@ -99,12 +98,10 @@ libinstall:
install -m 640 misc/atuned.service $(SYSTEMDDIR)
install -m 640 misc/atuned.cnf $(DESTDIR)/etc/atuned/
install -m 640 misc/engine.cnf $(DESTDIR)/etc/atuned/
- install -m 640 misc/ui.cnf $(DESTDIR)/etc/atuned/
install -m 640 rules/tuning/tuning_rules.grl $(DESTDIR)/etc/atuned/rules
install -m 640 misc/atune-engine.service $(SYSTEMDDIR)
install -m 640 database/atuned.db $(DESTDIR)/var/lib/atuned/
install -m 640 misc/atune-adm $(DESTDIR)$(PREFIX)/share/bash-completion/completions/
- install -m 640 misc/atune-ui.service $(SYSTEMDDIR)
\cp -rf analysis/* $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/analysis/
chmod -R 750 $(DESTDIR)$(PREFIX)/$(LIBEXEC)/atuned/analysis/
\cp -rf profiles/* $(DESTDIR)$(PREFIX)/lib/atuned/profiles/
@@ -202,7 +199,6 @@ startup:
systemctl restart atune-rest
systemctl restart atuned
systemctl restart atune-engine
- systemctl restart atune-ui
yaml-generator:
\cp -rf tuning/yamls/* $(DESTDIR)/etc/atuned/tuning
--
2.27.0

Binary file not shown.