Skip to content

Commit

Permalink
3.0 move code (#617)
Browse files Browse the repository at this point in the history
* move code

* move code

* move code

* move code

* move code

* move code
  • Loading branch information
wayyoungboy authored Dec 11, 2024
1 parent 4883359 commit 1d2b787
Show file tree
Hide file tree
Showing 292 changed files with 566 additions and 813 deletions.
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "OBDIAG",
"dockerFile": "Dockerfile",
"dockerFile": "Dockerfile.dev",
"postAttachCommand": "bash",
"customizations": {
"vscode": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build_base_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
with:
context: .
platforms: linux/amd64
file: build/DockerFile
file: build/DockerFile.helper
push: true
tags: |
${{ vars.DOCKER_PUSH_BASE }}/obdiag-builder:latest
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion build_rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ cat ./rpm/oceanbase-diagnostic-tool.spec
yum install rpm-build -y
rpmbuild -bb ./rpm/oceanbase-diagnostic-tool.spec
# 展示对应的包路径
find / -name oceanbase-diagnostic-tool-*.rpm
find ~/ -name oceanbase-diagnostic-tool-*.rpm
48 changes: 0 additions & 48 deletions dependencies/check_dependencies.py

This file was deleted.

24 changes: 4 additions & 20 deletions dev_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,20 @@ copy_file(){
mkdir -p ${OBDIAG_HOME}/check
mkdir -p ${OBDIAG_HOME}/gather
mkdir -p ${OBDIAG_HOME}/display
if [ -d "${WORK_DIR}/handler/checker/tasks" ]; then
cp -rf ${WORK_DIR}/handler/checker/tasks ${OBDIAG_HOME}/check/
cp -rf ${WORK_DIR}/handler/checker/tasks/obproxy_check_package.yaml ${OBDIAG_HOME}/check/
cp -rf ${WORK_DIR}/handler/checker/tasks/observer_check_package.yaml ${OBDIAG_HOME}/check/
fi
if [ -d "${WORK_DIR}/handler/gather/tasks" ]; then
cp -rf ${WORK_DIR}/handler/gather/tasks ${OBDIAG_HOME}/gather/
fi

if [ -d "${WORK_DIR}/handler/display/tasks" ]; then
cp -rf ${WORK_DIR}/handler/display/tasks ${OBDIAG_HOME}/display/
fi

cp -rf ${WORK_DIR}/plugins/* ${OBDIAG_HOME}/
if [ -d "${WORK_DIR}/example" ]; then
cp -rf ${WORK_DIR}/example ${OBDIAG_HOME}/
fi

if [ -d "${WORK_DIR}/handler/rca/scene" ]; then
cp -rf ${WORK_DIR}/handler/rca/scene ${OBDIAG_HOME}/rca
fi

}
copy_file
echo "File initialization completed"

check_python_version

source ${WORK_DIR}/init_obdiag_cmd.sh
source ${WORK_DIR}/rpm/init_obdiag_cmd.sh

echo "Creating or updating alias 'obdiag' to run 'python3 ${PROJECT_PATH}/main.py'"
echo "alias obdiag='python3 ${PROJECT_PATH}/main.py'" >> ~/.bashrc
echo "Creating or updating alias 'obdiag' to run 'python3 ${PROJECT_PATH}/src/main.py'"
echo "alias obdiag='python3 ${PROJECT_PATH}/src/main.py'" >> ~/.bashrc
source ~/.bashrc
echo "Initialization completed successfully!"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"""
import os

from common.ssh_client.ssh import SshClient
from handler.gather.gather_component_log import GatherComponentLogHandler
from stdio import SafeStdio
from handler.gather.gather_obstack2 import GatherObstack2Handler
from handler.gather.gather_perf import GatherPerfHandler
from src.common.ssh_client.ssh import SshClient
from src.handler.gather.gather_component_log import GatherComponentLogHandler
from src.common.stdio import SafeStdio
from src.handler.gather.gather_obstack2 import GatherObstack2Handler
from src.handler.gather.gather_perf import GatherPerfHandler


class CPUHigh(SafeStdio):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
@file: px_collect_log.py
@desc:
"""
import os
import shutil

from common.ssh_client.ssh import SshClient
from handler.gather.gather_component_log import GatherComponentLogHandler
from common.command import uzip_dir_local, analyze_log_get_sqc_addr, find_home_path_by_port
from src.common.ssh_client.ssh import SshClient
from src.handler.gather.gather_component_log import GatherComponentLogHandler
from src.common.command import uzip_dir_local, analyze_log_get_sqc_addr, find_home_path_by_port
import datetime


Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
@file: sql_problem.py
@desc:
"""
from handler.gather.gather_component_log import GatherComponentLogHandler
from stdio import SafeStdio
from handler.gather.gather_plan_monitor import GatherPlanMonitorHandler
from common.tool import StringUtils
from common.ssh_client.ssh import SshClient
from common.command import find_home_path_by_port
from src.handler.gather.gather_component_log import GatherComponentLogHandler
from src.common.stdio import SafeStdio
from src.handler.gather.gather_plan_monitor import GatherPlanMonitorHandler
from src.common.tool import StringUtils
from src.common.ssh_client.ssh import SshClient
from src.common.command import find_home_path_by_port


class SQLProblem(SafeStdio):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
import os
import re

from handler.rca.rca_exception import RCAInitException, RCAExecuteException, RCANotNeedExecuteException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_exception import RCAInitException, RCAExecuteException, RCANotNeedExecuteException
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import StringUtils


class ClogDiskFullScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
@desc:
"""

from handler.rca.rca_exception import RCAInitException, RCAExecuteException
from handler.rca.rca_handler import RcaScene
from common.tool import StringUtils
from src.handler.rca.rca_exception import RCAInitException, RCAExecuteException
from src.handler.rca.rca_handler import RcaScene
from src.common.tool import StringUtils


def translate_byte(B):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@
@file: ddl_failure_scene.py
@desc:
"""
import datetime
import os
import re

from handler.rca.rca_exception import RCAInitException, RCAExecuteException, RCANotNeedExecuteException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_exception import RCAInitException, RCAExecuteException, RCANotNeedExecuteException
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import StringUtils


class DDLFailureScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@desc:
"""
import re
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import StringUtils


class DisconnectionScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@
@file: index_ddl_error_scene.py
@desc:
"""
import re

from handler.rca.rca_exception import RCAInitException, RCAExecuteException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_exception import RCAInitException, RCAExecuteException
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import StringUtils


class IndexDDLErrorScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
@desc:
"""
import json
from handler.rca.rca_exception import RCAInitException, RCANotNeedExecuteException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils, DateTimeEncoder
from src.handler.rca.rca_exception import RCAInitException, RCANotNeedExecuteException
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import StringUtils, DateTimeEncoder


class LockConflictScene(RcaScene):
Expand Down
6 changes: 3 additions & 3 deletions handler/rca/scene/log_error.py → plugins/rca/log_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import os
import re

from handler.rca.rca_exception import RCAInitException, RCAExecuteException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_exception import RCAInitException, RCAExecuteException
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import StringUtils


class LogErrorScene(RcaScene):
Expand Down
8 changes: 4 additions & 4 deletions handler/rca/scene/major_hold.py → plugins/rca/major_hold.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
import json
import os.path
import re
from handler.rca.rca_exception import (
from src.handler.rca.rca_exception import (
RCAInitException,
RCAExecuteException,
RCANotNeedExecuteException,
)
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import DateTimeEncoder
from common.tool import StringUtils
from src.handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from src.common.tool import DateTimeEncoder
from src.common.tool import StringUtils


class MajorHoldScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
"""
import os.path

from handler.rca.rca_exception import (
from src.handler.rca.rca_exception import (
RCAInitException,
RCAExecuteException,
)
from handler.rca.rca_handler import RcaScene
from src.handler.rca.rca_handler import RcaScene


class OMSFullTransScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import os
import re

from handler.rca.rca_exception import RCAInitException
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_exception import RCAInitException
from src.handler.rca.rca_handler import RcaScene
from src.common.tool import StringUtils


class TransactionDisconnectionScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
@file: transaction_execute_timeout_scene.py
@desc:
"""
import datetime
import os
import re

from handler.rca.rca_exception import (
from src.handler.rca.rca_exception import (
RCAInitException,
RCAExecuteException,
RCANotNeedExecuteException,
)
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_handler import RcaScene
from src.common.tool import StringUtils


class TransactionExecuteTimeoutScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,15 @@
@file: transaction_not_ending_scene.py
@desc:
"""
import datetime
import os
import re

from handler.rca.rca_exception import (
from src.handler.rca.rca_exception import (
RCAInitException,
RCAExecuteException,
RCANotNeedExecuteException,
)
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_handler import RcaScene
from src.common.tool import StringUtils


class TransactionNotEndingScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"""
import os

from handler.rca.rca_exception import (
from src.handler.rca.rca_exception import (
RCAInitException,
RCAExecuteException,
RCANotNeedExecuteException,
)
from handler.rca.rca_handler import RcaScene
from common.tool import StringUtils
from src.handler.rca.rca_handler import RcaScene
from src.common.tool import StringUtils


class TransactionOtherErrorScene(RcaScene):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@
import os
import re

from handler.rca.rca_exception import (
from src.handler.rca.rca_exception import (
RCAInitException,
RCAExecuteException,
RCANotNeedExecuteException,
)
from handler.rca.rca_handler import RcaScene, RCA_ResultRecord
from common.tool import StringUtils
from src.handler.rca.rca_handler import RcaScene
from src.common.tool import StringUtils


class TransactionRollbackScene(RcaScene):
Expand Down
Loading

0 comments on commit 1d2b787

Please sign in to comment.