跳到主要内容
版本:v3&v6

开启/关闭 Performance

控制效能管理模块的开启/关闭

配置参数

配置项类型示例描述
enablePerformanceV2booleantrue是否开启旧版本performance(v3.13及v3.13之前的版本)
enablePerformanceProbooleantrue是否开启新版本performance(v3.13之后的版本)

开启 Performance 组件 且 ONES 版本 大于 v3.13 时,enablePerformanceV2 和 enablePerformancePro 都需要设置为 true

操作步骤

ONES 配置 开启 Performance

修改配置

进入运行中的 ones 容器

ones-ai-k8s.sh

修改配置

vim config/private.yaml

如果打开的文件中有名为 enablePerformanceV2,则只需将它的值改为 true。如果不存在名为 enablePerformanceV2 的 key 则需要在最后一行写入 enablePerformanceV2: true

如果打开的文件中有名为 enablePerformancePro,则只需将它的值改为 true。如果不存在名为 enablePerformancePro 的 key 则需要在最后一行写入 enablePerformancePro: true

修改后保存并退出

应用配置

make setup-ones

当观察到如下输出则说明执行成功

bash-5.0# make setup-ones
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-07-20 09:45:42,758 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-20 09:45:42,845 [INFO] render config
2023-07-20 09:45:42,845 [INFO] merge configs
2023-07-20 09:45:47,045 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-20 09:45:47,045 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-20 09:45:47,108 [INFO] compatible overlay
2023-07-20 09:45:48,201 [INFO] collect dir info
2023-07-20 09:45:48,225 [INFO] setup global resrouces
2023-07-20 09:45:48,487 [INFO] gen registry credentials
2023-07-20 09:45:48,491 [INFO] setup namespace, registry-secret
2023-07-20 09:45:48,839 [INFO] setup local-storage static-pvc, static-pv (cache config to tmp/config.yaml)
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
deployment.apps/localstorage-ones-cn-server-node03 unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-07-20 09:45:53,113 [INFO] backward compatible
2023-07-20 09:45:53,259 [INFO] diff ones before setup
2023-07-20 09:45:58,140 [INFO] setup ones
2023-07-20 09:46:01,029 [INFO] record latest data
2023-07-20 09:46:02,976 [INFO] latest_hash == current_hash, skip
2023-07-20 09:46:02,976 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-20 09:46:02,980 [INFO] setup ones finish
2023-07-20 09:46:02,980 [INFO] elapsed time: 20.135 seconds

验证

查看 pod 是否启动

kubectl -n ones get pods | grep performance

当观察到如下输出则说明 performance 启动成功

bash-5.0# kubectl -n ones get pods | grep performance
performance-api-deployment-57478d6bc8-blkfh 1/1 Running 0 55m

同时 ones 系统中的 performance 组件可以正常使用

ONES 配置 关闭 Performance

修改配置

进入运行中的 ones 容器

ones-ai-k8s.sh

修改配置

vim config/private.yaml

如果打开的文件中有名为 enablePerformanceV2,则只需将它的值改为 false。如果不存在名为 enablePerformanceV2 的 key 则需要在最后一行写入 enablePerformanceV2: false 如果打开的文件中有名为 enablePerformancePro,则只需将它的值改为 false。如果不存在名为 enablePerformancePro 的 key 则需要在最后一行写入 enablePerformancePro: false

修改后保存并退出

应用配置

make setup-ones

当观察到如下输出则说明执行成功

bash-5.0# make setup-ones
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-07-20 09:53:57,867 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-20 09:53:57,934 [INFO] render config
2023-07-20 09:53:57,935 [INFO] merge configs
2023-07-20 09:54:01,955 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-20 09:54:01,955 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-20 09:54:02,022 [INFO] compatible overlay
2023-07-20 09:54:03,095 [INFO] collect dir info
2023-07-20 09:54:03,118 [INFO] setup global resrouces
2023-07-20 09:54:03,380 [INFO] gen registry credentials
2023-07-20 09:54:03,384 [INFO] setup namespace, registry-secret
2023-07-20 09:54:03,703 [INFO] setup local-storage static-pvc, static-pv (cache config to tmp/config.yaml)
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
deployment.apps/localstorage-ones-cn-server-node03 unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-07-20 09:54:08,046 [INFO] backward compatible
2023-07-20 09:54:08,185 [INFO] diff ones before setup
2023-07-20 09:54:13,019 [INFO] setup ones
2023-07-20 09:54:15,960 [INFO] record latest data
render to tmp/latest-record-setup-app-comfigmap.yaml
render to tmp/date-record-setup-app-comfigmap.yaml
2023-07-20 09:54:21,127 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-20 09:54:21,132 [INFO] setup ones finish
2023-07-20 09:54:21,132 [INFO] elapsed time: 23.197 seconds

验证

查看 pod 是否关闭

kubectl -n ones get pods | grep performance

如果没有任何输出则说明 performance 关闭成功

同时 ones 系统中的 performance 组件不可以使用