Merge branch '3.0' into enh/TS-6003-3.0

This commit is contained in:
Alex Duan 2025-03-13 20:41:07 +08:00
commit 7142f02ae2
13 changed files with 70 additions and 114 deletions

View File

@ -9,6 +9,13 @@ on:
paths-ignore: paths-ignore:
- 'packaging/**' - 'packaging/**'
- 'docs/**' - '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: concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-TDengine group: ${{ github.workflow }}-${{ github.ref }}-TDengine
@ -18,87 +25,19 @@ env:
WKC: '/var/lib/jenkins/workspace/TDinternal/community' WKC: '/var/lib/jenkins/workspace/TDinternal/community'
jobs: 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: run-tests-on-linux:
uses: taosdata/.github/.github/workflows/run-tests-on-linux.yml@main 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: with:
tdinternal: false tdinternal: false
run_function_test: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }} run_function_test: true
run_tdgpt_test: ${{ needs.fetch-parameters.outputs.run_tdgpt_test == 'true' }} run_tdgpt_test: false
run-tests-on-mac: run-tests-on-mac:
uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@main uses: taosdata/.github/.github/workflows/run-tests-on-macos.yml@main
needs: fetch-parameters
if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }}
with: with:
tdinternal: false tdinternal: false
run-tests-on-windows: run-tests-on-windows:
uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@main uses: taosdata/.github/.github/workflows/run-tests-on-windows.yml@main
needs: fetch-parameters
if: ${{ needs.fetch-parameters.outputs.run_function_test == 'true' }}
with: with:
tdinternal: false tdinternal: false

View File

@ -7,7 +7,6 @@ on:
- '3.0' - '3.0'
paths: paths:
- 'docs/**' - 'docs/**'
- '*.md'
env: env:
DOC_WKC: "/root/doc_ci_work" DOC_WKC: "/root/doc_ci_work"

View File

@ -21,19 +21,18 @@ include(${TD_SUPPORT_DIR}/cmake.version)
include(${TD_SUPPORT_DIR}/cmake.install) include(${TD_SUPPORT_DIR}/cmake.install)
set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES OFF) 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(contrib)
add_subdirectory(source)
add_subdirectory(tools)
add_subdirectory(utils)
add_subdirectory(tests)
add_subdirectory(docs/doxgen)
if(${BUILD_TEST}) if(${BUILD_TEST})
include(CTest) include(CTest)
enable_testing() enable_testing()
add_subdirectory(examples/c) add_subdirectory(examples/c)
endif(${BUILD_TEST}) 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)

View File

@ -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 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 # 2. Documentation
For user manual, system design and architecture, please refer to [TDengine Documentation](https://docs.tdengine.com) ([TDengine 文档](https://docs.taosdata.com)) For user manual, system design and architecture, please refer to [TDengine Documentation](https://docs.tdengine.com) ([TDengine 文档](https://docs.taosdata.com))

View File

@ -14,8 +14,8 @@ Power BI is a business analytics tool provided by Microsoft. By configuring the
## Configure Data Source ## 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 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. **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.

View File

@ -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). - 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/). - 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). - 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 ## 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 :::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. 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.

View File

@ -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). - 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/). - 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. - 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 ## 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]. **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) ![excel-odbc](./excel/odbc-menu.webp)

View File

