Skip to content

Commit 5c6b40c

Browse files
authored
build: upgrade thirdparty to 0.6.0 (#3557)
* build: upgrade thirdparty to 0.6.0 * fix: dockerfile * fix(single_tablet_test): pure virtual method call called
1 parent 671897e commit 5c6b40c

File tree

5 files changed

+45
-30
lines changed

5 files changed

+45
-30
lines changed

Makefile

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -139,29 +139,39 @@ THIRD_PARTY_BUILD_DIR ?= $(MAKEFILE_DIR)/.deps
139139
THIRD_PARTY_SRC_DIR ?= $(MAKEFILE_DIR)/thirdsrc
140140
THIRD_PARTY_DIR ?= $(THIRD_PARTY_BUILD_DIR)/usr
141141

142-
# trick: for those compile inside hybridsql docker image, thirdparty is pre-installed in /deps/usr.
143-
# we check this by asserting if the environment variable '$THIRD_PARTY_DIR' is defined to '/deps/usr',
144-
# if true, thirdparty download is skipped
145-
# zetasql check separately since it update more frequently:
146-
# it will updated if the variable '$ZETASQL_VERSION' (defined in docker) not equal to that defined in current code
147-
override GREP_PATTERN = "set(ZETASQL_VERSION"
142+
override ZETASQL_PATTERN = "set(ZETASQL_VERSION"
143+
override THIRD_PATTERN = "set(HYBRIDSQL_ASSERTS_VERSION"
144+
new_zetasql_version := $(shell grep $(ZETASQL_PATTERN) third-party/cmake/FetchZetasql.cmake | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
145+
new_third_version := $(shell grep $(THIRD_PATTERN) third-party/CMakeLists.txt | sed 's/[^0-9.]*\([0-9.]*\).*/\1/')
146+
148147
thirdparty-fast:
149148
@if [ $(THIRD_PARTY_DIR) != "/deps/usr" ] ; then \
150149
echo "[deps]: install thirdparty and zetasql"; \
151150
$(MAKE) thirdparty; \
152-
elif [ -n "$(ZETASQL_VERSION)" ]; then \
153-
new_zetasql_version=$(shell grep $(GREP_PATTERN) third-party/cmake/FetchZetasql.cmake | sed 's/[^0-9.]*\([0-9.]*\).*/\1/'); \
154-
if [ "$$new_zetasql_version" != "$(ZETASQL_VERSION)" ] ; then \
155-
echo "[deps]: thirdparty up-to-date. reinstall zetasql from $(ZETASQL_VERSION) to $$new_zetasql_version"; \
156-
$(MAKE) thirdparty-configure; \
157-
$(CMAKE_PRG) --build $(THIRD_PARTY_BUILD_DIR) --target zetasql; \
158-
else \
159-
echo "[deps]: all up-to-date. zetasql already installed with version: $(ZETASQL_VERSION)"; \
160-
fi; \
161151
else \
162-
echo "[deps]: install zetasql only"; \
163152
$(MAKE) thirdparty-configure; \
164-
$(CMAKE_PRG) --build $(THIRD_PARTY_BUILD_DIR) --target zetasql; \
153+
if [ -n "$(ZETASQL_VERSION)" ] ; then \
154+
if [ "$(new_zetasql_version)" != "$(ZETASQL_VERSION)" ] ; then \
155+
echo "[deps]: installing zetasql from $(ZETASQL_VERSION) to $(new_zetasql_version)"; \
156+
$(CMAKE_PRG) --build $(THIRD_PARTY_BUILD_DIR) --target zetasql; \
157+
else \
158+
echo "[deps]: zetasql up-to-date with version: $(ZETASQL_VERSION)"; \
159+
fi; \
160+
else \
161+
echo "[deps]: installing latest zetasql"; \
162+
$(CMAKE_PRG) --build $(THIRD_PARTY_BUILD_DIR) --target zetasql; \
163+
fi; \
164+
if [ -n "$(THIRDPARTY_VERSION)" ]; then \
165+
if [ "$(new_third_version)" != "$(THIRDPARTY_VERSION)" ] ; then \
166+
echo "[deps]: installing thirdparty from $(THIRDPARTY_VERSION) to $(new_third_version)"; \
167+
$(CMAKE_PRG) --build $(THIRD_PARTY_BUILD_DIR) --target hybridsql-asserts; \
168+
else \
169+
echo "[deps]: thirdparty up-to-date: $(THIRDPARTY_VERSION)"; \
170+
fi ; \
171+
else \
172+
echo "[deps]: installing latest thirdparty"; \
173+
$(CMAKE_PRG) --build $(THIRD_PARTY_BUILD_DIR) --target hybridsql-asserts; \
174+
fi ; \
165175
fi
166176

167177
# third party compiled code install to 'OpenMLDB/.deps/usr', source code install to 'OpenMLDB/thirdsrc'

docker/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515

1616
FROM centos:7
1717

18-
ARG ZETASQL_VERSION=0.3.0
19-
ARG THIRDPARTY_VERSION=0.5.2
18+
ARG ZETASQL_VERSION=0.3.1
19+
ARG THIRDPARTY_VERSION=0.6.0
2020
ARG TARGETARCH
2121

2222
LABEL org.opencontainers.image.source https://github.com/4paradigm/OpenMLDB
@@ -28,8 +28,6 @@ RUN yum update -y && yum install -y centos-release-scl epel-release && \
2828
curl -Lo lcov-1.15-1.noarch.rpm https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15-1.noarch.rpm && \
2929
yum localinstall -y lcov-1.15-1.noarch.rpm && \
3030
yum clean all && rm -v lcov-1.15-1.noarch.rpm && \
31-
curl -Lo apache-maven-3.6.3-bin.tar.gz https://mirrors.ocf.berkeley.edu/apache/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz && \
32-
tar xzf apache-maven-3.6.3-bin.tar.gz -C /usr/local --strip-components=1 && \
3331
curl -Lo zookeeper.tar.gz https://archive.apache.org/dist/zookeeper/zookeeper-3.4.14/zookeeper-3.4.14.tar.gz && \
3432
mkdir -p /deps/src && \
3533
tar xzf zookeeper.tar.gz -C /deps/src && \

src/nameserver/name_server_impl.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ class NameServerImpl : public NameServer {
111111
NameServerImpl();
112112

113113
~NameServerImpl() override;
114-
114+
void CloseThreadpool() {
115+
running_.store(false, std::memory_order_release);
116+
thread_pool_.Stop(true);
117+
task_thread_pool_.Stop(true);
118+
UpdateTableStatus();
119+
}
115120
bool Init(const std::string& real_endpoint);
116121
bool Init(const std::string& zk_cluster, const std::string& zk_path, const std::string& endpoint,
117122
const std::string& real_endpoint);

src/sdk/mini_cluster.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ class MiniCluster {
105105
}
106106
}
107107
sleep(4);
108-
::openmldb::nameserver::NameServerImpl* nameserver = new ::openmldb::nameserver::NameServerImpl();
108+
nameserver = new ::openmldb::nameserver::NameServerImpl();
109109
bool ok = nameserver->Init(zk_cluster_, zk_path_, ns_endpoint, "");
110110
if (!ok) {
111111
return false;
@@ -135,6 +135,7 @@ class MiniCluster {
135135
}
136136

137137
void Close() {
138+
nameserver->CloseThreadpool();
138139
ns_.Stop(10);
139140
ns_.Join();
140141

@@ -207,7 +208,7 @@ class MiniCluster {
207208
tb_clients_.emplace(tb_endpoint, client);
208209
return true;
209210
}
210-
211+
::openmldb::nameserver::NameServerImpl* nameserver;
211212
int32_t zk_port_;
212213
brpc::Server ns_;
213214
int32_t tablet_num_;
@@ -250,7 +251,7 @@ class StandaloneEnv {
250251
FLAGS_sync_deploy_stats_timeout = 2000;
251252
ns_port_ = GenRand();
252253
std::string ns_endpoint = "127.0.0.1:" + std::to_string(ns_port_);
253-
::openmldb::nameserver::NameServerImpl* nameserver = new ::openmldb::nameserver::NameServerImpl();
254+
nameserver = new ::openmldb::nameserver::NameServerImpl();
254255
bool ok = nameserver->Init("", "", ns_endpoint, "");
255256
if (!ok) {
256257
return false;
@@ -278,6 +279,7 @@ class StandaloneEnv {
278279
}
279280

280281
void Close() {
282+
nameserver->CloseThreadpool();
281283
ns_.Stop(10);
282284
ns_.Join();
283285
tb_server_.Stop(10);
@@ -323,7 +325,7 @@ class StandaloneEnv {
323325
tb_client_ = client;
324326
return true;
325327
}
326-
328+
::openmldb::nameserver::NameServerImpl* nameserver;
327329
brpc::Server ns_;
328330
brpc::Server tb_server_;
329331
std::string ns_endpoint_;

third-party/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ set(MAKEOPTS "$ENV{MAKEOPTS}" CACHE STRING "Extra options to make")
6868
message(STATUS "Install bundled dependencies into ${DEPS_INSTALL_DIR}")
6969

7070
set(HYBRIDSQL_ASSERTS_HOME https://github.com/4paradigm/hybridsql-asserts)
71-
set(HYBRIDSQL_ASSERTS_VERSION 0.5.2)
71+
set(HYBRIDSQL_ASSERTS_VERSION 0.6.0)
7272

7373
function(get_linux_lsb_release_information)
7474
execute_process(COMMAND bash ${CMAKE_SOURCE_DIR}/get-lsb-release.sh
@@ -90,17 +90,17 @@ function(init_hybridsql_thirdparty_urls)
9090
else()
9191
if (LSB_RELEASE_ID_SHORT STREQUAL "centos")
9292
set(HYBRIDSQL_ASSERTS_URL "${HYBRIDSQL_ASSERTS_HOME}/releases/download/v${HYBRIDSQL_ASSERTS_VERSION}/thirdparty-${HYBRIDSQL_ASSERTS_VERSION}-linux-gnu-x86_64-centos.tar.gz" PARENT_SCOPE)
93-
set(HYBRIDSQL_ASSERTS_HASH 919ee7aee4c89846f4e242530519b3c34a34567ddcf9f4361d413a44e2f7408c PARENT_SCOPE)
93+
set(HYBRIDSQL_ASSERTS_HASH c415dfdc95a127cdce888aec84c7fa3c02f3c9cb973805dcf23b54517e422e36 PARENT_SCOPE)
9494
elseif(LSB_RELEASE_ID_SHORT STREQUAL "ubuntu")
9595
set(HYBRIDSQL_ASSERTS_URL "${HYBRIDSQL_ASSERTS_HOME}/releases/download/v${HYBRIDSQL_ASSERTS_VERSION}/thirdparty-${HYBRIDSQL_ASSERTS_VERSION}-linux-gnu-x86_64-ubuntu.tar.gz" PARENT_SCOPE)
96-
set(HYBRIDSQL_ASSERTS_HASH 8bb1f7685bf778539e1f4ba499020504ebc89e8cefa9a294aa0122578ca70716 PARENT_SCOPE)
96+
set(HYBRIDSQL_ASSERTS_HASH 8c95b5fd539c8362d934ae58879d9ae1c27bc0977ca09cc8316ba207e8aaaf1e PARENT_SCOPE)
9797
else()
9898
message(FATAL_ERROR "no pre-compiled thirdparty for your operation system, try compile thirdparty from source with '-DBUILD_BUNDLED=ON'")
9999
endif()
100100
endif()
101101
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
102102
set(HYBRIDSQL_ASSERTS_URL "${HYBRIDSQL_ASSERTS_HOME}/releases/download/v${HYBRIDSQL_ASSERTS_VERSION}/thirdparty-${HYBRIDSQL_ASSERTS_VERSION}-darwin-i386.tar.gz" PARENT_SCOPE)
103-
set(HYBRIDSQL_ASSERTS_HASH 663b0d945c95034b1e17411f3e795f98053bf248860a60025c7802634ce526d8 PARENT_SCOPE)
103+
set(HYBRIDSQL_ASSERTS_HASH 062e606f1d76fe27003bdc23e643305bfa032eadec8c075e7ce6dc22d70f5044 PARENT_SCOPE)
104104
endif()
105105
endfunction()
106106

0 commit comments

Comments
 (0)