Skip to content

Commit 145eca9

Browse files
committed
Support signal thrift
1 parent ef82950 commit 145eca9

28 files changed

Lines changed: 930 additions & 450 deletions

.github/actions/init-ut-make-config/action.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ runs:
66
using: "composite"
77
steps:
88
- run: |
9-
sudo apt-get update && sudo apt-get install -y clang-12 lldb-12 lld-12 libgtest-dev cmake gdb libstdc++6-11-dbg
9+
sudo apt-get update
10+
sudo apt-get install -y clang-12 lldb-12 lld-12 libgtest-dev cmake gdb libstdc++6-11-dbg bison flex libboost-all-dev libevent-dev libibverbs1 libibverbs-dev
1011
shell: bash
1112
- run: |
1213
cd /usr/src/gtest && export CC=clang-12 && export CXX=clang++-12 && sudo cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
@@ -20,15 +21,20 @@ runs:
2021
shell: bash
2122
- run: |
2223
sudo git clone https://github.com/gperftools/gperftools.git
23-
cd gperftools && sudo git checkout tags/gperftools-2.16 && sudo mkdir -p /gperftools
24-
sudo ./autogen.sh && sudo CC=clang-12 CXX=clang++-12 ./configure --prefix=/gperftools --enable-frame-pointers
24+
cd gperftools && sudo git checkout tags/gperftools-2.16
25+
sudo ./autogen.sh && sudo CC=clang-12 CXX=clang++-12 ./configure --prefix=/usr --enable-frame-pointers
2526
sudo make -j ${{env.proc_num}} && sudo make install
2627
shell: bash
2728
- run: |
2829
sudo git clone https://github.com/abseil/abseil-cpp.git
2930
cd abseil-cpp && sudo git checkout lts_2022_06_23 && sudo mkdir -p /abseil-cpp
30-
sudo CC=clang-12 CXX=clang++-12 cmake -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/abseil-cpp -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
31+
sudo CC=clang-12 CXX=clang++-12 cmake -DBUILD_TESTING=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
3132
sudo make -j ${{env.proc_num}} && sudo sudo make install
3233
shell: bash
33-
- run: sh config_brpc.sh --headers="/libunwind/include /gperftools/include /abseil-cpp/include /usr/include" --libs="/libunwind/lib /gperftools/lib /abseil-cpp/lib /usr/lib /usr/lib64" --cc=clang-12 --cxx=clang++-12 ${{inputs.options}} && cat config.mk
34+
- run: |
35+
wget https://archive.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/
36+
sudo CC=clang-12 CXX=clang++-12 ./configure --prefix=/usr --with-rs=no --with-ruby=no --with-python=no --with-java=no --with-go=no --with-perl=no --with-php=no --with-csharp=no --with-erlang=no --with-lua=no --with-nodejs=no --with-haskell=no --with-dotnetcore=no CXXFLAGS="-Wno-unused-variable"
37+
sudo make -j ${{env.proc_num}} && sudo make install && ls /usr/lib/libthrift* && ls /usr/include/thrift
38+
shell: bash
39+
- run: sh config_brpc.sh --headers="/libunwind/include /usr/include" --libs="/libunwind/lib /usr/lib /usr/lib64" --cc=clang-12 --cxx=clang++-12 ${{inputs.options}} && cat config.mk
3440
shell: bash

.github/actions/install-all-dependencies/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ runs:
22
using: "composite"
33
steps:
44
- uses: ./.github/actions/install-essential-dependencies
5-
- run: sudo apt-get install -y libunwind-dev libgoogle-glog-dev automake bison flex libboost-all-dev libevent-dev libtool pkg-config libibverbs1 libibverbs-dev
5+
- run: sudo apt-get install -y libunwind-dev libgoogle-glog-dev automake bison flex libboost-all-dev libevent-dev libtool pkg-config libibverbs1 libibverbs-dev
66
shell: bash
77
- run: |
88
wget https://archive.apache.org/dist/thrift/0.11.0/thrift-0.11.0.tar.gz && tar -xf thrift-0.11.0.tar.gz && cd thrift-0.11.0/

