Skip to content

Commit

Permalink
Merge branch 'develop' into feature/sentinel-select-redis-db-index
Browse files Browse the repository at this point in the history
  • Loading branch information
tysion committed Apr 20, 2024
2 parents 97a741a + 9762d6a commit e8f62d2
Show file tree
Hide file tree
Showing 893 changed files with 38,440 additions and 11,884 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Checks:
,portability-*\
,readability-*\
# it will work from clang-16
#,bugprone-unchecked-optional-access\
,-bugprone-unchecked-optional-access\
,-bugprone-easily-swappable-parameters\
,-bugprone-exception-escape\
,-bugprone-implicit-widening-of-multiplication-result\
Expand Down
66 changes: 66 additions & 0 deletions .github/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: "2.3"

services:
ubuntu-22.04-userver-base-ci:
image: ghcr.io/userver-framework/ubuntu-22.04-userver-base-ci:latest
container_name: ubuntu-22.04-userver-base-ci
networks:
- nexportfalse
environment:
- CCACHE_DIR=/userver/.ccache
- CCACHE_HASHDIR
- CCACHE_NOHASHDIR
- CCACHE_PREFIX
- CCACHE_SIZE=${CCACHE_SIZE:-10G}
volumes:
- ..:/userver:rw
ports:
- 8080:8080
working_dir: /userver
entrypoint: /userver/scripts/docker/run_as_user.sh

ubuntu-22.04-userver-base:
image: ghcr.io/userver-framework/ubuntu-22.04-userver-base:latest
container_name: ubuntu-22.04-userver-base
networks:
- nexportfalse
environment:
- CCACHE_DIR=/userver/.ccache
- CCACHE_HASHDIR
- CCACHE_NOHASHDIR
- CCACHE_PREFIX
- CCACHE_SIZE=${CCACHE_SIZE:-10G}
volumes:
- ..:/userver:rw
ports:
- 8080:8080
working_dir: /userver
entrypoint: /userver/scripts/docker/run_as_user.sh

run-ydb:
image: cr.yandex/yc/yandex-docker-local-ydb:latest
privileged: true
mem_limit: 8G
environment:
- GRPC_TLS_PORT=2135
- GRPC_PORT=2136
- MON_PORT=8765
ports:
- 2135:2135
- 2136:2136
- 8765:8765
networks:
- overlay
hostname: localhost


