Skip to content
Open
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
16 changes: 11 additions & 5 deletions .github/actions/init-ut-make-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ runs:
using: "composite"
steps:
- run: |
sudo apt-get update && sudo apt-get install -y clang-12 lldb-12 lld-12 libgtest-dev cmake gdb libstdc++6-11-dbg
sudo apt-get update
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
shell: bash
- run: |
cd /usr/src/gtest && export CC=clang-12 && export CXX=clang++-12 && sudo cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .
Expand All @@ -20,15 +21,20 @@ runs:
shell: bash
- run: |
sudo git clone https://github.com/gperftools/gperftools.git
cd gperftools && sudo git checkout tags/gperftools-2.16 && sudo mkdir -p /gperftools
sudo ./autogen.sh && sudo CC=clang-12 CXX=clang++-12 ./configure --prefix=/gperftools --enable-frame-pointers
cd gperftools && sudo git checkout tags/gperftools-2.16
sudo ./autogen.sh && sudo CC=clang-12 CXX=clang++-12 ./configure --prefix=/usr --enable-frame-pointers
sudo make -j ${{env.proc_num}} && sudo make install
shell: bash
- run: |
sudo git clone https://github.com/abseil/abseil-cpp.git
cd abseil-cpp && sudo git checkout lts_2022_06_23 && sudo mkdir -p /abseil-cpp
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 .
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 .
sudo make -j ${{env.proc_num}} && sudo sudo make install
shell: bash
- 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
- run: |
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/
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"
sudo make -j ${{env.proc_num}} && sudo make install && ls /usr/lib/libthrift* && ls /usr/include/thrift
shell: bash
- 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
shell: bash
2 changes: 1 addition & 1 deletion .github/actions/install-all-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ runs:
using: "composite"
steps:
- uses: ./.github/actions/install-essential-dependencies
- 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
- 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
shell: bash
- run: |
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/
Expand Down
222 changes: 19 additions & 203 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,190 +14,33 @@ env:
proc_num: $(nproc)

# https://github.com/actions/runner-images
# https://github.com/SF-Zhou/setup-soft-roce-action/blob/main/.github/workflows/main.yml
jobs:
compile-with-make:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-all-dependencies

- name: gcc with default options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=gcc --cxx=g++ --werror

- name: gcc with all options
uses: ./.github/actions/compile-with-make
with:
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

- name: clang with default options
uses: ./.github/actions/compile-with-make
with:
options: --headers=/usr/include --libs=/usr/lib /usr/lib64 --cc=clang --cxx=clang++ --werror

- name: clang with all options
uses: ./.github/actions/compile-with-make
with:
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

compile-with-cmake:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-all-dependencies

- name: gcc with default options
run: |
export CC=gcc && export CXX=g++
mkdir gcc_build && cd gcc_build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean

- name: gcc with all options
run: |
export CC=gcc && export CXX=g++
mkdir gcc_build_all && cd gcc_build_all
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 ..
make -j ${{env.proc_num}} && make clean

- name: clang with default options
run: |
export CC=clang && export CXX=clang++
mkdir clang_build && cd clang_build && cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 ..
make -j ${{env.proc_num}} && make clean

- name: clang with all options
run: |
export CC=clang && export CXX=clang++
mkdir clang_build_all && cd clang_build_all
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 ..
make -j ${{env.proc_num}} && make clean

gcc-compile-with-make-protobuf:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies

- name: protobuf 3.5.1
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.5.1
protobuf-cpp-version: 3.5.1
protobuf-install-dir: /protobuf-3.5.1
config-brpc-options: --cc=gcc --cxx=g++ --werror

- name: protobuf 3.12.4
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.12.4
protobuf-cpp-version: 3.12.4
protobuf-install-dir: /protobuf-3.12.4
config-brpc-options: --cc=gcc --cxx=g++ --werror

- name: protobuf 21.12
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 21.12
protobuf-cpp-version: 3.21.12
protobuf-install-dir: /protobuf-3.21.12
config-brpc-options: --cc=gcc --cxx=g++ --werror

gcc-compile-with-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures -- //... -//example/...

gcc-compile-with-boringssl:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --define with_mesalink=false --define with_glog=true --define with_thrift=true --define BRPC_WITH_BORINGSSL=true -- //... -//example/...

gcc-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: |
bazel build --verbose_failures \
--define with_mesalink=false \
--define with_glog=true \
--define with_thrift=true \
--define with_debug_bthread_sche_safety=true \
--define with_debug_lock=true \
--define with_asan=true \
--define with_bthread_tracer=true \
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
-- //... -//example/...

clang-compile-with-make-protobuf:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies

