Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ jobs:
-DUSERVER_BUILD_ALL_COMPONENTS=1
-DUSERVER_BUILD_SAMPLES=1
-DUSERVER_BUILD_TESTS=1
-DUSERVER_DOWNLOAD_PACKAGE_YDBCPPSDK=OFF
-DUSERVER_FORCE_DOWNLOAD_ABSEIL=OFF
os: ubuntu-24.04
info: gcc-13 + release
id: ubuntu24_gcc13_release
Expand Down Expand Up @@ -129,6 +131,10 @@ jobs:
| sudo tee -a /etc/apt/sources.list.d/mongodb-org-7.0.list
# Mongo is not officially supported on Ubuntu 24.04, so install it from jammy

- name: Install YDB C++ SDK
run: |
sudo ./scripts/ydb/install-ydb-cpp-sdk-debs.sh

- name: Install common deps
run: |
sudo apt update
Expand Down
3 changes: 2 additions & 1 deletion .mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -5370,6 +5370,7 @@
"scripts/uctl/uctl.py":"taxi/uservices/userver/scripts/uctl/uctl.py",
"scripts/userver-create-service":"taxi/uservices/userver/scripts/userver-create-service",
"scripts/userver-create-service.py":"taxi/uservices/userver/scripts/userver-create-service.py",
"scripts/ydb/install-ydb-cpp-sdk-debs.sh":"taxi/uservices/userver/scripts/ydb/install-ydb-cpp-sdk-debs.sh",
"scylla/CMakeLists.txt":"taxi/uservices/userver/scylla/CMakeLists.txt",
"scylla/README.md":"taxi/uservices/userver/scylla/README.md",
"scylla/dynamic_configs/SCYLLA_DEFAULT_COMMAND_CONTROL.yaml":"taxi/uservices/userver/scylla/dynamic_configs/SCYLLA_DEFAULT_COMMAND_CONTROL.yaml",
Expand Down Expand Up @@ -6687,4 +6688,4 @@
"ydb/utest/include/userver/ydb/tests/topic_writer_mock.hpp":"taxi/uservices/userver/ydb/utest/include/userver/ydb/tests/topic_writer_mock.hpp",
"ydb/utest/include/userver/ydb/tests/write_session_mock.hpp":"taxi/uservices/userver/ydb/utest/include/userver/ydb/tests/write_session_mock.hpp",
"ydb/utest/src/utest/topic_writer_mock.cpp":"taxi/uservices/userver/ydb/utest/src/utest/topic_writer_mock.cpp"
}
}
37 changes: 36 additions & 1 deletion cmake/SetupYdbCppSDK.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# @ingroup download
option(USERVER_DOWNLOAD_PACKAGE_YDBCPPSDK "Download and setup ydb-cpp-sdk" ${USERVER_DOWNLOAD_PACKAGES})

set(USERVER_YDBCPPSDK_VERSION 3.21.0)
set(USERVER_YDBCPPSDK_COMPONENTS
Coordination
Driver
FederatedTopic
Iam
Operation
Query
Result
Scheme
SolomonStats
Table
Topic
Types
)

set(USERVER_YDBCPPSDK_DEB_PREFIX /usr/share/yandex)
if(EXISTS "${USERVER_YDBCPPSDK_DEB_PREFIX}/lib/cmake/ydb-cpp-sdk")
list(PREPEND CMAKE_PREFIX_PATH "${USERVER_YDBCPPSDK_DEB_PREFIX}")
endif()

if(NOT USERVER_FORCE_DOWNLOAD_PACKAGES)
if(USERVER_DOWNLOAD_PACKAGE_YDBCPPSDK)
find_package(ydb-cpp-sdk ${USERVER_YDBCPPSDK_VERSION} QUIET CONFIG COMPONENTS ${USERVER_YDBCPPSDK_COMPONENTS})
else()
find_package(
ydb-cpp-sdk ${USERVER_YDBCPPSDK_VERSION} REQUIRED CONFIG COMPONENTS ${USERVER_YDBCPPSDK_COMPONENTS}
)
endif()

if(ydb-cpp-sdk_FOUND)
return()
endif()
endif()

include(DownloadUsingCPM)
include(SetupBrotli)

Expand Down Expand Up @@ -34,7 +69,7 @@ endif()

