Skip to content

Commit

Permalink
feat: add diagnostic tool (#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
dl239 authored Aug 10, 2022
1 parent d4c2099 commit 01a7a67
Show file tree
Hide file tree
Showing 55 changed files with 1,715 additions and 21 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -273,21 +273,22 @@ jobs:
with:
name: linux-ut-result-python-${{ github.sha }}
path: |
python/openmldb/test/pytest.xml
python/openmldb_sdk/openmldb/test/pytest.xml
- name: upload python coverage to codecov
uses: codecov/codecov-action@v2
with:
name: coverage
files: python/test/coverage.xml
files: python/openmldb_sdk/test/coverage.xml
fail_ci_if_error: true
verbose: true

- name: upload to pypi
if: >
github.repository == '4paradigm/OpenMLDB' && startsWith(github.ref, 'refs/tags/v')
run: |
cp python/dist/openmldb*.whl .
cp python/openmldb_sdk/dist/openmldb*.whl .
cp python/openmldb_tool/dist/openmldb*.whl .
twine upload openmldb-*.whl
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down Expand Up @@ -329,13 +330,14 @@ jobs:
with:
name: mac-ut-result-python-${{ github.sha }}
path: |
python/openmldb/test/pytest.xml
python/openmldb_sdk/openmldb/test/pytest.xml
- name: upload to pypi
if: >
github.repository == '4paradigm/OpenMLDB' && startsWith(github.ref, 'refs/tags/v')
run: |
cp python/dist/openmldb*.whl .
cp python/openmldb_sdk/dist/openmldb*.whl .
cp python/openmldb_tool/dist/openmldb*.whl .
twine upload openmldb-*.whl
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
Expand Down
12 changes: 7 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ java/hybridse-proto/src
logs

# python builds
/python/dist/
/python/*.egg-info/
/python/openmldb/native/**
!/python/openmldb/native/__init__.pyt
/python/test/*.xml
/python/openmldb_sdk/dist/
/python/openmldb_sdk/*.egg-info/
/python/openmldb_sdk/openmldb/native/**
!/python/openmldb_sdk/openmldb/native/__init__.pyt
/python/openmldb_sdk/test/*.xml
/python/openmldb_tool/dist/
/python/openmldb_tool/openmldb.egg-info/

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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
57 changes: 57 additions & 0 deletions python/openmldb_tool/diagnostic_tool/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Diag Tool
main: diagnose.py

ssh/scp by connections.py

read distribution yaml by dist_conf.py

## Collector
collector.py collects config, log and version

TODO: `<cluster-name>-conf` is better than custom dest name?

### config
```
<dest>/
<ip:port>-nameserver/
nameserver.flags
<ip:port>-tablet/
tablet.flags
<ip:port>-tablet/
tablet.flags
<ip:port>-taskmanager/
taskmanager.properties
```

### log
Find log path in remote config file.

Get last 2 files.

```
<dest>/
<ip:port>-nameserver/
nameserver.info.log.1
nameserver.info.log.2
...
<ip:port>-tablet/
...
<ip:port>-taskmanager/
taskmanager.log.1
job_1_error.log
...
```

### version

exec openmldb

run jar taskmanager and batch

#### find batch jar
find spark home from remote taskmanager config file.

## analysis

log_analysis.py read logs from local path `<dest>`.
NOTE: if diag local cluster/standalone, directory structure is different.
13 changes: 13 additions & 0 deletions python/openmldb_tool/diagnostic_tool/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2021 4Paradigm
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
Loading

0 comments on commit 01a7a67

Please sign in to comment.