networks:
nexportfalse:
external: false
name: nexportfalse
enable_ipv6: true
ipam:
config:
- subnet: 2001:db8:b::/64
gateway: 2001:db8:b::1
overlay:
2 changes: 1 addition & 1 deletion .github/workflows/ci-conan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Install packages
run: |
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip ccache virtualenv
sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip python3-venv ccache
pip install "conan>=1.51.0,<2.0.0"
conan profile new --detect default && conan profile update settings.compiler.libcxx=libstdc++11 default
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
-DUSERVER_FEATURE_REDIS_HI_MALLOC=1
-DUSERVER_NO_WERROR=1
-DUSERVER_SANITIZE="ub addr"
-DUSERVER_NAMESPACE=userver
-DUSERVER_NAMESPACE_BEGIN="namespace userver {"
-DUSERVER_NAMESPACE_END="}"
-DCMAKE_BUILD_TYPE=Debug
os: ubuntu-20.04
info: g++-9 + debug + sanitize addr+ub
Expand Down Expand Up @@ -85,7 +88,9 @@ jobs:
- name: Free disk space
run: |
df -h
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/lib/php* /opt/ghc || true
# See https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /usr/lib/php* /opt/ghc \
/usr/local/share/powershell /usr/share/swift /usr/local/.ghcup || true
df -h
- name: Install packages
Expand All @@ -95,12 +100,16 @@ jobs:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 8919F6BD2B48D754
echo "deb https://packages.clickhouse.com/deb stable main" | sudo tee /etc/apt/sources.list.d/clickhouse.list
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
chmod +x mariadb_repo_setup
sudo ./mariadb_repo_setup
# Adding mariadb repositories (from https://www.linuxcapable.com/how-to-install-mariadb-on-ubuntu-linux/ )
curl -fsSL http://mirror.mariadb.org/PublicKey_v2 | sudo gpg --dearmor -o "/usr/share/keyrings/mariadb.gpg"
sudo chmod a+r "/usr/share/keyrings/mariadb.gpg"
# Restore the correct URL after https://jira.mariadb.org/browse/MDBF-651
#echo "deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/mariadb.gpg] https://deb.mariadb.org/10.11/ubuntu $(lsb_release -cs) main" \
# | tee /etc/apt/sources.list.d/mariadb.list
echo "deb [arch=amd64,arm64,ppc64el signed-by=/usr/share/keyrings/mariadb.gpg] https://mirror.kumi.systems/mariadb/repo/10.11/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/mariadb.list
sudo apt update
sudo apt install --allow-downgrades -y clickhouse-common-static libmariadb-dev $(cat scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ')
sudo apt install --allow-downgrades -y clickhouse-common-static redis-server postgresql $(cat scripts/docs/en/deps/${{matrix.os}}.md | tr '\n' ' ')
if [ "${{matrix.os}}" = "ubuntu-22.04" ]; then
# GH Ubuntu image has libpq version 15+ from pg's repo that is API incompatible with postgresql-14.
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7FCC7D46ACCC4CF8
Expand Down Expand Up @@ -134,7 +143,7 @@ jobs:
[[ -z "${GITHUB_BASE_REF}" ]] && BRANCH_VAR=HEAD~1 || BRANCH_VAR=origin/${GITHUB_BASE_REF}
echo "${BRANCH_VAR}"
echo "$(git diff --name-only ${BRANCH_VAR})"
EXCLUDE_PATTERNS="-e '.pb.cc' -e '.pb.cpp' -e 'benchmark.cpp' -e '/boost_stacktrace/' -e '/pq-extra/' -e '/tools/' -e 'third_party' "
EXCLUDE_PATTERNS="-e '.pb.cc' -e '.pb.cpp' -e 'benchmark.cpp' -e '/pq-extra/' -e '/tools/' -e 'third_party' "
LIST_CHECK_FILES=$(git diff --name-only ${BRANCH_VAR} | grep --color=never '.cpp' | grep -v ${EXCLUDE_PATTERNS} | tr '\n' ' ')
if [[ -n ${LIST_CHECK_FILES} ]]
then
Expand Down
42 changes: 26 additions & 16 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
matrix:
include:
- cmake-flags: >-
-DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
-DUSERVER_FEATURE_MYSQL=0
-DUSERVER_FEATURE_MONGODB=0
-DUSERVER_FEATURE_POSTGRESQL=0
Expand All @@ -24,35 +23,35 @@ jobs:
-DUSERVER_FEATURE_GRPC=0
-DUSERVER_FEATURE_RABBITMQ=0
-DCMAKE_CXX_STANDARD=17
image: userver-ubuntu-core
image: ubuntu-22.04-userver-base
info: ubuntu + clang + cxx17 + core
id: ubuntu_clang_cxx17_core
- cmake-flags: >-
-DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
-DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16
-DUSERVER_FEATURE_MYSQL=1
-DCMAKE_CXX_STANDARD=17
image: userver-ubuntu
image: ubuntu-22.04-userver-base-ci
info: ubuntu + clang + cxx17
id: ubuntu_clang_cxx17
- cmake-flags: >-
-DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11
-DUSERVER_FEATURE_MYSQL=1
-DCMAKE_CXX_STANDARD=17
image: userver-ubuntu
image: ubuntu-22.04-userver-base-ci
info: ubuntu + gcc + cxx17
id: ubuntu_gcc_cxx17
- cmake-flags: >-
-DCMAKE_CXX_COMPILER=clang++-14 -DCMAKE_C_COMPILER=clang-14
-DCMAKE_CXX_COMPILER=clang++-16 -DCMAKE_C_COMPILER=clang-16
-DUSERVER_FEATURE_MYSQL=1
-DCMAKE_CXX_STANDARD=20
image: userver-ubuntu
image: ubuntu-22.04-userver-base-ci
info: ubuntu + clang + cxx20
id: ubuntu_clang_cxx20
- cmake-flags: >-
-DCMAKE_CXX_COMPILER=g++-11 -DCMAKE_C_COMPILER=gcc-11
-DUSERVER_FEATURE_MYSQL=1
-DCMAKE_CXX_STANDARD=20
image: userver-ubuntu
image: ubuntu-22.04-userver-base-ci
info: ubuntu + gcc + cxx20
id: ubuntu_gcc_cxx20
Expand All @@ -61,6 +60,10 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Install packages
run: |
sudo apt install -y docker-compose
- name: Reuse ccache directory
uses: actions/cache@v2
with:
Expand All @@ -72,17 +75,24 @@ jobs:
ccache-
- name: Setup ccache
run: docker-compose run --rm ${{ matrix.image }} bash -c 'ccache -M 2.0GB
&& ccache -s'
run: docker-compose -f .github/docker-compose.yml run --rm ${{ matrix.image
}} bash -c 'ccache -M 2.0GB && ccache -s'

- name: Cmake
run: docker-compose run --rm ${{ matrix.image }} bash -c 'cmake -DUSERVER_GOOGLE_COMMON_PROTOS=/app/api-common-protos
- name: CMake
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'cmake -DUSERVER_GOOGLE_COMMON_PROTOS=/app/api-common-protos
${{ matrix.cmake-flags }} -B./build -S./'
- name: Build
run: docker-compose run --rm ${{ matrix.image }} bash -c 'cd /userver/build
&& make -j $(nproc)'
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'cd /userver/build && make -j $(nproc)'
- name: Run tests
run: docker-compose run --rm ${{ matrix.image }} bash -c 'cd /userver/build
&& ulimit -n 4096 && ctest -V'
run: >-
docker-compose -f .github/docker-compose.yml
run --rm ${{ matrix.image}} bash -c
'cd /userver/build && ulimit -n 4096 && ctest -V'
34 changes: 34 additions & 0 deletions .github/workflows/publish-ubuntu-22.04-base-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and publish ubuntu-22.04-userver-base images

'on':
schedule:
- cron: '30 5 * * 6' # Every Saturday at 5:30
workflow_dispatch:
release:
types: [published]

jobs:
build_and_publish_base:
runs-on: ubuntu-22.04
name: Build and publish base images
permissions:
contents: read
packages: write
env:
USERVER_IMAGE_TAG: ${{ github.event.release.tag_name || 'latest' }}
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the ubuntu-22.04-userver-base Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-base:${USERVER_IMAGE_TAG} -f scripts/docker/base-ubuntu-22.04.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver-base:${USERVER_IMAGE_TAG}
- name: Build the ubuntu-22.04-userver-pg Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-base-ci:${USERVER_IMAGE_TAG} -f scripts/docker/base-ubuntu-22.04-ci.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver-base-ci:${USERVER_IMAGE_TAG}
34 changes: 34 additions & 0 deletions .github/workflows/publish-ubuntu-22.04-images.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build and publish ubuntu-22.04-userver images

'on':
schedule:
- cron: '30 5 * * 7' # Every Sunday at 5:30
workflow_dispatch:
release:
types: [published]

jobs:
build_and_publish:
runs-on: ubuntu-22.04
name: Build and publish images
permissions:
contents: read
packages: write
env:
USERVER_IMAGE_TAG: ${{ github.event.release.tag_name || 'latest' }}
steps:
- uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the ubuntu-22.04-userver Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver:${USERVER_IMAGE_TAG}
- name: Build the ubuntu-22.04-userver-pg Docker image
run: |
docker build -t ghcr.io/userver-framework/ubuntu-22.04-userver-pg:${USERVER_IMAGE_TAG} -f scripts/docker/ubuntu-22.04-pg.dockerfile .
docker push ghcr.io/userver-framework/ubuntu-22.04-userver-pg:${USERVER_IMAGE_TAG}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
.cores/
/build*/
/cmake-build-*/
/cmake/cmake_generated/
/docs/
/third_party/
CMakeLists.txt.user
compile_commands.json
tags
Expand Down
Loading

0 comments on commit e8f62d2

Please sign in to comment.