From c34df137520e1c25c7d3e058d4c45171eeba3e13 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 10 Mar 2025 11:19:31 +0800 Subject: [PATCH 01/10] Add tdgpt ci and anode service restart workflow --- .github/workflows/tdgpt-ci.yml | 49 ++++++++++++++++++++++ .github/workflows/tdgpt-update-service.yml | 36 ++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 .github/workflows/tdgpt-ci.yml create mode 100644 .github/workflows/tdgpt-update-service.yml diff --git a/.github/workflows/tdgpt-ci.yml b/.github/workflows/tdgpt-ci.yml new file mode 100644 index 0000000000..ece06d17a1 --- /dev/null +++ b/.github/workflows/tdgpt-ci.yml @@ -0,0 +1,49 @@ +name: TDGpt CI Pipeline + +on: + pull_request: + branches: + - '3.0' + paths: + - 'tools/tdgpt/*' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest pylint + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + + - name: Checking the code with pylint + working-directory: ${{ github.workspace }}/tools/tdgpt + run: | + pylint $(git ls-files '*.py') --exit-zero + + - name: Checking the code with flake8 + working-directory: ${{ github.workspace }}/tools/tdgpt + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + + - name: Run test cases with pytest + working-directory: ${{ github.workspace }}/tools/tdgpt + run: | + pytest diff --git a/.github/workflows/tdgpt-update-service.yml b/.github/workflows/tdgpt-update-service.yml new file mode 100644 index 0000000000..b45e6d1ffc --- /dev/null +++ b/.github/workflows/tdgpt-update-service.yml @@ -0,0 +1,36 @@ +name: TDGpt Update Service + +on: + schedule: + - cron: '30 00 * * *' + +env: + WKC: "/root/TDengine" + +jobs: + update-service: + runs-on: + group: CI + labels: [self-hosted, Linux, X64, tdgpt-anode-service] + steps: + - name: Update TDengine codes + run: | + set -euo pipefail + cd ${{ env.WKC }} + git checkout 3.0 + + - name: Package the TDGpt Anode Service + run: | + set -euo pipefail + cd ${{ env.WKC }}/tools/tdgpt/script && ./release.sh + + - name: Reinstall and restart the TDGpt Anode Service + run: | + set -euo pipefail + cd ${{ env.WKC }}/tools/tdgpt/release + if [[ -f "TDengine-enterprise-anode-1.0.1.tar.gz" ]]; then + tar -xzf TDengine-enterprise-anode-1.0.1.tar.gz + cd TDengine-enterprise-anode-1.0.1 + ./install.sh + fi + systemctl restart taosanoded From 438bee4e62d5b4ca7aef2819e66e31c8ceb90065 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 10 Mar 2025 13:41:43 +0800 Subject: [PATCH 02/10] ci: Update tdgpt-update-service.yml Update trigger time to verify the workflow --- .github/workflows/tdgpt-update-service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tdgpt-update-service.yml b/.github/workflows/tdgpt-update-service.yml index b45e6d1ffc..fe29501b43 100644 --- a/.github/workflows/tdgpt-update-service.yml +++ b/.github/workflows/tdgpt-update-service.yml @@ -2,7 +2,7 @@ name: TDGpt Update Service on: schedule: - - cron: '30 00 * * *' + - cron: '45 13 * * *' env: WKC: "/root/TDengine" From 425d7fb8c7785252a52054da0898279cc2a112ee Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 10 Mar 2025 13:47:18 +0800 Subject: [PATCH 03/10] ci: Update tdgpt-update-service.yml add push trigger condition to verify --- .github/workflows/tdgpt-update-service.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tdgpt-update-service.yml b/.github/workflows/tdgpt-update-service.yml index fe29501b43..54af810dbb 100644 --- a/.github/workflows/tdgpt-update-service.yml +++ b/.github/workflows/tdgpt-update-service.yml @@ -1,8 +1,9 @@ name: TDGpt Update Service on: + push: schedule: - - cron: '45 13 * * *' + - cron: '30 00 * * *' env: WKC: "/root/TDengine" From 7de0dd67c14e53b1b66f802684fdce8fc7d25a35 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 10 Mar 2025 13:48:53 +0800 Subject: [PATCH 04/10] ci: Update tdgpt-update-service.yml Remove push trigger condition after verification --- .github/workflows/tdgpt-update-service.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tdgpt-update-service.yml b/.github/workflows/tdgpt-update-service.yml index 54af810dbb..b45e6d1ffc 100644 --- a/.github/workflows/tdgpt-update-service.yml +++ b/.github/workflows/tdgpt-update-service.yml @@ -1,7 +1,6 @@ name: TDGpt Update Service on: - push: schedule: - cron: '30 00 * * *' From ae9eac69c0d098e865dd0d8295786fbf008c1d82 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Mon, 10 Mar 2025 13:51:15 +0800 Subject: [PATCH 05/10] ci: udpate ignore and add tdgpt requirements.txt to verify the tdgpt ci workflow --- .github/workflows/tdgpt-ci.yml | 2 ++ .gitignore | 2 +- tools/tdgpt/requirements.txt | 54 ++++++++++++++++++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tools/tdgpt/requirements.txt diff --git a/.github/workflows/tdgpt-ci.yml b/.github/workflows/tdgpt-ci.yml index ece06d17a1..abe446f9c2 100644 --- a/.github/workflows/tdgpt-ci.yml +++ b/.github/workflows/tdgpt-ci.yml @@ -1,6 +1,7 @@ name: TDGpt CI Pipeline on: + push: pull_request: branches: - '3.0' @@ -25,6 +26,7 @@ jobs: cache: 'pip' - name: Install dependencies + working-directory: ${{ github.workspace }}/tools/tdgpt run: | python -m pip install --upgrade pip python -m pip install flake8 pytest pylint diff --git a/.gitignore b/.gitignore index ff27b53139..25263ec25e 100644 --- a/.gitignore +++ b/.gitignore @@ -140,7 +140,7 @@ tags *CMakeCache* *CMakeFiles* .history/ -*.txt +#*.txt *.tcl *.pc contrib/geos diff --git a/tools/tdgpt/requirements.txt b/tools/tdgpt/requirements.txt new file mode 100644 index 0000000000..ad4c42d7cf --- /dev/null +++ b/tools/tdgpt/requirements.txt @@ -0,0 +1,54 @@ +absl-py==2.1.0 +blinker==1.8.2 +click==8.1.7 +contourpy==1.3.0 +cycler==0.12.1 +Cython==3.0.11 +filelock==3.13.1 +Flask==3.0.3 +fonttools==4.54.1 +fsspec==2024.2.0 +h5py==3.12.1 +itsdangerous==2.2.0 +Jinja2==3.1.4 +joblib==1.4.2 +keras==3.6.0 +kiwisolver==1.4.7 +markdown-it-py==3.0.0 +MarkupSafe==3.0.1 +matplotlib==3.9.2 +mdurl==0.1.2 +ml_dtypes==0.5.0 +mpmath==1.3.0 +namex==0.0.8 +networkx==3.2.1 +numpy==1.26.4 +optree==0.13.0 +outlier-utils==0.0.5 +packaging==24.1 +pandas==1.5.0 +patsy==0.5.6 +pillow==10.4.0 +pmdarima==2.0.4 +pyculiarity==0.0.7 +Pygments==2.18.0 +pyparsing==3.1.4 +python-dateutil==2.9.0.post0 +pytz==2024.2 +rich==13.9.2 +rstl==0.1.3 +scikit-learn==1.5.2 +scipy==1.14.1 +six==1.16.0 +statsmodels==0.14.4 +sympy==1.12 +threadpoolctl==3.5.0 +--find-links https://download.pytorch.org/whl/torch/ +torch==2.4.1+cpu +typing_extensions==4.9.0 +urllib3==2.2.3 +uWSGI==2.0.27 +Werkzeug==3.0.4 +Flask-Testing==0.8.1 +xlsxwriter==3.2.1 +taospy==2.7.16 \ No newline at end of file From 490371055ff53fefe3b7d4ee0e3262d2647192a1 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Tue, 11 Mar 2025 08:31:38 +0800 Subject: [PATCH 06/10] ci: Update .gitignore Remove the modification for debuging --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 25263ec25e..ff27b53139 100644 --- a/.gitignore +++ b/.gitignore @@ -140,7 +140,7 @@ tags *CMakeCache* *CMakeFiles* .history/ -#*.txt +*.txt *.tcl *.pc contrib/geos From 9e248bcf91a4833a8b55ba563f4e8001e4c8ecf1 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Tue, 11 Mar 2025 09:47:32 +0800 Subject: [PATCH 07/10] Update .github/workflows/tdgpt-ci.yml Co-authored-by: WANG Xu --- .github/workflows/tdgpt-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tdgpt-ci.yml b/.github/workflows/tdgpt-ci.yml index c8fbaccd7d..961734a419 100644 --- a/.github/workflows/tdgpt-ci.yml +++ b/.github/workflows/tdgpt-ci.yml @@ -5,7 +5,7 @@ on: branches: - '3.0' paths: - - 'tools/tdgpt/*' + - 'tools/tdgpt/**' jobs: build: From cef8c45eb2375da6fbd60c16ad2f8693510ec1c2 Mon Sep 17 00:00:00 2001 From: Feng Chao Date: Tue, 11 Mar 2025 09:57:50 +0800 Subject: [PATCH 08/10] ci: Update tdgpt-ci.yml Adjust the working-directory as job level --- .github/workflows/tdgpt-ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/tdgpt-ci.yml b/.github/workflows/tdgpt-ci.yml index 961734a419..02c1c5889f 100644 --- a/.github/workflows/tdgpt-ci.yml +++ b/.github/workflows/tdgpt-ci.yml @@ -10,6 +10,7 @@ on: jobs: build: runs-on: ubuntu-latest + working-directory: ${{ github.workspace }}/tools/tdgpt strategy: fail-fast: false matrix: @@ -25,19 +26,16 @@ jobs: cache: 'pip' - name: Install dependencies - working-directory: ${{ github.workspace }}/tools/tdgpt run: | python -m pip install --upgrade pip python -m pip install flake8 pytest pylint if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - name: Checking the code with pylint - working-directory: ${{ github.workspace }}/tools/tdgpt run: | pylint $(git ls-files '*.py') --exit-zero - name: Checking the code with flake8 - working-directory: ${{ github.workspace }}/tools/tdgpt run: | # stop the build if there are Python syntax errors or undefined names flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics @@ -45,6 +43,5 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Run test cases with pytest - working-directory: ${{ github.workspace }}/tools/tdgpt run: | pytest From a4eec90ba4fd9ac667c69dff2e66f3e1f339bb4e Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Tue, 11 Mar 2025 15:24:06 +0800 Subject: [PATCH 09/10] fix: working directory at job level Signed-off-by: WANG Xu --- .github/workflows/tdgpt-ci.yml | 54 ++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tdgpt-ci.yml b/.github/workflows/tdgpt-ci.yml index 02c1c5889f..4a438938dc 100644 --- a/.github/workflows/tdgpt-ci.yml +++ b/.github/workflows/tdgpt-ci.yml @@ -1,6 +1,6 @@ -name: TDGpt CI Pipeline +name: TDgpt CI -on: +on: pull_request: branches: - '3.0' @@ -10,38 +10,42 @@ on: jobs: build: runs-on: ubuntu-latest - working-directory: ${{ github.workspace }}/tools/tdgpt + strategy: fail-fast: false matrix: python-version: ["3.10"] + defaults: + run: + working-directory: ${{ github.workspace }}/tools/tdgpt + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 - with: - python-version: ${{ matrix.python-version }} - cache: 'pip' + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + cache: 'pip' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install flake8 pytest pylint - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install flake8 pytest pylint + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - - name: Checking the code with pylint - run: | - pylint $(git ls-files '*.py') --exit-zero + - name: Checking the code with pylint + run: | + pylint $(git ls-files '*.py') --exit-zero - - name: Checking the code with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - name: Checking the code with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Run test cases with pytest - run: | + - name: Run test cases with pytest + run: | pytest From 5934e75c5aa4cecded688f487fe146e626ecc5aa Mon Sep 17 00:00:00 2001 From: WANG Xu Date: Tue, 11 Mar 2025 15:31:05 +0800 Subject: [PATCH 10/10] ci: modify workflow name --- .github/workflows/tdgpt-update-service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tdgpt-update-service.yml b/.github/workflows/tdgpt-update-service.yml index 03bff257c1..fa7344ce74 100644 --- a/.github/workflows/tdgpt-update-service.yml +++ b/.github/workflows/tdgpt-update-service.yml @@ -1,4 +1,4 @@ -name: TDGpt Update Service +name: TDgpt Update Service on: schedule: