未验证 提交 97ce6598 编写于 作者: R Rongfeng Fu 提交者: GitHub

V2.0.1 (#167)

* update .gitignore

* V2.0.1
上级 db864e13
......@@ -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
......
......@@ -305,6 +305,7 @@ class IOProgressBar(ProgressBar):
def finish(self):
if self.finished:
return
self.finished = True
self.update(self.maxval)
self._finish()
......
......@@ -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('error', e)
self._call_stdio('exception', e)
return False
finally:
if optimization and optimization_inited:
......
......@@ -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} ]\nthen\n source ${WORK_DIR}/profile/obd.sh\nfi" >>~/.bashrc
echo "export OBD_INSTALL_PATH=${WORK_DIR}" >> ~/.bashrc
echo "alias obd='python ${WORK_DIR}/_cmd.py'" >> ~/.bashrc
echo -e "if [ -d ${WORK_DIR} ]\nthen\n source ${WORK_DIR}/profile/obd.sh\nfi" >> ~/.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'"
......
......@@ -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)
......
......@@ -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)
......
......@@ -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']:
......
......@@ -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']:
......
......@@ -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:
......
......@@ -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
......
......@@ -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"
......
......@@ -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) {
......
......@@ -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={[
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册