Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
obdeploy
提交
97ce6598
O
obdeploy
项目概览
oceanbase
/
obdeploy
1 年多 前同步成功
通知
7
Star
73
Fork
132
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
obdeploy
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
未验证
提交
97ce6598
编写于
4月 24, 2023
作者:
R
Rongfeng Fu
提交者:
GitHub
4月 24, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
V2.0.1 (#167)
* update .gitignore * V2.0.1
上级
db864e13
变更
14
展开全部
显示空白变更内容
内联
并排
Showing
14 changed file
with
11623 addition
and
54 deletion
+11623
-54
.gitignore
.gitignore
+1
-1
_stdio.py
_stdio.py
+1
-0
core.py
core.py
+6
-4
init.sh
init.sh
+4
-3
plugins/obproxy/3.1.0/bootstrap.py
plugins/obproxy/3.1.0/bootstrap.py
+1
-1
plugins/obproxy/3.1.0/start.py
plugins/obproxy/3.1.0/start.py
+7
-1
plugins/oceanbase/3.1.0/create_tenant.py
plugins/oceanbase/3.1.0/create_tenant.py
+2
-0
plugins/oceanbase/4.0.0.0/create_tenant.py
plugins/oceanbase/4.0.0.0/create_tenant.py
+2
-0
plugins/ocp-express/1.0/stop.py
plugins/ocp-express/1.0/stop.py
+1
-1
plugins/tpcc/4.0.0.0/run_test.py
plugins/tpcc/4.0.0.0/run_test.py
+5
-16
web/package.json
web/package.json
+23
-23
web/src/pages/components/CheckInfo.tsx
web/src/pages/components/CheckInfo.tsx
+2
-2
web/src/pages/components/ClusterConfig.tsx
web/src/pages/components/ClusterConfig.tsx
+2
-2
web/yarn.lock
web/yarn.lock
+11566
-0
未找到文件。
.gitignore
浏览文件 @
97ce6598
...
...
@@ -19,7 +19,7 @@ tags
/web/node_modules
/web/npm-debug.log*
/web/yarn-error.log
/web/yarn.lock
#
/web/yarn.lock
/web/package-lock.json
/web/.mfsu-dev
/web/.mfsu-prod
...
...
_stdio.py
浏览文件 @
97ce6598
...
...
@@ -305,6 +305,7 @@ class IOProgressBar(ProgressBar):
def
finish
(
self
):
if
self
.
finished
:
return
self
.
finished
=
True
self
.
update
(
self
.
maxval
)
self
.
_finish
()
...
...
core.py
浏览文件 @
97ce6598
...
...
@@ -2447,11 +2447,11 @@ class ObdHome(object):
if
not
pkg
:
self
.
_call_stdio
(
'error'
,
'No such package %s-%s-%s'
%
(
component
,
current_repository
.
version
,
usable
))
return
False
repositories
=
[]
install_plugins
=
self
.
get_install_plugin_and_install
(
repositories
,
[
pkg
])
repositories
_temp
=
[]
install_plugins
=
self
.
get_install_plugin_and_install
(
repositories
_temp
,
[
pkg
])
if
not
install_plugins
:
return
False
dest_repository
=
repositories
[
0
]
dest_repository
=
repositories
_temp
[
0
]
else
:
install_plugins
=
self
.
search_plugins
([
dest_repository
],
PluginType
.
INSTALL
)
...
...
@@ -2832,6 +2832,8 @@ class ObdHome(object):
@
staticmethod
def
_get_first_db_and_cursor_from_connect
(
namespace
):
if
not
namespace
:
return
None
,
None
connect_ret
=
namespace
.
get_return
(
'connect'
)
dbs
=
connect_ret
.
get_return
(
'connect'
)
cursors
=
connect_ret
.
get_return
(
'cursor'
)
...
...
@@ -3730,7 +3732,7 @@ class ObdHome(object):
kwargs
.
update
(
ret
.
kwargs
)
return
True
except
Exception
as
e
:
self
.
_call_stdio
(
'e
rror
'
,
e
)
self
.
_call_stdio
(
'e
xception
'
,
e
)
return
False
finally
:
if
optimization
and
optimization_inited
:
...
...
init.sh
浏览文件 @
97ce6598
...
...
@@ -67,14 +67,15 @@ done
echo
"============update .bashrc============"
ALIAS_OBD_EXIST
=
$(
cat
~/.bashrc |
grep
"alias obd="
|
head
-n
1
)
ALIAS_OBD_EXIST
=
$(
grep
"alias obd="
~/.bashrc
|
head
-n
1
)
if
[[
"
${
ALIAS_OBD_EXIST
}
"
!=
""
]]
;
then
echo
"need update obd alias"
fi
echo
"alias obd='python
${
WORK_DIR
}
/_cmd.py'"
>>
~/.bashrc
echo
-e
"if [ -d
${
WORK_DIR
}
]
\n
then
\n
source
${
WORK_DIR
}
/profile/obd.sh
\n
fi"
>>
~/.bashrc
echo
"export OBD_INSTALL_PATH=
${
WORK_DIR
}
"
>>
~/.bashrc
echo
"alias obd='python
${
WORK_DIR
}
/_cmd.py'"
>>
~/.bashrc
echo
-e
"if [ -d
${
WORK_DIR
}
]
\n
then
\n
source
${
WORK_DIR
}
/profile/obd.sh
\n
fi"
>>
~/.bashrc
echo
"Please enter ob-deploy dir and install python requirements by 'pip install -r requirements.txt' when your python version is '2.x' and replace requirements.txt with requirements3.txt when your python version is '3.x'"
...
...
plugins/obproxy/3.1.0/bootstrap.py
浏览文件 @
97ce6598
...
...
@@ -27,7 +27,7 @@ def bootstrap(plugin_context, cursor, *args, **kwargs):
global_ret
=
True
for
server
in
cluster_config
.
servers
:
server_config
=
cluster_config
.
get_server_conf
(
server
)
for
key
in
[
'observer_sys_password'
,
'obproxy_sys_password'
]:
for
key
in
[
'observer_sys_password'
]:
sql
=
'alter proxyconfig set %s = %%s'
%
key
value
=
server_config
.
get
(
key
,
''
)
value
=
''
if
value
is
None
else
str
(
value
)
...
...
plugins/obproxy/3.1.0/start.py
浏览文件 @
97ce6598
...
...
@@ -22,6 +22,7 @@ from __future__ import absolute_import, division, print_function
import
os
import
time
import
hashlib
from
copy
import
deepcopy
from
_errno
import
EC_CONFLICT_PORT
...
...
@@ -185,7 +186,12 @@ def start(plugin_context, need_bootstrap=False, *args, **kwargs):
]
start_unuse
=
[
'home_path'
,
'observer_sys_password'
,
'obproxy_sys_password'
,
'observer_root_password'
]
get_value
=
lambda
key
:
"'%s'"
%
server_config
[
key
]
if
isinstance
(
server_config
[
key
],
str
)
else
server_config
[
key
]
opt_str
=
[
"obproxy_sys_password=''"
]
if
need_bootstrap
else
[]
opt_str
=
[]
if
server_config
.
get
(
'obproxy_sys_password'
):
obproxy_sys_password
=
hashlib
.
sha1
(
server_config
[
'obproxy_sys_password'
].
encode
(
"utf-8"
)).
hexdigest
()
else
:
obproxy_sys_password
=
''
opt_str
.
append
(
"obproxy_sys_password='%s'"
%
obproxy_sys_password
)
for
key
in
server_config
:
if
key
not
in
start_unuse
and
key
not
in
not_opt_str
:
value
=
get_value
(
key
)
...
...
plugins/oceanbase/3.1.0/create_tenant.py
浏览文件 @
97ce6598
...
...
@@ -96,6 +96,8 @@ def create_tenant(plugin_context, cursor, create_tenant_options=None, *args, **
options
=
create_tenant_options
if
create_tenant_options
else
plugin_context
.
options
create_if_not_exists
=
get_option
(
'create_if_not_exists'
,
False
)
tenant_exists
=
False
global
tenant_cursor
tenant_cursor
=
None
mode
=
get_option
(
'mode'
,
'mysql'
).
lower
()
if
not
mode
in
[
'mysql'
,
'oracle'
]:
...
...
plugins/oceanbase/4.0.0.0/create_tenant.py
浏览文件 @
97ce6598
...
...
@@ -95,6 +95,8 @@ def create_tenant(plugin_context, cursor, create_tenant_options=None, *args, **k
stdio
=
plugin_context
.
stdio
options
=
create_tenant_options
if
create_tenant_options
else
plugin_context
.
options
create_if_not_exists
=
get_option
(
'create_if_not_exists'
,
False
)
global
tenant_cursor
tenant_cursor
=
None
mode
=
get_option
(
'mode'
,
'mysql'
).
lower
()
if
not
mode
in
[
'mysql'
,
'oracle'
]:
...
...
plugins/ocp-express/1.0/stop.py
浏览文件 @
97ce6598
...
...
@@ -93,7 +93,7 @@ def stop(plugin_context, *args, **kwargs):
data
[
key
]
=
''
else
:
client
.
execute_command
(
'rm -rf %s'
%
data
[
'path'
])
stdio
.
verbose
(
'%s ocp-
server
is stopped'
,
server
)
stdio
.
verbose
(
'%s ocp-
express
is stopped'
,
server
)
servers
=
tmp_servers
count
-=
1
if
count
and
servers
:
...
...
plugins/tpcc/4.0.0.0/run_test.py
浏览文件 @
97ce6598
...
...
@@ -147,13 +147,14 @@ def run_test(plugin_context, cursor, odp_cursor=None, *args, **kwargs):
with
open
(
seq_file
,
'w'
)
as
f
:
f
.
write
(
str
(
seq
))
log_path
=
os
.
path
.
join
(
run_path
,
'tpcc_out_{}_{}'
.
format
(
seq
,
datetime
.
datetime
.
now
().
strftime
(
'%Y%m%d%H%M%S'
)))
cmd
=
'
{java_bin} -cp {cp} -Dprop={prop} -DrunID={seq} jTPCC 2>&1 | tee {output}
'
.
format
(
cmd
=
'
bash -c "{java_bin} -cp {cp} -Dprop={prop} -DrunID={seq} jTPCC 2>&1 | tee {output} && ( exit ${{PIPESTATUS[0]}})"
'
.
format
(
java_bin
=
java_bin
,
run_path
=
run_path
,
cp
=
bmsql_classpath
,
prop
=
bmsql_prop_path
,
seq
=
seq
,
output
=
log_path
)
try
:
stdio
.
verbose
(
'local execute: %s'
%
cmd
)
subprocess
.
call
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
cwd
=
run_path
)
return_code
=
subprocess
.
call
(
cmd
,
shell
=
True
,
stderr
=
subprocess
.
STDOUT
,
cwd
=
run_path
)
stdio
.
verbose
(
'return code: {}'
.
format
(
return_code
))
with
open
(
log_path
,
'r'
)
as
f
:
out
=
f
.
read
()
stdio
.
verbose
(
'stdout: %s'
%
out
)
...
...
@@ -183,20 +184,8 @@ def run_test(plugin_context, cursor, odp_cursor=None, *args, **kwargs):
output
+=
'{} : {}
\n
'
.
format
(
key
,
value
)
args
[
key_map
[
k
]]
=
value
stdio
.
print
(
output
)
# # html测试报告
# try:
# tpcc_path = os.path.join(tmp_dir, 'tpcc.html')
# tmp_path = os.path.join(tmp_dir, 'tpcc.html')
# with open(tmp_path, "r", encoding='UTF-8') as h:
# TPCC_TEMPLATE = h.read().replace('%2', '%')
# with open(tpcc_path, 'w') as f:
# f.write(TPCC_TEMPLATE.replace('%', '%%').replace('%%(', '%(') % args)
# except Exception as e:
# stdio.exception(e)
# stdio.error('Failed to generate html report for tpcc.')
# stdio.stop_loading('fail')
# return
# return plugin_context.return_true()
if
return_code
==
0
:
return
plugin_context
.
return_true
()
except
Exception
as
e
:
error
=
str
(
e
)
verbose_msg
=
'exited code 255, error output:
\n
%s'
%
error
...
...
web/package.json
浏览文件 @
97ce6598
...
...
@@ -20,32 +20,32 @@
]
},
"dependencies"
:
{
"@ant-design/icons"
:
"
^
4.8.0"
,
"@ant-design/pro-components"
:
"
^
2.3.34"
,
"@ant-design/pro-layout"
:
"
^
6.5.0"
,
"@types/video.js"
:
"
^
7.3.50"
,
"@umijs/plugin-openapi"
:
"
^
1.3.3"
,
"@ant-design/icons"
:
"4.8.0"
,
"@ant-design/pro-components"
:
"2.3.34"
,
"@ant-design/pro-layout"
:
"6.5.0"
,
"@types/video.js"
:
"7.3.50"
,
"@umijs/plugin-openapi"
:
"1.3.3"
,
"antd"
:
"5.0.7"
,
"copy-to-clipboard"
:
"
^
3.3.3"
,
"cross-env"
:
"
^
7.0.3"
,
"lottie-web"
:
"
^5.10.0
"
,
"moment"
:
"
^
2.29.4"
,
"number-precision"
:
"
^
1.6.0"
,
"randexp"
:
"
^
0.5.3"
,
"react"
:
"17.
x
"
,
"react-dom"
:
"17.
x
"
,
"umi"
:
"
^
3.5.35"
,
"video.js"
:
"
^
7.20.3"
"copy-to-clipboard"
:
"3.3.3"
,
"cross-env"
:
"7.0.3"
,
"lottie-web"
:
"
5.10.2
"
,
"moment"
:
"2.29.4"
,
"number-precision"
:
"1.6.0"
,
"randexp"
:
"0.5.3"
,
"react"
:
"17.
0.2
"
,
"react-dom"
:
"17.
0.2
"
,
"umi"
:
"3.5.35"
,
"video.js"
:
"7.20.3"
},
"devDependencies"
:
{
"@types/react"
:
"
^17.0.0
"
,
"@types/react-dom"
:
"
^17.0.0
"
,
"@umijs/preset-react"
:
"1.
x
"
,
"@umijs/test"
:
"
^
3.5.35"
,
"lint-staged"
:
"
^10.0.7
"
,
"prettier"
:
"
^2.2.0
"
,
"typescript"
:
"
^4.1.2
"
,
"yorkie"
:
"
^
2.0.0"
"@types/react"
:
"
17.0.52
"
,
"@types/react-dom"
:
"
17.0.2
"
,
"@umijs/preset-react"
:
"1.
8.31
"
,
"@umijs/test"
:
"3.5.35"
,
"lint-staged"
:
"
10.5.4
"
,
"prettier"
:
"
2.7.1
"
,
"typescript"
:
"
4.9.3
"
,
"yorkie"
:
"2.0.0"
},
"gitHooks"
:
{
"pre-commit"
:
"lint-staged"
...
...
web/src/pages/components/CheckInfo.tsx
浏览文件 @
97ce6598
...
...
@@ -205,8 +205,8 @@ export default function CheckInfo() {
label
:
'
OBProxy Exporter 端口
'
,
value
:
obproxy
?.
prometheus_listen_port
,
},
{
label
:
'
OBAgent
管理
服务端口
'
,
value
:
obagent
?.
monagent_http_port
},
{
label
:
'
OBAgent
监控
服务端口
'
,
value
:
obagent
?.
mgragent_http_port
},
{
label
:
'
OBAgent
监控
服务端口
'
,
value
:
obagent
?.
monagent_http_port
},
{
label
:
'
OBAgent
管理
服务端口
'
,
value
:
obagent
?.
mgragent_http_port
},
];
if
(
!
lowVersion
)
{
...
...
web/src/pages/components/ClusterConfig.tsx
浏览文件 @
97ce6598
...
...
@@ -664,7 +664,7 @@ export default function ClusterConfig() {
<
Space
size
=
"middle"
>
<
ProFormDigit
name
=
{
[
'
obagent
'
,
'
monagent_http_port
'
]
}
label
=
"OBAgent
管理
服务端口"
label
=
"OBAgent
监控
服务端口"
fieldProps
=
{
{
style
:
commonStyle
}
}
placeholder
=
"请输入"
rules
=
{
[
...
...
@@ -674,7 +674,7 @@ export default function ClusterConfig() {
/>
<
ProFormDigit
name
=
{
[
'
obagent
'
,
'
mgragent_http_port
'
]
}
label
=
"OBAgent
监控
服务端口"
label
=
"OBAgent
管理
服务端口"
fieldProps
=
{
{
style
:
commonStyle
}
}
placeholder
=
"请输入"
rules
=
{
[
...
...
web/yarn.lock
0 → 100644
浏览文件 @
97ce6598
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录