.github/workflows/ci-linux.yml

Lines changed: 19 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -14,190 +14,33 @@ env:
1414
proc_num: $(nproc)
1515

1616
# https://github.com/actions/runner-images
17+
# https://github.com/SF-Zhou/setup-soft-roce-action/blob/main/.github/workflows/main.yml
1718
jobs:
18-
compile-with-make:
19-
runs-on: ubuntu-22.04
20-
steps:
21-
- uses: actions/checkout@v2
22-
- uses: ./.github/actions/install-all-dependencies
23-
24-
- name: gcc with default options
25-
uses: ./.github/actions/compile-with-make
26-
with:
27-
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror
28-
29-
- name: gcc with all options
30-
uses: ./.github/actions/compile-with-make
31-
with:
32-
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror --with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer --with-asan
33-
34-
- name: clang with default options
35-
uses: ./.github/actions/compile-with-make
36-
with:
37-
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror
38-
39-
- name: clang with all options
40-
uses: ./.github/actions/compile-with-make
41-
with:
42-
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror --with-thrift --with-glog --with-rdma --with-debug-bthread-sche-safety --with-debug-lock --with-bthread-tracer --with-asan
43-
44-
compile-with-cmake:
45-
runs-on: ubuntu-22.04
46-
steps:
47-
- uses: actions/checkout@v2
48-
- uses: ./.github/actions/install-all-dependencies
49-
50-
- name: gcc with default options
51-
run: |
52-
export CC=gcc && export CXX=g++
53-
mkdir gcc_build && cd gcc_build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
54-
make -j ${{env.proc_num}} && make clean
55-
56-
- name: gcc with all options
57-
run: |
58-
export CC=gcc && export CXX=g++
59-
mkdir gcc_build_all && cd gcc_build_all
60-
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON -DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON -DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
61-
make -j ${{env.proc_num}} && make clean
62-
63-
- name: clang with default options
64-
run: |
65-
export CC=clang && export CXX=clang++
66-
mkdir clang_build && cd clang_build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
67-
make -j ${{env.proc_num}} && make clean
68-
69-
- name: clang with all options
70-
run: |
71-
export CC=clang && export CXX=clang++
72-
mkdir clang_build_all && cd clang_build_all
73-
cmake -DWITH_MESALINK=OFF -DWITH_GLOG=ON -DWITH_THRIFT=ON -DWITH_RDMA=ON -DWITH_DEBUG_BTHREAD_SCHE_SAFETY=ON -DWITH_DEBUG_LOCK=ON -DWITH_BTHREAD_TRACER=ON -DWITH_ASAN=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
74-
make -j ${{env.proc_num}} && make clean
75-
76-
gcc-compile-with-make-protobuf:
77-
runs-on: ubuntu-22.04
78-
steps:
79-
- uses: actions/checkout@v2
80-
- uses: ./.github/actions/install-essential-dependencies
81-
82-
- name: protobuf 3.5.1
83-
uses: ./.github/actions/compile-with-make-protobuf
84-
with:
85-
protobuf-version: 3.5.1
86-
protobuf-cpp-version: 3.5.1
87-
protobuf-install-dir: /protobuf-3.5.1
88-
config-brpc-options: --cc=gcc --cxx=g++ --werror
89-
90-
- name: protobuf 3.12.4
91-
uses: ./.github/actions/compile-with-make-protobuf
92-
with:
93-
protobuf-version: 3.12.4
94-
protobuf-cpp-version: 3.12.4
95-
protobuf-install-dir: /protobuf-3.12.4
96-
config-brpc-options: --cc=gcc --cxx=g++ --werror
97-
98-
- name: protobuf 21.12
99-
uses: ./.github/actions/compile-with-make-protobuf
100-
with:
101-
protobuf-version: 21.12
102-
protobuf-cpp-version: 3.21.12
103-
protobuf-install-dir: /protobuf-3.21.12
104-
config-brpc-options: --cc=gcc --cxx=g++ --werror
105-
106-
gcc-compile-with-bazel:
107-
runs-on: ubuntu-22.04
108-
steps:
109-
- uses: actions/checkout@v2
110-
- run: bazel build --verbose_failures -- //... -//example/...
111-
112-
gcc-compile-with-boringssl:
113-
runs-on: ubuntu-22.04
114-
steps:
115-
- uses: actions/checkout@v2
116-
- run: bazel build --verbose_failures --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...
117-
118-
gcc-compile-with-bazel-all-options:
119-
runs-on: ubuntu-22.04
120-
steps:
121-
- uses: actions/checkout@v2
122-
- run: |
123-
bazel build --verbose_failures \
124-
--define with_mesalink=false \
125-
--define with_glog=true \
126-
--define with_thrift=true \
127-
--define with_debug_bthread_sche_safety=true \
128-
--define with_debug_lock=true \
129-
--define with_asan=true \
130-
--define with_bthread_tracer=true \
131-
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
132-
-- //... -//example/...
133-
134-
clang-compile-with-make-protobuf:
135-
runs-on: ubuntu-22.04
136-
steps:
137-
- uses: actions/checkout@v2
138-
- uses: ./.github/actions/install-essential-dependencies
139-
140-
- name: protobuf 3.5.1
141-
uses: ./.github/actions/compile-with-make-protobuf
142-
with:
143-
protobuf-version: 3.5.1
144-
protobuf-cpp-version: 3.5.1
145-
protobuf-install-dir: /protobuf-3.5.1
146-
config-brpc-options: --cc=clang --cxx=clang++ --werror
147-
148-
- name: protobuf 3.12.4
149-
uses: ./.github/actions/compile-with-make-protobuf
150-
with:
151-
protobuf-version: 3.12.4
152-
protobuf-cpp-version: 3.12.4
153-
protobuf-install-dir: /protobuf-3.12.4
154-
config-brpc-options: --cc=clang --cxx=clang++ --werror
155-
156-
- name: protobuf 21.12
157-
uses: ./.github/actions/compile-with-make-protobuf
158-
with:
159-
protobuf-version: 21.12
160-
protobuf-cpp-version: 3.21.12
161-
protobuf-install-dir: /protobuf-3.21.12
162-
config-brpc-options: --cc=clang --cxx=clang++ --werror
163-
164-
clang-compile-with-bazel:
165-
runs-on: ubuntu-22.04
166-
steps:
167-
- uses: actions/checkout@v2
168-
- run: bazel build --verbose_failures --action_env=CC=clang -- //... -//example/...
169-
170-
clang-compile-with-boringssl:
171-
runs-on: ubuntu-22.04
172-
steps:
173-
- uses: actions/checkout@v2
174-
- run: bazel build --verbose_failures --action_env=CC=clang --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...
175-
176-
clang-compile-with-bazel-all-options:
177-
runs-on: ubuntu-22.04
178-
steps:
179-
- uses: actions/checkout@v2
180-
- run: |
181-
bazel build --verbose_failures \
182-
--action_env=CC=clang \
183-
--define with_mesalink=false \
184-
--define with_glog=true \
185-
--define with_thrift=true \
186-
--define with_debug_bthread_sche_safety=true \
187-
--define with_debug_lock=true \
188-
--define with_asan=true \
189-
--define with_bthread_tracer=true \
190-
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
191-
-- //... -//example/...
192-
19319
clang-unittest:
19420
runs-on: ubuntu-22.04
19521
steps:
19622
- uses: actions/checkout@v2
19723
- uses: ./.github/actions/install-essential-dependencies
19824
- uses: ./.github/actions/init-ut-make-config
19925
with:
200-
options: --with-bthread-tracer
26+
options: --with-bthread-tracer --with-thrift
27+
- name: Setup Soft-RoCE
28+
run: |
29+
KERNEL_VERSION=$(uname -r | cut -d '-' -f 1)
30+
KERNEL_NAME="linux-${KERNEL_VERSION%'.0'}"
31+
DOWNLOAD_LINK="https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION%%.*}.x/${KERNEL_NAME}.tar.xz"
32+
ETHERNET_CARD=$(ip link | awk -F ": " '$0 !~ "lo|vir|wl|^[^0-9]"{print $2;getline}' | head -1)
33+
echo "kernel version is ${KERNEL_VERSION}, download link is ${DOWNLOAD_LINK}, ethernet card is ${ETHERNET_CARD}"
34+
wget -q $DOWNLOAD_LINK -O /tmp/$KERNEL_NAME.tar.xz
35+
tar xf /tmp/$KERNEL_NAME.tar.xz --directory=/tmp
36+
RXE_PATH="/tmp/$KERNEL_NAME/drivers/infiniband/sw/rxe"
37+
sed 's/$(CONFIG_RDMA_RXE)/m/g' $RXE_PATH/Makefile > $RXE_PATH/Kbuild
38+
make -C /lib/modules/$(uname -r)/build M=$RXE_PATH modules -j
39+
sudo modprobe ib_core
40+
sudo modprobe rdma_ucm
41+
sudo insmod $RXE_PATH/rdma_rxe.ko
42+
sudo rdma link add rxe_0 type rxe netdev $ETHERNET_CARD
43+
rdma link
20144
- name: compile tests
20245
run: |
20346
cat config.mk
@@ -207,30 +50,3 @@ jobs:
20750
run: |
20851
cd test
20952
sh ./run_tests.sh
210-
211-
clang-unittest-asan:
212-
runs-on: ubuntu-22.04
213-
steps:
214-
- uses: actions/checkout@v2
215-
- uses: ./.github/actions/install-essential-dependencies
216-
- uses: ./.github/actions/init-ut-make-config
217-
with:
218-
options: --with-bthread-tracer --with-asan
219-
- name: compile tests
220-
run: |
221-
cat config.mk
222-
cd test
223-
make NEED_GPERFTOOLS=0 -j ${{env.proc_num}}
224-
- name: run tests
225-
run: |
226-
cd test
227-
sh ./run_tests.sh
228-
229-
bazel-bvar-unittest:
230-
runs-on: ubuntu-22.04
231-
steps:
232-
- uses: actions/checkout@v2
233-
- run: bazel test --verbose_failures //test:bvar_test
234-
- run: bazel test --verbose_failures --define with_babylon_counter=true //test:bvar_test
235-
- run: bazel test --verbose_failures --action_env=CC=clang //test:bvar_test
236-
- run: bazel test --verbose_failures --action_env=CC=clang --define with_babylon_counter=true //test:bvar_test

.github/workflows/ci-macos.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*.rej
1616
/output
1717
/test/output
18+
/test/gen-cpp
1819
build/
1920

2021
# Ignore hidden files

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ option(BUILD_BRPC_TOOLS "Whether to build brpc tools" ON)
3636
option(DOWNLOAD_GTEST "Download and build a fresh copy of googletest. Requires Internet access." ON)
3737

3838
# Enable MACOSX_RPATH. Run "cmake --help-policy CMP0042" for policy details.
39-
if(POLICY CMP0042)
39+
if (POLICY CMP0042)
4040
cmake_policy(SET CMP0042 NEW)
4141
endif()
4242

cmake/CMakeLists.download_gtest.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16-
cmake_minimum_required(VERSION 2.8.10)
16+
cmake_minimum_required(VERSION 3.5)
1717

1818
project(googletest-download NONE)
1919

0 commit comments

Comments
 (0)