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

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

...@@ -134,7 +134,7 @@ def sync_source() { ...@@ -134,7 +134,7 @@ def sync_source() {
git submodule update --init --recursive git submodule update --init --recursive
''' '''
} }
def pre_test() { def pre_test_arm64() {
sync_source() sync_source()
sh ''' sh '''
cd ${WK} cd ${WK}
...@@ -148,6 +148,14 @@ def pre_test() { ...@@ -148,6 +148,14 @@ def pre_test() {
''' '''
return 1 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() { def pre_test_mac() {
sync_source() sync_source()
sh ''' sh '''
...@@ -312,6 +320,7 @@ pipeline { ...@@ -312,6 +320,7 @@ pipeline {
agent none agent none
options { skipDefaultCheckout() } options { skipDefaultCheckout() }
environment{ environment{
WKDIR = '/var/data/jenkins/workspace'
WK = '/var/data/jenkins/workspace/TDinternal' WK = '/var/data/jenkins/workspace/TDinternal'
WKC = '/var/data/jenkins/workspace/TDinternal/community' WKC = '/var/data/jenkins/workspace/TDinternal/community'
LOGDIR = '/var/data/jenkins/workspace/log' LOGDIR = '/var/data/jenkins/workspace/log'
...@@ -330,7 +339,7 @@ pipeline { ...@@ -330,7 +339,7 @@ pipeline {
agent {label " worker07_arm64 || worker09_arm64 "} agent {label " worker07_arm64 || worker09_arm64 "}
steps { steps {
timeout(time: 20, unit: 'MINUTES') { timeout(time: 20, unit: 'MINUTES') {
pre_test() pre_test_arm64()
script { script {
sh ''' sh '''
echo "arm64 build done" echo "arm64 build done"
......
...@@ -42,12 +42,12 @@ TDengine can be widely applied to Internet of Things (IoT), Connected Vehicles, ...@@ -42,12 +42,12 @@ TDengine can be widely applied to Internet of Things (IoT), Connected Vehicles,
# Documentation # 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_. for details. The documentation from our website can also be downloaded locally from _documentation/tdenginedocs-en_ or _documentation/tdenginedocs-cn_.
# Building # 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. 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 ...@@ -290,8 +290,8 @@ After building successfully, TDengine can be installed by
sudo make install 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 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://www.taosdata.com/en/getting-started/#Install-from-Package) for it. 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: To start the service after installation, in a terminal, use:
...@@ -299,7 +299,7 @@ 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 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 ```bash
taos taos
...@@ -394,13 +394,13 @@ Query OK, 2 row(s) in set (0.001700s) ...@@ -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. 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) - [Java](https://docs.tdengine.com/reference/connector/java)
- [C/C++](https://www.taosdata.com/en/documentation/connector#c-cpp) - [C/C++](https://docs.tdengine.com/reference/connector/cpp)
- [Python](https://www.taosdata.com/en/documentation/connector#python) - [Python](https://docs.tdengine.com/reference/connector/python)
- [Go](https://www.taosdata.com/en/documentation/connector#go) - [Go](https://docs.tdengine.com/reference/connector/go)
- [RESTful API](https://www.taosdata.com/en/documentation/connector#restful) - [RESTful API](https://docs.tdengine.com/reference/rest-api/)
- [Node.js](https://www.taosdata.com/en/documentation/connector#nodejs) - [Node.js](https://docs.tdengine.com/reference/connector/node)
- [Rust](https://www.taosdata.com/en/documentation/connector/rust) - [Rust](https://docs.tdengine.com/reference/connector/rust)
## Third Party Connectors ## Third Party Connectors
......
...@@ -51,7 +51,6 @@ typedef struct SShellArguments { ...@@ -51,7 +51,6 @@ typedef struct SShellArguments {
char* auth; char* auth;
char* database; char* database;
char* timezone; char* timezone;
bool restful;
TAOS* con; TAOS* con;
bool is_raw_time; bool is_raw_time;
bool is_use_passwd; bool is_use_passwd;
...@@ -69,10 +68,11 @@ typedef struct SShellArguments { ...@@ -69,10 +68,11 @@ typedef struct SShellArguments {
char* netTestRole; char* netTestRole;
char* dsn; char* dsn;
#ifdef WEBSOCKET #ifdef WEBSOCKET
bool restful;
WS_TAOS* ws_conn; WS_TAOS* ws_conn;
#endif
bool cloud; bool cloud;
uint32_t timeout; uint32_t timeout;
#endif
} SShellArguments; } SShellArguments;
/**************** Function declarations ****************/ /**************** Function declarations ****************/
......
...@@ -60,12 +60,14 @@ void printHelp() { ...@@ -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%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\n", indent, "-T");
printf("%s%s%s\n", indent, indent, "Number of threads when using multi-thread to import data."); 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\n", indent, "-R");
printf("%s%s%s\n", indent, indent, "Connect and interact with TDengine use restful."); printf("%s%s%s\n", indent, indent, "Connect and interact with TDengine use restful.");
printf("%s%s\n", indent, "-E"); 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%s\n", indent, indent, "The DSN to use when connecting TDengine's cloud services.");
printf("%s%s\n", indent, "-t"); printf("%s%s\n", indent, "-t");
printf("%s%s%s\n", indent, indent, "The timeout in seconds for websocket interact."); printf("%s%s%s\n", indent, indent, "The timeout in seconds for websocket interact.");
#endif
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
...@@ -79,7 +81,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -79,7 +81,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for host // for host
if (strcmp(argv[i], "-h") == 0) { if (strcmp(argv[i], "-h") == 0) {
if (i < argc - 1) { if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false; arguments->cloud = false;
#endif
arguments->host = argv[++i]; arguments->host = argv[++i];
} else { } else {
fprintf(stderr, "option -h requires an argument\n"); fprintf(stderr, "option -h requires an argument\n");
...@@ -111,7 +115,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -111,7 +115,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for management port // for management port
else if (strcmp(argv[i], "-P") == 0) { else if (strcmp(argv[i], "-P") == 0) {
if (i < argc - 1) { if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false; arguments->cloud = false;
#endif
arguments->port = atoi(argv[++i]); arguments->port = atoi(argv[++i]);
} else { } else {
fprintf(stderr, "option -P requires an argument\n"); fprintf(stderr, "option -P requires an argument\n");
...@@ -128,7 +134,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -128,7 +134,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} }
} else if (strcmp(argv[i], "-c") == 0) { } else if (strcmp(argv[i], "-c") == 0) {
if (i < argc - 1) { if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false; arguments->cloud = false;
#endif
if (strlen(argv[++i]) >= TSDB_FILENAME_LEN) { if (strlen(argv[++i]) >= TSDB_FILENAME_LEN) {
fprintf(stderr, "config file path: %s overflow max len %d\n", argv[i], TSDB_FILENAME_LEN - 1); fprintf(stderr, "config file path: %s overflow max len %d\n", argv[i], TSDB_FILENAME_LEN - 1);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
...@@ -198,7 +206,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -198,7 +206,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#ifdef WEBSOCKET
else if (strcmp(argv[i], "-R") == 0) { else if (strcmp(argv[i], "-R") == 0) {
arguments->cloud = false; arguments->cloud = false;
arguments->restful = true; arguments->restful = true;
...@@ -221,6 +229,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -221,6 +229,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#endif
// For temperory command TODO // For temperory command TODO
else if (strcmp(argv[i], "--help") == 0) { else if (strcmp(argv[i], "--help") == 0) {
...@@ -232,6 +241,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -232,6 +241,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#ifdef WEBSOCKET
if (args.dsn == NULL) { if (args.dsn == NULL) {
if (args.cloud) { if (args.cloud) {
args.dsn = getenv("TDENGINE_CLOUD_DSN"); args.dsn = getenv("TDENGINE_CLOUD_DSN");
...@@ -242,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -242,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} else { } else {
args.cloud = true; args.cloud = true;
} }
#endif
} }
int32_t shellReadCommand(TAOS *con, char *command) { int32_t shellReadCommand(TAOS *con, char *command) {
......
...@@ -52,9 +52,11 @@ static struct argp_option options[] = { ...@@ -52,9 +52,11 @@ static struct argp_option options[] = {
{"pktlen", 'l', "PKTLEN", 0, "Packet length used for net test, default is 1000 bytes."}, {"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."}, {"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."}, {"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."}, {"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."}, {"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."}, {"timeout", 't', "SECONDS", 0, "The timeout seconds for websocket to interact."},
#endif
{0}}; {0}};
static error_t parse_opt(int key, char *arg, struct argp_state *state) { 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) { ...@@ -66,7 +68,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
switch (key) { switch (key) {
case 'h': case 'h':
if (arg) { if (arg) {
#ifdef WEBSOCKET
args.cloud = false; args.cloud = false;
#endif
args.host = arg; args.host = arg;
} else { } else {
fprintf(stderr, "Invalid host\n"); fprintf(stderr, "Invalid host\n");
...@@ -77,7 +81,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -77,7 +81,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
break; break;
case 'P': case 'P':
if (arg) { if (arg) {
#ifdef WEBSOCKET
args.cloud = false; args.cloud = false;
#endif
tsDnodeShellPort = atoi(arg); tsDnodeShellPort = atoi(arg);
args.port = atoi(arg); args.port = atoi(arg);
} else { } else {
...@@ -105,7 +111,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -105,7 +111,9 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
wordfree(&full_path); wordfree(&full_path);
return -1; return -1;
} }
#ifdef WEBSOCKET
args.cloud = false; args.cloud = false;
#endif
tstrncpy(configDir, full_path.we_wordv[0], TSDB_FILENAME_LEN); tstrncpy(configDir, full_path.we_wordv[0], TSDB_FILENAME_LEN);
wordfree(&full_path); wordfree(&full_path);
break; break;
...@@ -173,6 +181,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -173,6 +181,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
case OPT_ABORT: case OPT_ABORT:
arguments->abort = 1; arguments->abort = 1;
break; break;
#ifdef WEBSOCKET
case 'R': case 'R':
arguments->restful = true; arguments->restful = true;
arguments->cloud = false; arguments->cloud = false;
...@@ -192,6 +201,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) { ...@@ -192,6 +201,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
fprintf(stderr, "Invalid -t option\n"); fprintf(stderr, "Invalid -t option\n");
} }
break; break;
#endif
default: default:
return ARGP_ERR_UNKNOWN; return ARGP_ERR_UNKNOWN;
} }
...@@ -245,6 +255,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -245,6 +255,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
argp_parse(&argp, argc, argv, 0, 0, arguments); argp_parse(&argp, argc, argv, 0, 0, arguments);
#ifdef WEBSOCKET
if (args.dsn == NULL) { if (args.dsn == NULL) {
if (args.cloud) { if (args.cloud) {
args.dsn = getenv("TDENGINE_CLOUD_DSN"); args.dsn = getenv("TDENGINE_CLOUD_DSN");
...@@ -255,6 +266,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -255,6 +266,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} else { } else {
args.cloud = true; args.cloud = true;
} }
#endif
if (arguments->abort) { if (arguments->abort) {
#ifndef _ALPINE #ifndef _ALPINE
......
...@@ -37,9 +37,11 @@ void *cancelHandler(void *arg) { ...@@ -37,9 +37,11 @@ void *cancelHandler(void *arg) {
taosMsleep(10); taosMsleep(10);
continue; continue;
} }
#ifdef WEBSOCKET
if (args.restful || args.cloud) { if (args.restful || args.cloud) {
stop_fetch = true; stop_fetch = true;
} }
#endif
#ifdef LINUX #ifdef LINUX
int64_t rid = atomic_val_compare_exchange_64(&result, result, 0); int64_t rid = atomic_val_compare_exchange_64(&result, result, 0);
SSqlObj* pSql = taosAcquireRef(tscObjRef, rid); SSqlObj* pSql = taosAcquireRef(tscObjRef, rid);
...@@ -81,7 +83,6 @@ SShellArguments args = {.host = NULL, ...@@ -81,7 +83,6 @@ SShellArguments args = {.host = NULL,
.user = NULL, .user = NULL,
.database = NULL, .database = NULL,
.timezone = NULL, .timezone = NULL,
.restful = false,
.is_raw_time = false, .is_raw_time = false,
.is_use_passwd = false, .is_use_passwd = false,
.dump_config = false, .dump_config = false,
...@@ -93,9 +94,12 @@ SShellArguments args = {.host = NULL, ...@@ -93,9 +94,12 @@ SShellArguments args = {.host = NULL,
.pktNum = 100, .pktNum = 100,
.pktType = "TCP", .pktType = "TCP",
.netTestRole = NULL, .netTestRole = NULL,
#ifdef WEBSOCKET
.restful = false,
.cloud = true, .cloud = true,
.dsn = NULL, .dsn = NULL,
.timeout = 10, .timeout = 10,
#endif
}; };
/* /*
...@@ -135,6 +139,7 @@ int main(int argc, char* argv[]) { ...@@ -135,6 +139,7 @@ int main(int argc, char* argv[]) {
exit(0); exit(0);
} }
#ifdef WEBSOCKET
if (args.restful) { if (args.restful) {
args.dsn = calloc(1, 1024); args.dsn = calloc(1, 1024);
...@@ -148,6 +153,7 @@ int main(int argc, char* argv[]) { ...@@ -148,6 +153,7 @@ int main(int argc, char* argv[]) {
snprintf(args.dsn, 1024, "ws://%s:%d/rest/ws",args.host, args.port); snprintf(args.dsn, 1024, "ws://%s:%d/rest/ws",args.host, args.port);
} }
#endif
/* Initialize the shell */ /* Initialize the shell */
shellInit(&args); shellInit(&args);
......
...@@ -62,12 +62,14 @@ void printHelp() { ...@@ -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%s\n", indent, indent, "Packet length used for net test, default is 1000 bytes.");
printf("%s%s\n", indent, "-N"); printf("%s%s\n", indent, "-N");
printf("%s%s%s\n", indent, indent, "Packet numbers used for net test, default is 100."); 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\n", indent, "-R");
printf("%s%s%s\n", indent, indent, "Connect and interact with TDengine use restful."); printf("%s%s%s\n", indent, indent, "Connect and interact with TDengine use restful.");
printf("%s%s\n", indent, "-E"); 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%s\n", indent, indent, "The DSN to use when connecting TDengine's cloud services.");
printf("%s%s\n", indent, "-t"); printf("%s%s\n", indent, "-t");
printf("%s%s%s\n", indent, indent, "The timeout seconds for websocekt to interact."); printf("%s%s%s\n", indent, indent, "The timeout seconds for websocekt to interact.");
#endif
printf("%s%s\n", indent, "-S"); 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%s\n", indent, indent, "Packet type used for net test, default is TCP.");
printf("%s%s\n", indent, "-V"); printf("%s%s\n", indent, "-V");
...@@ -82,7 +84,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -82,7 +84,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for host // for host
if (strcmp(argv[i], "-h") == 0) { if (strcmp(argv[i], "-h") == 0) {
if (i < argc - 1) { if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false; arguments->cloud = false;
#endif
arguments->host = argv[++i]; arguments->host = argv[++i];
} else { } else {
fprintf(stderr, "option -h requires an argument\n"); fprintf(stderr, "option -h requires an argument\n");
...@@ -114,7 +118,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -114,7 +118,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
// for management port // for management port
else if (strcmp(argv[i], "-P") == 0) { else if (strcmp(argv[i], "-P") == 0) {
if (i < argc - 1) { if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false; arguments->cloud = false;
#endif
arguments->port = atoi(argv[++i]); arguments->port = atoi(argv[++i]);
} else { } else {
fprintf(stderr, "option -P requires an argument\n"); fprintf(stderr, "option -P requires an argument\n");
...@@ -138,7 +144,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -138,7 +144,9 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} }
} else if (strcmp(argv[i], "-c") == 0) { } else if (strcmp(argv[i], "-c") == 0) {
if (i < argc - 1) { if (i < argc - 1) {
#ifdef WEBSOCKET
arguments->cloud = false; arguments->cloud = false;
#endif
char *tmp = argv[++i]; char *tmp = argv[++i];
if (strlen(tmp) >= TSDB_FILENAME_LEN) { if (strlen(tmp) >= TSDB_FILENAME_LEN) {
fprintf(stderr, "config file path: %s overflow max len %d\n", tmp, TSDB_FILENAME_LEN - 1); 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) { ...@@ -220,6 +228,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#ifdef WEBSOCKET
else if (strcmp(argv[i], "-R") == 0) { else if (strcmp(argv[i], "-R") == 0) {
arguments->cloud = false; arguments->cloud = false;
...@@ -243,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -243,6 +252,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#endif
else if (strcmp(argv[i], "-V") == 0) { else if (strcmp(argv[i], "-V") == 0) {
printVersion(); printVersion();
...@@ -258,6 +268,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -258,6 +268,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
#ifdef WEBSOCKET
if (args.dsn == NULL) { if (args.dsn == NULL) {
if (args.cloud) { if (args.cloud) {
args.dsn = getenv("TDENGINE_CLOUD_DSN"); args.dsn = getenv("TDENGINE_CLOUD_DSN");
...@@ -274,6 +285,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) { ...@@ -274,6 +285,7 @@ void shellParseArgument(int argc, char *argv[], SShellArguments *arguments) {
} else { } else {
args.cloud = true; args.cloud = true;
} }
#endif
} }
void shellPrintContinuePrompt() { printf("%s", CONTINUE_PROMPT); } void shellPrintContinuePrompt() { printf("%s", CONTINUE_PROMPT); }
......
...@@ -5,48 +5,46 @@ ADD_SUBDIRECTORY(monitor) ...@@ -5,48 +5,46 @@ ADD_SUBDIRECTORY(monitor)
IF (TD_WEBSOCKET) IF (TD_WEBSOCKET)
MESSAGE("${Green} use libtaos-ws${ColourReset}") 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") "${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") MESSAGE("target is newer than fetch head")
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(taosws-rs ExternalProject_Add(taosws-rs
PREFIX "taosws-rs" PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS off BUILD_ALWAYS off
DEPENDS taos DEPENDS taos
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config" CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND PATCH_COMMAND
COMMAND git clean -f -d COMMAND git clean -f -d
BUILD_COMMAND BUILD_COMMAND
COMMAND cargo build --release -p taos-ws-sys COMMAND cargo build --release -p taos-ws-sys
COMMAND ./taos-ws-sys/ci/package.sh COMMAND ./taos-ws-sys/ci/package.sh
INSTALL_COMMAND INSTALL_COMMAND
COMMAND cmake -E copy target/libtaosws/libtaosws.so ${CMAKE_BINARY_DIR}/build/lib 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 make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include
) )
ELSE () ELSE ()
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(taosws-rs ExternalProject_Add(taosws-rs
PREFIX "taosws-rs" PREFIX "taosws-rs"
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/taosws-rs
BUILD_ALWAYS on BUILD_ALWAYS on
DEPENDS taos DEPENDS taos
BUILD_IN_SOURCE 1 BUILD_IN_SOURCE 1
CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config" CONFIGURE_COMMAND cmake -E echo "taosws-rs no need cmake to config"
PATCH_COMMAND PATCH_COMMAND
COMMAND git clean -f -d COMMAND git clean -f -d
BUILD_COMMAND BUILD_COMMAND
COMMAND cargo build --release -p taos-ws-sys COMMAND cargo build --release -p taos-ws-sys
COMMAND ./taos-ws-sys/ci/package.sh COMMAND ./taos-ws-sys/ci/package.sh
INSTALL_COMMAND INSTALL_COMMAND
COMMAND cmake -E copy target/libtaosws/libtaosws.so ${CMAKE_BINARY_DIR}/build/lib 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 make_directory ${CMAKE_BINARY_DIR}/build/include
COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include COMMAND cmake -E copy target/libtaosws/taosws.h ${CMAKE_BINARY_DIR}/build/include
) )
ENDIF()
ENDIF() ENDIF()
ENDIF () ENDIF ()
......
Subproject commit d8cf0e7e067d193cfaf3e920b6ec6cbb9b9f4165 Subproject commit 9de599dc5293e9c90bc00bc4a03f8b91ba756bc3
...@@ -45,7 +45,7 @@ INTERNAL_REPDIR=$WORKDIR/TDinternal ...@@ -45,7 +45,7 @@ INTERNAL_REPDIR=$WORKDIR/TDinternal
docker run \ docker run \
-v $INTERNAL_REPDIR:/home \ -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=$? ret=$?
exit $ret exit $ret
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册