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

时区配置

时区的变更将应用于所有产品,部分应用和功能暂不支持语言和时区变更。了解详情

配置参数

配置项类型示例描述
enable_timezonebooleantrue是否开启时区

操作步骤

ONES 配置开启时区

修改配置

进入运行中的 ones 容器

ones-ai-k8s.sh

修改配置

vim config/private.yaml

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

应用配置

make setup-ones

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

bash-5.0# make setup-ones
python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1 --ones-path=
2023-11-21 09:24:02,892 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-11-21 09:24:03,415 [INFO] render config
2023-11-21 09:24:07,920 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-11-21 09:24:07,920 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-11-21 09:24:07,920 [INFO] compatible overlay
2023-11-21 09:24:07,946 [INFO] collect dir info
2023-11-21 09:24:07,969 [INFO] setup global resrouces
2023-11-21 09:24:08,229 [INFO] gen registry credentials
2023-11-21 09:24:08,233 [INFO] setup namespace, registry-secret
2023-11-21 09:24:08,547 [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
run cmd: kubectl -n ones delete deployment localstorage-ones-cn-server-node01
deployment.apps/localstorage-ones-cn-server-node01 created
serviceaccount/localstorage-manager unchanged
role.rbac.authorization.k8s.io/localstorage-manager unchanged
rolebinding.rbac.authorization.k8s.io/localstorage-manager unchanged
storageclass.storage.k8s.io/ones-local-storage unchanged
storageclass.storage.k8s.io/ones-local-storage-mock unchanged
2023-11-21 09:24:13,532 [INFO] diff ones before setup
2023-11-21 09:24:17,505 [INFO] backward compatible
2023-11-21 09:24:19,261 [INFO] setup ones
2023-11-21 09:24:22,581 [INFO] record latest data
render to tmp/latest-record-setup-app-comfigmap.yaml
render to tmp/date-record-setup-app-comfigmap.yaml
2023-11-21 09:24:28,893 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-11-21 09:24:28,982 [INFO] built-in mysql exists, skip
2023-11-21 09:24:29,093 [INFO] built-in rabbitmq exists, skip
2023-11-21 09:24:29,093 [INFO] setup ones finish
2023-11-21 09:24:29,093 [INFO] elapsed time: 26.201 seconds

验证

重启完成并稍等几分钟后,登录 ONES 系统,进入 「个人中心」-> 「语言和时区」页面,能够正常设置时区则正常。 注意: 需要强制刷新页面。

ONES 配置关闭时区

修改配置

进入运行中的 ones 容器

ones-ai-k8s.sh

修改配置

vim config/private.yaml

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

应用配置

make setup-ones

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

python3 ./script/python/ones/cmd/setupapp.py --app=ones --version=v1  --ones-path=
2023-07-19 08:41:22,266 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-19 08:41:22,330 [INFO] render config
2023-07-19 08:41:22,330 [INFO] merge configs
2023-07-19 08:41:26,590 [WARNING] /data/ones/ones-ai-k8s/private-overlay-templates/ones/v1 not found, skip
2023-07-19 08:41:26,590 [INFO] ones_path=, k8s_root_dir=/data/ones/ones-ai-k8s
2023-07-19 08:41:26,658 [INFO] compatible overlay
2023-07-19 08:41:27,755 [INFO] collect dir info
2023-07-19 08:41:27,780 [INFO] setup global resrouces
2023-07-19 08:41:28,034 [INFO] gen registry credentials
2023-07-19 08:41:28,038 [INFO] setup namespace, registry-secret
2023-07-19 08:41:28,353 [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-19 08:41:32,602 [INFO] backward compatible
2023-07-19 08:41:32,737 [INFO] diff ones before setup
2023-07-19 08:41:37,594 [INFO] setup ones
2023-07-19 08:41:40,430 [INFO] record latest data
render to tmp/latest-record-setup-app-comfigmap.yaml
render to tmp/date-record-setup-app-comfigmap.yaml
2023-07-19 08:41:45,560 [INFO] remove /data/ones/ones-ai-k8s/tmp
2023-07-19 08:41:45,565 [INFO] setup ones finish
2023-07-19 08:41:45,566 [INFO] elapsed time: 23.236 seconds

验证

重启完成并稍等几分钟后,登录 ONES 系统,进入 「个人中心」-> 「语言和时区」页面,设置时区页面消失。 注意: 需要强制刷新页面。