From 366dccd187049cf539d708dfb5e4bb59f2d985ba Mon Sep 17 00:00:00 2001 From: "jingshun.tq" <35712518+Teingi@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:54:10 +0800 Subject: [PATCH 1/6] Rename Dockerfile to DockerFile --- build/{Dockerfile => DockerFile} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename build/{Dockerfile => DockerFile} (93%) diff --git a/build/Dockerfile b/build/DockerFile similarity index 93% rename from build/Dockerfile rename to build/DockerFile index 60898428..4a0d7c9f 100644 --- a/build/Dockerfile +++ b/build/DockerFile @@ -8,4 +8,4 @@ RUN /opt/miniconda3/bin/conda init RUN /opt/miniconda3/bin/conda create --name obdiag python=3.8 -y RUN source /opt/miniconda3/bin/activate obdiag RUN /opt/miniconda3/envs/obdiag/bin/python3.8 -m pip install --upgrade pip setuptools wheel -RUN yum install -y gcc gcc-c++ make \ No newline at end of file +RUN yum install -y gcc gcc-c++ make From a19cf45b9693c24a6a1e281a9b2d7dd71ecd07a1 Mon Sep 17 00:00:00 2001 From: Teingi Date: Mon, 16 Dec 2024 15:11:43 +0800 Subject: [PATCH 2/6] fix --- .github/workflows/build_package.yml | 33 ++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index de04b0e9..0c038023 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -6,7 +6,7 @@ on: - master push: branches: - - master + - '*'' env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true @@ -58,7 +58,19 @@ jobs: convert-to-deb: needs: build-rpm - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + strategy: + matrix: + include: + - distro: debian-11 + image: debian:11 + artifact_name: obdiag-deb-package-debian11 + - distro: ubuntu-22.04 + image: ubuntu:22.04 + artifact_name: obdiag-deb-package-ubuntu2204 + + container: + image: ${{ matrix.image }} steps: - name: Checkout code @@ -70,19 +82,24 @@ jobs: name: obdiag-rpm-packages path: . - - name: Install Alien + - name: Update and Install Dependencies run: | - sudo apt-get update - sudo apt-get install -y alien + apt-get update && apt-get install -y \ + alien \ + dpkg-dev \ + rpm2cpio \ + cpio \ + fakeroot - name: Convert RPM to DEB run: | + ls -lh oceanbase-diagnostic-tool-*.rpm sudo alien -k --scripts oceanbase-diagnostic-tool-*.rpm - pwd + ls -lh ./oceanbase-diagnostic-tool_*.deb - name: Upload DEB Artifact uses: actions/upload-artifact@v3 with: - name: obdiag-deb-package + name: ${{ matrix.artifact_name }} path: ./oceanbase-diagnostic-tool_*.deb - retention-days: 3 + retention-days: 3 \ No newline at end of file From 49b6a60f1d7704e014e7f6bf718d30a1b7f25e38 Mon Sep 17 00:00:00 2001 From: Teingi Date: Mon, 16 Dec 2024 15:12:28 +0800 Subject: [PATCH 3/6] fix --- .github/workflows/build_package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index 0c038023..80cb7d1b 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -6,7 +6,7 @@ on: - master push: branches: - - '*'' + - '*' env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true From 219c9e85c20aaaf62d816b52715ca455ba644366 Mon Sep 17 00:00:00 2001 From: Teingi Date: Mon, 16 Dec 2024 20:39:40 +0800 Subject: [PATCH 4/6] fixed: issue #620 --- dev_helper.sh | 0 src/handler/gather/gather_perf.py | 26 +++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) mode change 100644 => 100755 dev_helper.sh diff --git a/dev_helper.sh b/dev_helper.sh old mode 100644 new mode 100755 diff --git a/src/handler/gather/gather_perf.py b/src/handler/gather/gather_perf.py index d3da96dc..6418d74f 100644 --- a/src/handler/gather/gather_perf.py +++ b/src/handler/gather/gather_perf.py @@ -142,13 +142,14 @@ def __handle_from_node(self, node, local_stored_path): resp["error"] = "can't find observer" return resp for pid_observer in pid_observer_list: - if self.scope == "sample": - self.__gather_perf_sample(ssh_client, remote_dir_full_path, pid_observer) - elif self.scope == "flame": - self.__gather_perf_flame(ssh_client, remote_dir_full_path, pid_observer) - else: - self.__gather_perf_sample(ssh_client, remote_dir_full_path, pid_observer) - self.__gather_perf_flame(ssh_client, remote_dir_full_path, pid_observer) + if self.__perf_checker(ssh_client): + if self.scope == "sample": + self.__gather_perf_sample(ssh_client, remote_dir_full_path, pid_observer) + elif self.scope == "flame": + self.__gather_perf_flame(ssh_client, remote_dir_full_path, pid_observer) + else: + self.__gather_perf_sample(ssh_client, remote_dir_full_path, pid_observer) + self.__gather_perf_flame(ssh_client, remote_dir_full_path, pid_observer) self.__gather_top(ssh_client, remote_dir_full_path, pid_observer) zip_dir(ssh_client, "/tmp", remote_dir_name, self.stdio) @@ -177,6 +178,17 @@ def __gather_perf_sample(self, ssh_client, gather_path, pid_observer): except: self.stdio.error("generate perf sample data on server [{0}] failed".format(ssh_client.get_name())) + def __perf_checker(self, ssh_client): + cmd = "command -v perf1" + result = ssh_client.exec_cmd(cmd) + + if result: + self.stdio.verbose("perf is installed at [{0}] on server [{1}]".format(result, ssh_client.get_name())) + return True + else: + self.stdio.error("perf is not installed on server [{0}]. gather perf information will be skipped. Please install perf manually. ".format(ssh_client.get_name())) + return False + def __gather_perf_flame(self, ssh_client, gather_path, pid_observer): try: self.stdio.start_loading('gather perf flame') From 47af7b6adb09c0dcde5442285aa183cc4833937e Mon Sep 17 00:00:00 2001 From: Teingi Date: Mon, 16 Dec 2024 20:40:40 +0800 Subject: [PATCH 5/6] fixed: issue #620 --- .DS_Store | Bin 6148 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 5c3c6c2f9724dd4dd277ebc9126dd114ea190606..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeHKJ8r`;3?&nz2#_UXMqQyd5RCK$xj;WoiUJKh7}-7bTs>MJKSKhin>#dk1gIxb zd=m5q(-aYH&)uWQMnqO{L;12{YPN4au|-A{2*()*8IIlX_S*NKlkD38<37lToa9B` zFZs4XqXJZb3Qz$mKm}%3AWQ6OJ^RT#kP1+N|E_?29}3*CCXRvr>A>JE0I)&W4Rh}$ zfW-p9nm7g`0@I)ZgR0qLXwVTanO76Xz@Up}^PzdOW{0AFJI*hjE?NUQQUNM(t-vyt z8>|0M@L&4>YZ6yffC}7|0^02MyB1H%+B$ih)!G7ohFi`z+zfN4VDNGb^m2@amE)}^ bMP9Kv_G{u8=yb%L4&={(=|ZCdf33g|P&^fT From 267c3cf9ef67ef40ac1a8d16ee0931b33f122d08 Mon Sep 17 00:00:00 2001 From: Teingi Date: Mon, 16 Dec 2024 20:48:35 +0800 Subject: [PATCH 6/6] fixed: issue #620 --- .DS_Store | Bin 0 -> 6148 bytes .github/workflows/build_package.yml | 33 +++++++--------------------- 2 files changed, 8 insertions(+), 25 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5c3c6c2f9724dd4dd277ebc9126dd114ea190606 GIT binary patch literal 6148 zcmeHKJ8r`;3?&nz2#_UXMqQyd5RCK$xj;WoiUJKh7}-7bTs>MJKSKhin>#dk1gIxb zd=m5q(-aYH&)uWQMnqO{L;12{YPN4au|-A{2*()*8IIlX_S*NKlkD38<37lToa9B` zFZs4XqXJZb3Qz$mKm}%3AWQ6OJ^RT#kP1+N|E_?29}3*CCXRvr>A>JE0I)&W4Rh}$ zfW-p9nm7g`0@I)ZgR0qLXwVTanO76Xz@Up}^PzdOW{0AFJI*hjE?NUQQUNM(t-vyt z8>|0M@L&4>YZ6yffC}7|0^02MyB1H%+B$ih)!G7ohFi`z+zfN4VDNGb^m2@amE)}^ bMP9Kv_G{u8=yb%L4&={(=|ZCdf33g|P&^fT literal 0 HcmV?d00001 diff --git a/.github/workflows/build_package.yml b/.github/workflows/build_package.yml index 80cb7d1b..de04b0e9 100644 --- a/.github/workflows/build_package.yml +++ b/.github/workflows/build_package.yml @@ -6,7 +6,7 @@ on: - master push: branches: - - '*' + - master env: ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true @@ -58,19 +58,7 @@ jobs: convert-to-deb: needs: build-rpm - runs-on: ubuntu-latest - strategy: - matrix: - include: - - distro: debian-11 - image: debian:11 - artifact_name: obdiag-deb-package-debian11 - - distro: ubuntu-22.04 - image: ubuntu:22.04 - artifact_name: obdiag-deb-package-ubuntu2204 - - container: - image: ${{ matrix.image }} + runs-on: ubuntu-22.04 steps: - name: Checkout code @@ -82,24 +70,19 @@ jobs: name: obdiag-rpm-packages path: . - - name: Update and Install Dependencies + - name: Install Alien run: | - apt-get update && apt-get install -y \ - alien \ - dpkg-dev \ - rpm2cpio \ - cpio \ - fakeroot + sudo apt-get update + sudo apt-get install -y alien - name: Convert RPM to DEB run: | - ls -lh oceanbase-diagnostic-tool-*.rpm sudo alien -k --scripts oceanbase-diagnostic-tool-*.rpm - ls -lh ./oceanbase-diagnostic-tool_*.deb + pwd - name: Upload DEB Artifact uses: actions/upload-artifact@v3 with: - name: ${{ matrix.artifact_name }} + name: obdiag-deb-package path: ./oceanbase-diagnostic-tool_*.deb - retention-days: 3 \ No newline at end of file + retention-days: 3