- name: protobuf 3.5.1
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.5.1
protobuf-cpp-version: 3.5.1
protobuf-install-dir: /protobuf-3.5.1
config-brpc-options: --cc=clang --cxx=clang++ --werror

- name: protobuf 3.12.4
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 3.12.4
protobuf-cpp-version: 3.12.4
protobuf-install-dir: /protobuf-3.12.4
config-brpc-options: --cc=clang --cxx=clang++ --werror

- name: protobuf 21.12
uses: ./.github/actions/compile-with-make-protobuf
with:
protobuf-version: 21.12
protobuf-cpp-version: 3.21.12
protobuf-install-dir: /protobuf-3.21.12
config-brpc-options: --cc=clang --cxx=clang++ --werror

clang-compile-with-bazel:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel build --verbose_failures --action_env=CC=clang -- //... -//example/...

clang-compile-with-boringssl:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- 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/...

clang-compile-with-bazel-all-options:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: |
bazel build --verbose_failures \
--action_env=CC=clang \
--define with_mesalink=false \
--define with_glog=true \
--define with_thrift=true \
--define with_debug_bthread_sche_safety=true \
--define with_debug_lock=true \
--define with_asan=true \
--define with_bthread_tracer=true \
--define BRPC_WITH_NO_PTHREAD_MUTEX_HOOK=true \
-- //... -//example/...

clang-unittest:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies
- uses: ./.github/actions/init-ut-make-config
with:
options: --with-bthread-tracer
options: --with-bthread-tracer --with-thrift
- name: Setup Soft-RoCE
run: |
KERNEL_VERSION=$(uname -r | cut -d '-' -f 1)
KERNEL_NAME="linux-${KERNEL_VERSION%'.0'}"
DOWNLOAD_LINK="https://cdn.kernel.org/pub/linux/kernel/v${KERNEL_VERSION%%.*}.x/${KERNEL_NAME}.tar.xz"
ETHERNET_CARD=$(ip link | awk -F ": " '$0 !~ "lo|vir|wl|^[^0-9]"{print $2;getline}' | head -1)
echo "kernel version is ${KERNEL_VERSION}, download link is ${DOWNLOAD_LINK}, ethernet card is ${ETHERNET_CARD}"
wget -q $DOWNLOAD_LINK -O /tmp/$KERNEL_NAME.tar.xz
tar xf /tmp/$KERNEL_NAME.tar.xz --directory=/tmp
RXE_PATH="/tmp/$KERNEL_NAME/drivers/infiniband/sw/rxe"
sed 's/$(CONFIG_RDMA_RXE)/m/g' $RXE_PATH/Makefile > $RXE_PATH/Kbuild
make -C /lib/modules/$(uname -r)/build M=$RXE_PATH modules -j
sudo modprobe ib_core
sudo modprobe rdma_ucm
sudo insmod $RXE_PATH/rdma_rxe.ko
sudo rdma link add rxe_0 type rxe netdev $ETHERNET_CARD
rdma link
- name: compile tests
run: |
cat config.mk
Expand All @@ -207,30 +50,3 @@ jobs:
run: |
cd test
sh ./run_tests.sh

clang-unittest-asan:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/install-essential-dependencies
- uses: ./.github/actions/init-ut-make-config
with:
options: --with-bthread-tracer --with-asan
- name: compile tests
run: |
cat config.mk
cd test
make NEED_GPERFTOOLS=0 -j ${{env.proc_num}}
- name: run tests
run: |
cd test
sh ./run_tests.sh

bazel-bvar-unittest:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: bazel test --verbose_failures //test:bvar_test
- run: bazel test --verbose_failures --define with_babylon_counter=true //test:bvar_test
- run: bazel test --verbose_failures --action_env=CC=clang //test:bvar_test
- run: bazel test --verbose_failures --action_env=CC=clang --define with_babylon_counter=true //test:bvar_test
66 changes: 0 additions & 66 deletions .github/workflows/ci-macos.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*.rej
/output
/test/output
/test/gen-cpp
build/

# Ignore hidden files
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ option(BUILD_BRPC_TOOLS "Whether to build brpc tools" ON)
option(DOWNLOAD_GTEST "Download and build a fresh copy of googletest. Requires Internet access." ON)

# Enable MACOSX_RPATH. Run "cmake --help-policy CMP0042" for policy details.
if(POLICY CMP0042)
if (POLICY CMP0042)
cmake_policy(SET CMP0042 NEW)
endif()

Expand Down
2 changes: 1 addition & 1 deletion cmake/CMakeLists.download_gtest.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 2.8.10)
cmake_minimum_required(VERSION 3.5)

project(googletest-download NONE)

Expand Down
Loading