提交 3875ab13 编写于 作者: sangshuduo's avatar sangshuduo

Merge branch 'develop' into feat/sangshuduo/TD-14141-update-taostools

......@@ -134,7 +134,7 @@ def sync_source() {
git submodule update --init --recursive
'''
}
def pre_test() {
def pre_test_arm64() {
sync_source()
sh '''
cd ${WK}
......@@ -148,6 +148,14 @@ def pre_test() {
'''
return 1
}
def pre_test() {
sync_source()
sh '''
cd ${WKC}/tests/parallel_test
./container_build.sh -w ${WKDIR} -t 8 >/dev/null
'''
return 1
}
def pre_test_mac() {
sync_source()
sh '''
......@@ -312,6 +320,7 @@ pipeline {
agent none
options { skipDefaultCheckout() }
environment{
WKDIR = '/var/data/jenkins/workspace'
WK = '/var/data/jenkins/workspace/TDinternal'
WKC = '/var/data/jenkins/workspace/TDinternal/community'
LOGDIR = '/var/data/jenkins/workspace/log'
......@@ -330,7 +339,7 @@ pipeline {
agent {label " worker07_arm64 || worker09_arm64 "}
steps {
timeout(time: 20, unit: 'MINUTES') {
pre_test()
pre_test_arm64()
script {
sh '''
echo "arm64 build done"
......
......@@ -42,12 +42,12 @@ TDengine can be widely applied to Internet of Things (IoT), Connected Vehicles,
# Documentation
For user manual, system design and architecture, engineering blogs, refer to [TDengine Documentation](https://www.taosdata.com/en/documentation/)(中文版请点击[这里](https://www.taosdata.com/cn/documentation20/))
For user manual, system design and architecture, engineering blogs, refer to [TDengine Documentation](https://docs.tdengine.com/)(中文版请点击[这里](https://docs.taosdata.com/))
for details. The documentation from our website can also be downloaded locally from _documentation/tdenginedocs-en_ or _documentation/tdenginedocs-cn_.
# Building
At the moment, TDengine server only supports running on Linux systems. You can choose to [install from packages](https://www.taosdata.com/en/getting-started/#Install-from-Package) or build it from the source code. This quick guide is for installation from the source only.
At the moment, TDengine server only supports running on Linux systems. You can choose to [install from packages](https://docs.tdengine.com/get-started/) or build it from the source code. This quick guide is for installation from the source only.
To build TDengine, use [CMake](https://cmake.org/) 3.0.2 or higher versions in the project directory.
......@@ -290,8 +290,8 @@ After building successfully, TDengine can be installed by
sudo make install
```
Users can find more information about directories installed on the system in the [directory and files](https://www.taosdata.com/en/documentation/administrator/#Directory-and-Files) section. Since version 2.0, installing from source code will also configure service management for TDengine.
Users can also choose to [install from packages](https://www.taosdata.com/en/getting-started/#Install-from-Package) for it.
Users can find more information about directories installed on the system in the [directory and files](https://docs.tdengine.com/operation/pkg-install/#installation-directory) section. Since version 2.0, installing from source code will also configure service management for TDengine.
Users can also choose to [install from packages](https://docs.tdengine.com/get-started/) for it.
To start the service after installation, in a terminal, use:
......@@ -299,7 +299,7 @@ To start the service after installation, in a terminal, use:
sudo systemctl start taosd
```
Then users can use the [TDengine shell](https://www.taosdata.com/en/getting-started/#TDengine-Shell) to connect the TDengine server. In a terminal, use:
Then users can use the [TDengine shell](https://docs.tdengine.com/develop/connect/#verify) to connect the TDengine server. In a terminal, use:
```bash
taos
......@@ -394,13 +394,13 @@ Query OK, 2 row(s) in set (0.001700s)
TDengine provides abundant developing tools for users to develop on TDengine. Follow the links below to find your desired connectors and relevant documentation.
- [Java](https://www.taosdata.com/en/documentation/connector/java)
- [C/C++](https://www.taosdata.com/en/documentation/connector#c-cpp)
- [Python](https://www.taosdata.com/en/documentation/connector#python)
- [Go](https://www.taosdata.com/en/documentation/connector#go)
- [RESTful API](https://www.taosdata.com/en/documentation/connector#restful)
- [Node.js](https://www.taosdata.com/en/documentation/connector#nodejs)
- [Rust](https://www.taosdata.com/en/documentation/connector/rust)
- [Java](https://docs.tdengine.com/reference/connector/java)
- [C/C++](https://docs.tdengine.com/reference/connector/cpp)
- [Python](https://docs.tdengine.com/reference/connector/python)
- [Go](https://docs.tdengine.com/reference/connector/go)
- [RESTful API](https://docs.tdengine.com/reference/rest-api/)
- [Node.js](https://docs.tdengine.com/reference/connector/node)
- [Rust](https://docs.tdengine.com/reference/connector/rust)
## Third Party Connectors
......
......@@ -51,7 +51,6 @@ typedef struct SShellArguments {
char* auth;
char* database;
char* timezone;
bool restful;
TAOS* con;
bool is_raw_time;
bool is_use_passwd;
......@@ -69,10 +68,11 @@ typedef struct SShellArguments {
char* netTestRole;
char* dsn;
#ifdef WEBSOCKET
bool restful;
WS_TAOS* ws_conn;
#endif
bool cloud;
uint32_t timeout;
#endif
} SShellArguments;
/**************** Function declarations ****************/
......
......@@ -60,12 +60,14 @@ void printHelp() {
printf("%s%s%s\n", indent, indent, "Use multi-thread to import all SQL files in the directory separately.");
printf("%s%s\n", indent, "-T");
printf("%s%s%s\n", indent, indent, "Number of threads when using multi-thread to import data.");
#ifdef WEBSOCKET
printf("%s%s\n", indent, "-R");
printf("%s%s%s\n", indent, indent, "Connect and interact with TDengine use restful.");
printf("%s%s\n", indent, "-E");
printf("%s%s%s\n", indent, indent, "The DSN to use when connecting TDengine's cloud services.");
printf("%s%s\n", indent, "-t");
printf("%s%s%s\n", indent, indent, "The timeout in seconds for websocket interact.");
#endif
exit(EXIT_SUCCESS);
}
......@@ -79,7 +81,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for host
if (strcmp(argv[i], "-h") == 0) {
if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false;
#endif
arguments->host = argv[++i];
} else {
fprintf(stderr, "option -h requires an argument\n");
......@@ -111,7 +115,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for management port
else if (strcmp(argv[i], "-P") == 0) {
if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false;
#endif
arguments->port = atoi(argv[++i]);
} else {
fprintf(stderr, "option -P requires an argument\n");
......@@ -128,7 +134,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
} else if (strcmp(argv[i], "-c") == 0) {
if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false;
#endif
if (strlen(argv[++i]) >= TSDB_FILENAME_LEN) {
fprintf(stderr, "config file path: %s overflow max len %d\n", argv[i], TSDB_FILENAME_LEN - 1);
exit(EXIT_FAILURE);
......@@ -198,7 +206,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE);
}
}
#ifdef WEBSOCKET
else if (strcmp(argv[i], "-R") == 0) {
arguments->cloud = false;
arguments->restful = true;
......@@ -221,6 +229,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE);
}
}
#endif
// For temperory command TODO
else if (strcmp(argv[i], "--help") == 0) {
......@@ -232,6 +241,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE);
}
}
#ifdef WEBSOCKET
if (args.dsn == NULL) {
if (args.cloud) {
args.dsn = getenv("TDENGINE_CLOUD_DSN");
......@@ -242,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} else {
args.cloud = true;
}
#endif
}
int32_t shellReadCommand(TAOS *con, char *command) {
......
......@@ -52,9 +52,11 @@ static struct argp_option options[] = {
{"pktlen", 'l', "PKTLEN", 0, "Packet length used for net test, default is 1000 bytes."},
{"pktnum", 'N', "PKTNUM", 0, "Packet numbers used for net test, default is 100."},
{"pkttype", 'S', "PKTTYPE", 0, "Choose packet type used for net test, default is TCP. Only speed test could be either TCP or UDP."},
#ifdef WEBSOCKET
{"restful", 'R', 0, 0, "Connect and interact with TDengine use restful."},
{"cloudDsn", 'E', "DSN", 0, "The DSN to use when connecting TDengine's cloud services."},
{"timeout", 't', "SECONDS", 0, "The timeout seconds for websocket to interact."},
#endif
{0}};
static error_t parse_opt(int key, char *arg, struct argp_state *state) {
......@@ -66,7 +68,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
switch (key) {
case 'h':
if (arg) {
#ifdef WEBSOCKET
args.cloud = false;
#endif
args.host = arg;
} else {
fprintf(stderr, "Invalid host\n");
......@@ -77,7 +81,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break;
case 'P':
if (arg) {
#ifdef WEBSOCKET
args.cloud = false;
#endif
tsDnodeShellPort = atoi(arg);
args.port = atoi(arg);
} else {
......@@ -105,7 +111,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
wordfree(&full_path);
return -1;
}
#ifdef WEBSOCKET
args.cloud = false;
#endif
tstrncpy(configDir, full_path.we_wordv[0], TSDB_FILENAME_LEN);
wordfree(&full_path);
break;
......@@ -173,6 +181,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case OPT_ABORT:
arguments->abort = 1;
break;
#ifdef WEBSOCKET
case 'R':
arguments->restful = true;
arguments->cloud = false;
......@@ -192,6 +201,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
fprintf(stderr, "Invalid -t option\n");
}
break;
#endif
default:
return ARGP_ERR_UNKNOWN;
}
......@@ -245,6 +255,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
argp_parse(&argp, argc, argv, 0, 0, arguments);
#ifdef WEBSOCKET
if (args.dsn == NULL) {
if (args.cloud) {
args.dsn = getenv("TDENGINE_CLOUD_DSN");
......@@ -255,6 +266,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} else {
args.cloud = true;
}
#endif
if (arguments->abort) {
#ifndef _ALPINE
......
......@@ -37,9 +37,11 @@ void *cancelHandler(void *arg) {
taosMsleep(10);
continue;
}
#ifdef WEBSOCKET
if (args.restful || args.cloud) {
stop_fetch = true;
}
#endif
#ifdef LINUX
int64_t rid = atomic_val_compare_exchange_64(&result, result, 0);
SSqlObj* pSql = taosAcquireRef(tscObjRef, rid);
......@@ -81,7 +83,6 @@ SShellArguments args = {.host = NULL,
.user = NULL,
.database = NULL,
.timezone = NULL,
.restful = false,
.is_raw_time = false,
.is_use_passwd = false,
.dump_config = false,
......@@ -93,9 +94,12 @@ SShellArguments args = {.host = NULL,
.pktNum = 100,
.pktType = "TCP",
.netTestRole = NULL,
#ifdef WEBSOCKET
.restful = false,
.cloud = true,
.dsn = NULL,
.timeout = 10,
#endif
};
/*
......@@ -135,6 +139,7 @@ int main(int argc, char* argv[]) {
exit(0);
}
#ifdef WEBSOCKET
if (args.restful) {
args.dsn = calloc(1, 1024);
......@@ -148,6 +153,7 @@ int main(int argc, char* argv[]) {
snprintf(args.dsn, 1024, "ws://%s:%d/rest/ws",args.host, args.port);
}
#endif
/* Initialize the shell */
shellInit(&args);
......
......@@ -62,12 +62,14 @@ void printHelp() {
printf("%s%s%s\n", indent, indent, "Packet length used for net test, default is 1000 bytes.");
printf("%s%s\n", indent, "-N");
printf("%s%s%s\n", indent, indent, "Packet numbers used for net test, default is 100.");
#ifdef WEBSOCKET
printf("%s%s\n", indent, "-R");
printf("%s%s%s\n", indent, indent, "Connect and interact with TDengine use restful.");
printf("%s%s\n", indent, "-E");
printf("%s%s%s\n", indent, indent, "The DSN to use when connecting TDengine's cloud services.");
printf("%s%s\n", indent, "-t");
printf("%s%s%s\n", indent, indent, "The timeout seconds for websocekt to interact.");
#endif
printf("%s%s\n", indent, "-S");
printf("%s%s%s\n", indent, indent, "Packet type used for net test, default is TCP.");
printf("%s%s\n", indent, "-V");
......@@ -82,7 +84,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for host
if (strcmp(argv[i], "-h") == 0) {
if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false;
#endif
arguments->host = argv[++i];
} else {
fprintf(stderr, "option -h requires an argument\n");
......@@ -114,7 +118,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for management port
else if (strcmp(argv[i], "-P") == 0) {
if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false;
#endif
arguments->port = atoi(argv[++i]);
} else {
fprintf(stderr, "option -P requires an argument\n");
......@@ -138,7 +144,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
}
} else if (strcmp(argv[i], "-c") == 0) {
if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false;
#endif
char *tmp = argv[++i];
if (strlen(tmp) >= TSDB_FILENAME_LEN) {
fprintf(stderr, "config file path: %s overflow max len %d\n", tmp, TSDB_FILENAME_LEN - 1);
......@@ -220,6 +228,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE);
}
}
#ifdef WEBSOCKET
else if (strcmp(argv[i], "-R") == 0) {
arguments->cloud = false;
......@@ -243,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE);
}
}
#endif
else if (strcmp(argv[i], "-V") == 0) {
printVersion();
......@@ -258,6 +268,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE);
}
}
#ifdef WEBSOCKET
if (args.dsn == NULL) {
if (args.cloud) {
args.dsn = getenv("TDENGINE_CLOUD_DSN");
......@@ -274,6 +285,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} else {
args.cloud = true;
}
#endif
}
void shellPrintContinuePrompt() { printf("%s", CONTINUE_PROMPT); }
......
......@@ -5,48 +5,46 @@ ADD_SUBDIRECTORY(monitor)
IF (TD_WEBSOCKET)
MESSAGE("${Green} use libtaos-ws${ColourReset}")
IF (TD_LINUX)
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs/target/release/libtaosws.so" OR
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs/target/release/libtaosws.so" OR
"${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs/target/release/libtaosws.so" IS_NEWER_THAN "${CMAKE_SOURCE_DIR}/.git/modules/src/plugins/taosws-rs/FETCH_HEAD")
MESSAGE("target is newer than fetch head")
include(ExternalProject)
ExternalProject_Add(taosws-rs
PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS off
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND cargo build --release -p taos-ws-sys
COMMAND ./taos-ws-sys/ci/package.sh
INSTALL_COMMAND
COMMAND cmake -E copy target/libtaosws/libtaosws.so ${CMAKE_BINARY_DIR}/build/lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include
)
ELSE ()
include(ExternalProject)
ExternalProject_Add(taosws-rs
PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS on
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND cargo build --release -p taos-ws-sys
COMMAND ./taos-ws-sys/ci/package.sh
INSTALL_COMMAND
COMMAND cmake -E copy target/libtaosws/libtaosws.so ${CMAKE_BINARY_DIR}/build/lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include
)
ENDIF()
MESSAGE("target is newer than fetch head")
include(ExternalProject)
ExternalProject_Add(taosws-rs
PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS off
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND cargo build --release -p taos-ws-sys
COMMAND ./taos-ws-sys/ci/package.sh
INSTALL_COMMAND
COMMAND cmake -E copy target/libtaosws/libtaosws.so ${CMAKE_BINARY_DIR}/build/lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include
)
ELSE ()
include(ExternalProject)
ExternalProject_Add(taosws-rs
PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS on
DEPENDS taos
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND
COMMAND git clean -f -d
BUILD_COMMAND
COMMAND cargo build --release -p taos-ws-sys
COMMAND ./taos-ws-sys/ci/package.sh
INSTALL_COMMAND
COMMAND cmake -E copy target/libtaosws/libtaosws.so ${CMAKE_BINARY_DIR}/build/lib
COMMAND cmake -E make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include
)
ENDIF()
ENDIF ()
......
Subproject commit d8cf0e7e067d193cfaf3e920b6ec6cbb9b9f4165
Subproject commit 9de599dc5293e9c90bc00bc4a03f8b91ba756bc3
......@@ -45,7 +45,7 @@ INTERNAL_REPDIR=$WORKDIR/TDinternal
docker run \
-v $INTERNAL_REPDIR:/home \
--rm --ulimit core=-1 taos_test:v1.0 sh -c "cd /home/$COMMUNITY;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true;make -j $THREAD_COUNT"
--rm --ulimit core=-1 taos_test:v1.0 sh -c "cd /home/$COMMUNITY;rm -rf debug;mkdir -p debug;cd debug;cmake .. -DBUILD_HTTP=false -DBUILD_TOOLS=true -DWEBSOCKET=true;make -j $THREAD_COUNT;make install"
ret=$?
exit $ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册