Skip to content

Commit

Permalink
feat docker: build with gcc and clickhouse
Browse files Browse the repository at this point in the history
Tests: протестировано CI
Pull Request resolved: #845

Co-authored-by: fdr400 <[email protected]>
commit_hash:665de41618f4ac8bf53ea60938bca6417070bf53
  • Loading branch information
segoon authored and fdr400 committed Jan 28, 2025
1 parent 16cb80e commit b77bb86
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
5 changes: 4 additions & 1 deletion cmake/modules/Findclickhouse-cpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ _userver_module_find_include(
)

_userver_module_find_library(
NAMES clickhouse-cpp-lib
# on Linux, clickhouse should be linked dynamically
# because new clickhouse versions have broker install
# with static libraries
NAMES libclickhouse-cpp-lib.so clickhouse-cpp-lib
PATH_SUFFIXES
clickhouse-cpp
yandex/clickhouse-cpp
Expand Down
4 changes: 2 additions & 2 deletions scripts/clickhouse/ubuntu-install-clickhouse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Exit on any error and treat unset variables as errors, print all commands
set -euox pipefail

CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.3.0}
CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.5.1}

# Installing Clickhouse C++ client libraries from sources
git clone --depth 1 -b ${CLICKHOUSE_VERSION} https://github.com/ClickHouse/clickhouse-cpp.git
(cd clickhouse-cpp && mkdir build && cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. && make -j $(nproc) && make install)
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON .. && make -j $(nproc) && make install)
rm -rf clickhouse-cpp/
2 changes: 1 addition & 1 deletion scripts/docker/setup-base-ubuntu-22.04-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ apt clean all

# You could override those versions from command line
export AMQP_VERSION=${AMQP_VERSION:=v4.3.18}
export CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.3.0}
export CLICKHOUSE_VERSION=${CLICKHOUSE_VERSION:=v2.5.1}
export ROCKSDB_VERSION=${ROCKSDB_VERSION:=v8.9.1}
export POSTGRESQL_VERSION=${POSTGRESQL_VERSION:=14}

Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/ubuntu-24.04-base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ RUN \


COPY scripts/clickhouse/ubuntu-install-clickhouse.sh /userver_tmp/
# RUN /userver_tmp/ubuntu-install-clickhouse.sh
RUN /userver_tmp/ubuntu-install-clickhouse.sh

COPY scripts/rabbitmq/ubuntu_install_rabbitmq_dev.sh /userver_tmp/
RUN /userver_tmp/ubuntu_install_rabbitmq_dev.sh
4 changes: 1 addition & 3 deletions scripts/docker/ubuntu-24.04-userver.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ FROM ghcr.io/userver-framework/ubuntu-24.04-userver-base:latest
# * all userver test dependencies (e.g. for testsuite)
# * built userver itself

RUN apt install -y clang-18
RUN git clone https://github.com/userver-framework/userver \
&& cd userver \
&& BUILD_OPTIONS='-DUSERVER_FEATURE_CLICKHOUSE=OFF -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_COMPILER=clang-18' \
./scripts/build_and_install_all.sh \
&& ./scripts/build_and_install_all.sh \
&& cd .. \
&& rm -rf userver/

0 comments on commit b77bb86

Please sign in to comment.