@ -196,7 +196,7 @@ TEST(osFileTests, taosCopyFile) {
retsize = taosReadFromCFile(NULL, 0, 0, NULL); retsize = taosReadFromCFile(NULL, 0, 0, NULL);
EXPECT_EQ(retsize, 0); EXPECT_EQ(retsize, 0);
taosRemoveFile(from); taosRemoveFile(from);
} }
TEST(osFileTests, taosCreateFile) { TEST(osFileTests, taosCreateFile) {

View File

@ -389,7 +389,7 @@ TEST(osTest, osFile) {
(void)taosThreadJoin(thread2, NULL); (void)taosThreadJoin(thread2, NULL);
taosThreadClear(&thread2); taosThreadClear(&thread2);
// int ret = taosRemoveFile(fname); taosRemoveFile(fname);
// ASSERT_EQ(ret, 0); // ASSERT_EQ(ret, 0);
// printf("remove file success"); // printf("remove file success");
} }
@ -651,6 +651,8 @@ TEST(osTest, osFilePerformance) {
taosMemoryFree(writeBuffer); taosMemoryFree(writeBuffer);
taosMemoryFree(readBuffer); taosMemoryFree(readBuffer);
taosRemoveFile(fname);
(void)printf("Test Write file %d times, cost: %" PRId64 "us\n", TESTTIMES, WriteFileCost); (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 Read file %d times, cost: %" PRId64 "us\n", TESTTIMES, ReadFileCost);
(void)printf("Test OpenForWrite & Close file %d times, cost: %" PRId64 "us\n", TESTTIMES, OpenForWriteCloseFileCost); (void)printf("Test OpenForWrite & Close file %d times, cost: %" PRId64 "us\n", TESTTIMES, OpenForWriteCloseFileCost);

View File

@ -42,8 +42,8 @@ class TDTestCase(TBase):
tdSql.execute("insert into d0 file '%s'" % datafile) tdSql.execute("insert into d0 file '%s'" % datafile)
tdSql.execute("CREATE TABLE `n1` (`ts` TIMESTAMP, `current` FLOAT, `voltage` INT, co NCHAR(10))") 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, 1, null, '23')")
tdSql.execute("insert into n1 values(now, null, 3, '23')") tdSql.execute("insert into n1 values(now+1a, null, 3, '23')")
tdSql.execute("insert into n1 values(now, 5, 3, '23')") tdSql.execute("insert into n1 values(now+2a, 5, 3, '23')")
def test_normal_query_new(self, testCase): def test_normal_query_new(self, testCase):
# read sql from .sql file and execute # read sql from .sql file and execute

View File

@ -19,8 +19,7 @@ IF(TD_WEBSOCKET)
PATCH_COMMAND PATCH_COMMAND
COMMAND git clean -f -d COMMAND git clean -f -d
BUILD_COMMAND BUILD_COMMAND
COMMAND cargo update COMMAND RUSTFLAGS=-Ctarget-feature=-crt-static cargo build --release --locked -p taos-ws-sys --features rustls
COMMAND RUSTFLAGS=-Ctarget-feature=-crt-static cargo build --release -p taos-ws-sys --features rustls
INSTALL_COMMAND INSTALL_COMMAND
COMMAND cp target/release/${websocket_lib_file} ${CMAKE_BINARY_DIR}/build/lib COMMAND cp target/release/${websocket_lib_file} ${CMAKE_BINARY_DIR}/build/lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
@ -38,8 +37,7 @@ IF(TD_WEBSOCKET)
PATCH_COMMAND PATCH_COMMAND
COMMAND git clean -f -d COMMAND git clean -f -d
BUILD_COMMAND BUILD_COMMAND
COMMAND cargo update COMMAND cargo build --release --locked -p taos-ws-sys --features rustls
COMMAND cargo build --release -p taos-ws-sys --features rustls
INSTALL_COMMAND INSTALL_COMMAND
COMMAND cp target/release/taosws.dll ${CMAKE_BINARY_DIR}/build/lib 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 COMMAND cp target/release/taosws.dll.lib ${CMAKE_BINARY_DIR}/build/lib/taosws.lib
@ -58,8 +56,7 @@ IF(TD_WEBSOCKET)
PATCH_COMMAND PATCH_COMMAND
COMMAND git clean -f -d COMMAND git clean -f -d
BUILD_COMMAND BUILD_COMMAND
COMMAND cargo update COMMAND cargo build --release --locked -p taos-ws-sys --features rustls
COMMAND cargo build --release -p taos-ws-sys --features rustls
INSTALL_COMMAND INSTALL_COMMAND
COMMAND cp target/release/${websocket_lib_file} ${CMAKE_BINARY_DIR}/build/lib COMMAND cp target/release/${websocket_lib_file} ${CMAKE_BINARY_DIR}/build/lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include

View File

@ -14,7 +14,8 @@
1. [Contributing](#12-contributing) 1. [Contributing](#12-contributing)
# 1. Introduction # 1. Introduction
tdanalytics: an analytic platform for tdengine
TDgpt: an analytic platform for TDengine
# 2. Documentation # 2. Documentation
@ -70,7 +71,7 @@ cd script && ./release.sh
After the packaging is completed, you will find the tarball in the `release` directory. After the packaging is completed, you will find the tarball in the `release` directory.
```bash ```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 -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. 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 # 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 # 9 Releasing
For the complete list of taosanode Releases, please see Releases. For the complete list of taosanode Releases, please see Releases.
# 10 CI/CD # 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 # 11 Coverage

View File

@ -1,15 +1,33 @@
#!/bin/bash #!/bin/bash
# Generate install package for all os system
# Generate install package for Linux Platform
set -e 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) curr_dir=$(pwd)
compile_dir=$1 compile_dir=$1
version="1.0.1"
osType=
pagMode=
productName="TDengine-enterprise-anode"
script_dir="$(dirname $(readlink -f $0))" script_dir="$(dirname $(readlink -f $0))"
top_dir="$(readlink -f ${script_dir}/..)" top_dir="$(readlink -f ${script_dir}/..)"
@ -45,18 +63,17 @@ fi
# python files # python files
mkdir -p ${install_dir}/bin && mkdir -p ${install_dir}/lib 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 # 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}/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/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/* || : cp -r ${top_dir}/script/uninstall.sh ${install_dir}/bin/ && chmod a+x ${install_dir}/bin/* || :
cd ${install_dir} cd ${install_dir}
#if [ "$osType" != "Darwin" ]; then
# tar -zcv -f ${tarName} ./bin/* || :
# rm -rf ${install_dir}/bin || :
#else
tar -zcv -f ${tarName} ./lib/* || : tar -zcv -f ${tarName} ./lib/* || :
if [ ! -z "${install_dir}" ]; then if [ ! -z "${install_dir}" ]; then