cpmaddpackage(
NAME ydb-cpp-sdk
GIT_TAG v3.19.0
GIT_TAG v${USERVER_YDBCPPSDK_VERSION}
GITHUB_REPOSITORY ydb-platform/ydb-cpp-sdk
GIT_SHALLOW TRUE
OPTIONS "Brotli_VERSION ${Brotli_VERSION}" "RAPIDJSON_INCLUDE_DIRS ${RAPIDJSON_INCLUDE_DIRS}"
Expand Down
11 changes: 5 additions & 6 deletions scripts/debian-rules
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=-lto
BUILD_DIR_RELEASE = $(CURDIR)/debian/obj-$(DEB_HOST_GNU_TYPE)-release
BUILD_DIR_DEBUG = $(CURDIR)/debian/obj-$(DEB_HOST_GNU_TYPE)-debug

# TODO: pg patch
# TODO: clickhouse
CMAKE_OPTS = \
-DUSERVER_INSTALL=ON \
-DUSERVER_BUILD_SAMPLES=ON \
-DUSERVER_BUILD_ALL_COMPONENTS=1 \
-DUSERVER_FEATURE_UTEST=ON \

# These features have no apt package for their C++ client libraries and are
# not shipped as libuserver-*-dev packages in this PPA
CMAKE_OPTS += \
-DUSERVER_FEATURE_YDB=OFF \
-DUSERVER_DOWNLOAD_PACKAGE_YDBCPPSDK=OFF \
-DUSERVER_FORCE_DOWNLOAD_ABSEIL=OFF \
-DUSERVER_FEATURE_YDB=ON \
-DUSERVER_FEATURE_CLICKHOUSE=OFF \
-DUSERVER_FEATURE_RABBITMQ=OFF \
-DUSERVER_FEATURE_PATCH_LIBPQ=OFF \
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker/ubuntu-24.04-base.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ FROM ubuntu:24.04

COPY scripts/docs/en/deps/ubuntu-24.04.md /userver_tmp/
COPY scripts/postgres/ubuntu-install-postgresql-includes.sh /userver_tmp/
COPY scripts/ydb/install-ydb-cpp-sdk-debs.sh /userver_tmp/

RUN apt update \
&& apt install -y ca-certificates curl \
&& /userver_tmp/install-ydb-cpp-sdk-debs.sh \
&& apt install -y $(cat /userver_tmp/ubuntu-24.04.md) \
&& apt install -y clang-format python3-pip \
&& python3 -m pip install --break-system-packages uv \
Expand Down
2 changes: 1 addition & 1 deletion scripts/docker/ubuntu-24.04-userver.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ RUN apt install -y pycodestyle sudo

RUN git clone https://github.com/userver-framework/userver \
&& cd userver \
&& BUILD_OPTIONS="-DUSERVER_FEATURE_GRPC_CHANNELZ=1" ./scripts/build_and_install_all.sh \
&& BUILD_OPTIONS="-DUSERVER_DOWNLOAD_PACKAGE_YDBCPPSDK=OFF -DUSERVER_FORCE_DOWNLOAD_ABSEIL=OFF -DUSERVER_FEATURE_GRPC_CHANNELZ=1 -DUSERVER_FEATURE_YDB=1" ./scripts/build_and_install_all.sh \
&& cd .. \
&& rm -rf userver/
2 changes: 2 additions & 0 deletions scripts/docs/en/deps/ubuntu-24.04.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ libssl-dev
libxxhash-dev
libyaml-cpp-dev
libyaml-cpp0.8
libydb-cpp-dev
libydb-cpp-iam-dev
libzstd-dev
netbase
ninja-build
Expand Down
2 changes: 2 additions & 0 deletions scripts/docs/en/deps/ubuntu-24.04/ydb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
libydb-cpp-dev
libydb-cpp-iam-dev
ragel
python3-jinja2
python3-sqlparse
4 changes: 4 additions & 0 deletions scripts/docs/en/userver/build/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ Paths to dependencies start from the @ref service_templates "directory of your s
Dependencies can be installed via:

```bash
YDB_DEPS_INSTALLER="https://raw.githubusercontent.com/userver-framework/userver/refs/heads/develop/scripts/ydb/install-ydb-cpp-sdk-debs.sh" && \
wget -q -O /tmp/install-ydb-cpp-sdk-debs.sh ${YDB_DEPS_INSTALLER} && \
sudo bash /tmp/install-ydb-cpp-sdk-debs.sh && \
rm /tmp/install-ydb-cpp-sdk-debs.sh && \
DEPS_FILE="https://raw.githubusercontent.com/userver-framework/userver/refs/heads/develop/scripts/docs/en/deps/ubuntu-24.04.md" && \
sudo apt install --allow-downgrades -y $(wget -q -O - ${DEPS_FILE})
```
Expand Down
34 changes: 34 additions & 0 deletions scripts/ydb/install-ydb-cpp-sdk-debs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

set -euo pipefail

readonly YDB_CPP_SDK_VERSION="${YDB_CPP_SDK_VERSION:-3.21.0}"
readonly YDB_CPP_SDK_RELEASE_URL="https://github.com/ydb-platform/ydb-cpp-sdk/releases/download/v${YDB_CPP_SDK_VERSION}"
YDB_CPP_SDK_ARCHITECTURE="$(dpkg --print-architecture)"
readonly YDB_CPP_SDK_ARCHITECTURE
YDB_CPP_SDK_DEB_DIR="$(mktemp -d)"
readonly YDB_CPP_SDK_DEB_DIR

cleanup() {
rm -rf "${YDB_CPP_SDK_DEB_DIR}"
}
trap cleanup EXIT

download_deb() {
local filename="$1"
curl \
--fail \
--location \
--retry 5 \
--retry-all-errors \
--output "${YDB_CPP_SDK_DEB_DIR}/${filename}" \
"${YDB_CPP_SDK_RELEASE_URL}/${filename}"
}

download_deb "yandex-googleapis-api-common-protos-1.0.0-Linux.deb"
download_deb "libydb-cpp-dev_${YDB_CPP_SDK_VERSION}_${YDB_CPP_SDK_ARCHITECTURE}.deb"
download_deb "libydb-cpp-iam-dev_${YDB_CPP_SDK_VERSION}_${YDB_CPP_SDK_ARCHITECTURE}.deb"

export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y --no-install-recommends "${YDB_CPP_SDK_DEB_DIR}"/*.deb
Loading