diff --git a/.github/workflows/taosd-ci.yml b/.github/workflows/taosd-ci.yml index 23c0e47ebb..7f6dc5d3d7 100644 --- a/.github/workflows/taosd-ci.yml +++ b/.github/workflows/taosd-ci.yml @@ -9,6 +9,13 @@ on: paths-ignore: - 'packaging/**' - 'docs/**' + - 'tools/tdgpt/**' + - 'source/libs/executor/src/forecastoperator.c' + - 'source/libs/executor/src/anomalywindowoperator.c' + - 'include/common/tanalytics.h' + - 'source/common/src/tanalytics.c' + - 'tests/parallel/tdgpt_cases.task' + - 'tests/script/tsim/analytics' concurrency: group: ${{ github.workflow }}-${{ github.ref }}-TDengine @@ -18,87 +25,19 @@ env: WKC: '/var/lib/jenkins/workspace/TDinternal/community' jobs: - fetch-parameters: - runs-on: - group: CI - labels: [self-hosted, Linux, X64, testing] - outputs: - run_function_test: ${{ steps.parameters.outputs.run_function_test }} - run_tdgpt_test: ${{ steps.parameters.outputs.run_tdgpt_test }} - steps: - - name: Determine trigger source and fetch parameters - id: parameters - run: | - set -euo pipefail - # target_branch=${{ github.event.pull_request.base.ref }} - - # # Fetch the latest code from the target branch - # cd ${{ env.WKC }} - # git reset --hard - # git clean -f - # git remote prune origin - # git fetch - # git checkout "$target_branch" - # git remote prune origin - # git pull >/dev/null - - # # Check whether to run tdgpt test cases - # changed_files_non_doc=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $target_branch) | grep -v "^docs/en/" | grep -v "^docs/zh/" | grep -v ".md$" | tr '\n' ' ' || :) - # echo "changed files exclude doc: ${changed_files_non_doc}" - - # if [[ -n "$changed_files_non_doc" && "$changed_files_non_doc" =~ (forecastoperator\.c|anomalywindowoperator\.c|tanalytics\.h|tanalytics\.c|tdgpt_cases\.task|analytics|tdgpt) ]]; then - # run_tdgpt_test="true" - # else - # run_tdgpt_test="false" - # fi - # echo "run tdgpt test: ${run_tdgpt_test}" - - # # Check whether to run function test cases - # changed_files_non_tdgpt=$(git --no-pager diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD $target_branch) | \ - # grep -v "^docs/en/" | \ - # grep -v "^docs/zh/" | \ - # grep -v ".md$" | \ - # grep -Ev "forecastoperator\.c|anomalywindowoperator\.c|tanalytics\.h|tanalytics\.c|tdgpt_cases\.task|analytics|tdgpt" | \ - # tr '\n' ' ' || :) - # echo "changed files exclude tdgpt: ${changed_files_non_tdgpt}" - - # if [ -n "$changed_files_non_tdgpt" ]; then - # run_function_test="true" - # else - # run_function_test="false" - # fi - - # echo "run function test: ${run_function_test}" - - run_tdgpt_test="true" - run_function_test="true" - # Output the results for GitHub Actions - echo "run_function_test=$run_function_test" >> $GITHUB_OUTPUT - echo "run_tdgpt_test=$run_tdgpt_test" >> $GITHUB_OUTPUT - - echo ${{ github.event.pull_request.head.ref }} - echo ${{ github.event.pull_request.base.ref }} - echo ${{ github.event.pull_request.number }} - run-tests-on-linux: uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@main - needs: fetch-parameters - if: ${{ needs.fetch-parameters.outputs.run_tdgpt_test == 'true' || needs.fetch-parameters.outputs.run_function_test == 'true' }} with: tdinternal: false - run_function_test: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} - run_tdgpt_test: ${{ needs.fetch-parameters.outputs.run_tdgpt_test == 'true' }} + run_function_test: true + run_tdgpt_test: false run-tests-on-mac: uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@main - needs: fetch-parameters - if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} with: tdinternal: false run-tests-on-windows: uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@main - needs: fetch-parameters - if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} with: tdinternal: false diff --git a/.github/workflows/taosd-doc-build.yml b/.github/workflows/taosd-doc-build.yml index 28f1f10835..3ac922820a 100644 --- a/.github/workflows/taosd-doc-build.yml +++ b/.github/workflows/taosd-doc-build.yml @@ -7,7 +7,6 @@ on: - '3.0' paths: - 'docs/**' - - '*.md' env: DOC_WKC: "/root/doc_ci_work" diff --git a/CMakeLists.txt b/CMakeLists.txt index 2be056ec4e..07760e923b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,19 +21,18 @@ include(${TD_SUPPORT_DIR}/cmake.version) include(${TD_SUPPORT_DIR}/cmake.install) set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES OFF) - -add_library(api INTERFACE) -target_include_directories(api INTERFACE "include/client") - add_subdirectory(contrib) -add_subdirectory(source) -add_subdirectory(tools) -add_subdirectory(utils) -add_subdirectory(tests) -add_subdirectory(docs/doxgen) if(${BUILD_TEST}) include(CTest) enable_testing() add_subdirectory(examples/c) -endif(${BUILD_TEST}) \ No newline at end of file +endif(${BUILD_TEST}) + +add_library(api INTERFACE) +target_include_directories(api INTERFACE "include/client") +add_subdirectory(source) +add_subdirectory(tools) +add_subdirectory(utils) +add_subdirectory(tests) +add_subdirectory(docs/doxgen) diff --git a/README.md b/README.md index 9bc6c5dd83..3399ad5b2d 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ TDengine is an open source, high-performance, cloud native [time-series database For a full list of TDengine competitive advantages, please [check here](https://tdengine.com/tdengine/). The easiest way to experience TDengine is through [TDengine Cloud](https://cloud.tdengine.com). +For the latest TDengine component TDgpt, please refer to [TDgpt README](./tools/tdgpt/README.md) for details. + # 2. Documentation For user manual, system design and architecture, please refer to [TDengine Documentation](https://docs.tdengine.com) ([TDengine 文档](https://docs.taosdata.com)) diff --git a/docs/en/10-third-party/05-bi/03-powerbi.md b/docs/en/10-third-party/05-bi/03-powerbi.md index 85746da45b..dac8ee2b62 100644 --- a/docs/en/10-third-party/05-bi/03-powerbi.md +++ b/docs/en/10-third-party/05-bi/03-powerbi.md @@ -14,8 +14,8 @@ Power BI is a business analytics tool provided by Microsoft. By configuring the ## Configure Data Source -**Step 1**, Search and open the [ODBC Data Source (64 bit)] management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation). - +**Step 1**, Search and open the [ODBC Data Source (64 bit)] management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#installation). + **Step 2**, Open Power BI and log in, click [Home] -> [Get Data] -> [Other] -> [ODBC] -> [Connect], add data source. **Step 3**, Select the data source name just created, such as [MyTDengine], if you need to enter SQL, you can click the [Advanced options] tab, in the expanded dialog box enter the SQL statement. Click the [OK] button to connect to the configured data source. diff --git a/docs/en/10-third-party/05-bi/12-tableau.md b/docs/en/10-third-party/05-bi/12-tableau.md index d871451798..cacfaf94c0 100644 --- a/docs/en/10-third-party/05-bi/12-tableau.md +++ b/docs/en/10-third-party/05-bi/12-tableau.md @@ -13,11 +13,11 @@ Prepare the following environment: - TDengine 3.3.5.8 and above version is installed and running normally (both Enterprise and Community versions are available). - taosAdapter is running normally, refer to [taosAdapter Reference](../../../tdengine-reference/components/taosadapter/). - Install and run Tableau Desktop (if not installed, please download and install Windows operating system 64-bit [Download Tableau Desktop](https://www.tableau.com/products/desktop/download)). Install Tableau please refer to [Tableau Desktop](https://www.tableau.com). -- Download the latest Windows operating system X64 client driver from the TDengine official website and install it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation). +- Download the latest Windows operating system X64 client driver from the TDengine official website and install it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#installation). ## Configure Data Source -**Step 1**, Search and open the "ODBC Data Source (64 bit)" management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation). +**Step 1**, Search and open the "ODBC Data Source (64 bit)" management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#installation). :::tip It should be noted that when configuring the ODBC data source for Tableau, the [Database] configuration item on the TDengine ODBC data source configuration page is required. You need to select a database that can be successfully connected. diff --git a/docs/en/10-third-party/05-bi/13-excel.md b/docs/en/10-third-party/05-bi/13-excel.md index 47ee780c02..286c64bca2 100644 --- a/docs/en/10-third-party/05-bi/13-excel.md +++ b/docs/en/10-third-party/05-bi/13-excel.md @@ -13,12 +13,12 @@ Prepare the following environment: - TDengine 3.3.5.8 and above version is installed and running normally (both Enterprise and Community versions are available). - taosAdapter is running normally, refer to [taosAdapter Reference](../../../tdengine-reference/components/taosadapter/). - Install and run Excel. If not installed, please download and install it. For specific instructions, please refer to Microsoft's official documentation. -- Download the latest Windows operating system X64 client driver from the TDengine official website and install it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation). +- Download the latest Windows operating system X64 client driver from the TDengine official website and install it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#installation). ## Configure Data Source -**Step 1**, Search and open the [ODBC Data Source (64 bit)] management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#Installation). - +**Step 1**, Search and open the [ODBC Data Source (64 bit)] management tool in the Start menu of the Windows operating system and configure it, refer to [Install ODBC Driver](../../../tdengine-reference/client-libraries/odbc/#installation). + **Step 2**, Start Excel in the Windows system environment, then select [Data] -> [Get Data] -> [From Other Sources] -> [From ODBC]. ![excel-odbc](./excel/odbc-menu.webp) diff --git a/source/os/test/osFileTests.cpp b/source/os/test/osFileTests.cpp index f9e40c2703..97e5c8493d 100644 --- a/source/os/test/osFileTests.cpp +++ b/source/os/test/osFileTests.cpp @@ -196,7 +196,7 @@ TEST(osFileTests, taosCopyFile) { retsize = taosReadFromCFile(NULL, 0, 0, NULL); EXPECT_EQ(retsize, 0); - taosRemoveFile(from); + taosRemoveFile(from); } TEST(osFileTests, taosCreateFile) { diff --git a/source/os/test/osTests.cpp b/source/os/test/osTests.cpp index f4e7eff323..1e4bcbd3d6 100644 --- a/source/os/test/osTests.cpp +++ b/source/os/test/osTests.cpp @@ -389,7 +389,7 @@ TEST(osTest, osFile) { (void)taosThreadJoin(thread2, NULL); taosThreadClear(&thread2); - // int ret = taosRemoveFile(fname); + taosRemoveFile(fname); // ASSERT_EQ(ret, 0); // printf("remove file success"); } @@ -651,6 +651,8 @@ TEST(osTest, osFilePerformance) { taosMemoryFree(writeBuffer); taosMemoryFree(readBuffer); + taosRemoveFile(fname); + (void)printf("Test Write file %d times, cost: %" PRId64 "us\n", TESTTIMES, WriteFileCost); (void)printf("Test Read file %d times, cost: %" PRId64 "us\n", TESTTIMES, ReadFileCost); (void)printf("Test OpenForWrite & Close file %d times, cost: %" PRId64 "us\n", TESTTIMES, OpenForWriteCloseFileCost); diff --git a/tests/army/query/function/test_function.py b/tests/army/query/function/test_function.py index 27e54407cc..3b84583b20 100644 --- a/tests/army/query/function/test_function.py +++ b/tests/army/query/function/test_function.py @@ -42,8 +42,8 @@ class TDTestCase(TBase): tdSql.execute("insert into d0 file '%s'" % datafile) tdSql.execute("CREATE TABLE `n1` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT, co NCHAR(10))") tdSql.execute("insert into n1 values(now, 1, null, '23')") - tdSql.execute("insert into n1 values(now, null, 3, '23')") - tdSql.execute("insert into n1 values(now, 5, 3, '23')") + tdSql.execute("insert into n1 values(now+1a, null, 3, '23')") + tdSql.execute("insert into n1 values(now+2a, 5, 3, '23')") def test_normal_query_new(self, testCase): # read sql from .sql file and execute diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 1ee2bc4ce6..110a644e90 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -19,8 +19,7 @@ IF(TD_WEBSOCKET) PATCH_COMMAND COMMAND git clean -f -d BUILD_COMMAND - COMMAND cargo update - COMMAND RUSTFLAGS=-Ctarget-feature=-crt-static cargo build --release -p taos-ws-sys --features rustls + COMMAND RUSTFLAGS=-Ctarget-feature=-crt-static cargo build --release --locked -p taos-ws-sys --features rustls INSTALL_COMMAND COMMAND cp target/release/${websocket_lib_file} ${CMAKE_BINARY_DIR}/build/lib COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include @@ -38,8 +37,7 @@ IF(TD_WEBSOCKET) PATCH_COMMAND COMMAND git clean -f -d BUILD_COMMAND - COMMAND cargo update - COMMAND cargo build --release -p taos-ws-sys --features rustls + COMMAND cargo build --release --locked -p taos-ws-sys --features rustls INSTALL_COMMAND COMMAND cp target/release/taosws.dll ${CMAKE_BINARY_DIR}/build/lib COMMAND cp target/release/taosws.dll.lib ${CMAKE_BINARY_DIR}/build/lib/taosws.lib @@ -58,8 +56,7 @@ IF(TD_WEBSOCKET) PATCH_COMMAND COMMAND git clean -f -d BUILD_COMMAND - COMMAND cargo update - COMMAND cargo build --release -p taos-ws-sys --features rustls + COMMAND cargo build --release --locked -p taos-ws-sys --features rustls INSTALL_COMMAND COMMAND cp target/release/${websocket_lib_file} ${CMAKE_BINARY_DIR}/build/lib COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include diff --git a/tools/tdgpt/README.md b/tools/tdgpt/README.md index 0b61f8bcef..d67c6e2f91 100644 --- a/tools/tdgpt/README.md +++ b/tools/tdgpt/README.md @@ -14,7 +14,8 @@ 1. [Contributing](#12-contributing) # 1. Introduction -tdanalytics: an analytic platform for tdengine + +TDgpt: an analytic platform for TDengine # 2. Documentation @@ -70,7 +71,7 @@ cd script && ./release.sh After the packaging is completed, you will find the tarball in the `release` directory. ```bash -ls -lht /root/tdanalytics/release +ls -lht release -rw-rw-r-- 1 root root 74K Feb 21 17:04 TDengine-enterprise-anode-1.0.1.tar.gz ``` @@ -111,16 +112,16 @@ http = 127.0.0.1:6090 The command `rmtaosanode` will remove the installed taosanode from your system. Note that the python environment won't removed by this script, you need to remove it mannually. # 8. Testing -we use github Actions to run the test suit. Please refer to the file [.github/workflows/python-package.yml](https://github.com/taosdata/tdanalytics/.github/workflows/python-package.yml) for more details. +We use Github Actions to run the test suite. Please refer to the workflow definition yaml file in [.github/workflows](../../.github/workflows/) for details. # 9 Releasing + For the complete list of taosanode Releases, please see Releases. # 10 CI/CD -We use github Actions for CI/CD workflow configuration. Please refer to the file .github/workflows/python-package.yml for more details. - +We use Github Actions for CI/CD workflow configuration. Please refer to the workflow definition yaml file in [.github/workflows](../../.github/workflows/) for details. # 11 Coverage diff --git a/tools/tdgpt/script/release.sh b/tools/tdgpt/script/release.sh index c143357eb1..0114d60ecd 100755 --- a/tools/tdgpt/script/release.sh +++ b/tools/tdgpt/script/release.sh @@ -1,15 +1,33 @@ #!/bin/bash -# Generate install package for all os system + +# Generate install package for Linux Platform set -e -# set -x + +while getopts "e:v:" opt; do + case "$opt" in + e) edition="$OPTARG" ;; # -e enterprise/community + v) version="$OPTARG" ;; # -v version + *) echo "Usage: $0 -e edition -v version"; exit 1 ;; + esac +done + +if [ -z "$edition" ] || [ -z "$version" ]; then + echo "Usage: $0 -e edition -v version" + exit 1 +fi +if [ "$edition" == "enterprise" ]; then + productName="TDengine-enterprise-anode" +fi + +if [ "$edition" == "community" ]; then + productName="TDengine-community-anode" +fi + +echo start to build release package, edition: ${edition}, version: ${version} curr_dir=$(pwd) compile_dir=$1 -version="1.0.1" -osType= -pagMode= -productName="TDengine-enterprise-anode" script_dir="$(dirname $(readlink -f $0))" top_dir="$(readlink -f ${script_dir}/..)" @@ -45,18 +63,17 @@ fi # python files mkdir -p ${install_dir}/bin && mkdir -p ${install_dir}/lib +# remove cache files generated by Python interpreter +TARGET_PATTERN="__pycache__" +find "${top_dir}/taosanalytics/" -type d -name "$TARGET_PATTERN" -exec rm -rf {} + + # script to control start/stop/uninstall process -rm -r ${top_dir}/taosanalytics/*.pyc || : cp -r ${top_dir}/taosanalytics/ ${install_dir}/lib/ && chmod a+x ${install_dir}/lib/ || : cp -r ${top_dir}/script/st*.sh ${install_dir}/bin/ && chmod a+x ${install_dir}/bin/* || : cp -r ${top_dir}/script/uninstall.sh ${install_dir}/bin/ && chmod a+x ${install_dir}/bin/* || : cd ${install_dir} -#if [ "$osType" != "Darwin" ]; then -# tar -zcv -f ${tarName} ./bin/* || : -# rm -rf ${install_dir}/bin || : -#else tar -zcv -f ${tarName} ./lib/* || : if [ ! -z "${install_dir}" ]; then