From 70ea20e540cf6475d62642154dce7a246895aeed Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Sun, 6 Oct 2024 22:18:25 +0800 Subject: [PATCH 1/3] Add RocksDB build in CI --- .github/workflows/ci.linux.x86_64.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/ci.linux.x86_64.yml b/.github/workflows/ci.linux.x86_64.yml index 8f47f894..d74205fa 100644 --- a/.github/workflows/ci.linux.x86_64.yml +++ b/.github/workflows/ci.linux.x86_64.yml @@ -184,3 +184,23 @@ jobs: -D PHOTON_BUILD_TESTING=ON \ -D PHOTON_ENABLE_FSTACK_DPDK=ON cmake --build build -j $(nproc) -t fstack-dpdk-demo + + RocksDB: + runs-on: ubuntu-latest + container: + image: almalinux:8 + options: --cpus 4 --privileged + steps: + - uses: actions/checkout@v4 + - name: Build + run: | + export TZ=Asia/Shanghai + dnf install -q -y git gcc-c++ cmake openssl-devel libcurl-devel libaio-devel zlib-devel epel-release + dnf config-manager --set-enabled powertools + dnf install -q -y gflags-devel snappy-devel zlib-devel bzip2-devel lz4-devel libzstd-devel + git clone -b photon-on-6.1.2 https://github.com/data-accelerator/rocksdb.git + cd rocksdb + ./photon-auto-convert.sh + cmake -B build -D WITH_TESTS=on -D INIT_PHOTON_IN_ENV=on -D WITH_LZ4=on -D WITH_SNAPPY=on \ + -D CMAKE_BUILD_TYPE=Debug + cmake --build build -j `nproc` From 49eeaadf16de02889c5c24eb0648d8f475fece95 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Tue, 8 Oct 2024 12:05:56 +0800 Subject: [PATCH 2/3] Separate CI tests on different engine (#588) --- .github/workflows/ci.linux.x86_64.yml | 95 +++++++++++++++------------ .github/workflows/ci.macos.x86_64.yml | 52 +++++++-------- 2 files changed, 78 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.linux.x86_64.yml b/.github/workflows/ci.linux.x86_64.yml index d74205fa..eed2eded 100644 --- a/.github/workflows/ci.linux.x86_64.yml +++ b/.github/workflows/ci.linux.x86_64.yml @@ -19,9 +19,8 @@ jobs: timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - uses: actions/checkout@v4 - - name: Build850 + - name: Build run: | - rm -fr build cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ -D PHOTON_BUILD_TESTING=ON \ @@ -29,15 +28,18 @@ jobs: -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - - name: test + cmake --build build -j $(nproc) -- VERBOSE=1 + - name: Test epoll + run: | + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test io_uring run: | - cd build/output/ - ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test epoll_ng + run: | export PHOTON_CI_EV_ENGINE=epoll_ng - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V gcc921: runs-on: ubuntu-latest @@ -51,10 +53,9 @@ jobs: timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - uses: actions/checkout@v4 - - name: Build921 + - name: Build run: | source /opt/rh/gcc-toolset-9/enable - rm -fr build cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ -D PHOTON_BUILD_TESTING=ON \ @@ -62,15 +63,18 @@ jobs: -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - - name: test + cmake --build build -j $(nproc) -- VERBOSE=1 + - name: Test epoll + run: | + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test io_uring run: | - cd build/output/ - ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test epoll_ng + run: | export PHOTON_CI_EV_ENGINE=epoll_ng - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V gcc1031: runs-on: ubuntu-latest @@ -84,10 +88,9 @@ jobs: timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - uses: actions/checkout@v4 - - name: Build1031 + - name: Build run: | source /opt/rh/gcc-toolset-10/enable - rm -fr build cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ -D PHOTON_BUILD_TESTING=ON \ @@ -95,15 +98,18 @@ jobs: -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - - name: test + cmake --build build -j $(nproc) -- VERBOSE=1 + - name: Test epoll + run: | + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test io_uring run: | - cd build/output/ - ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test epoll_ng + run: | export PHOTON_CI_EV_ENGINE=epoll_ng - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V gcc1121: runs-on: ubuntu-latest @@ -117,10 +123,9 @@ jobs: timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - uses: actions/checkout@v4 - - name: Build1121 + - name: Build run: | source /opt/rh/gcc-toolset-11/enable - rm -fr build cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ -D PHOTON_BUILD_TESTING=ON \ @@ -128,15 +133,18 @@ jobs: -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - - name: test + cmake --build build -j $(nproc) -- VERBOSE=1 + - name: Test epoll + run: | + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test io_uring run: | - cd build/output/ - ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test epoll_ng + run: | export PHOTON_CI_EV_ENGINE=epoll_ng - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V gcc1211: runs-on: ubuntu-latest @@ -150,10 +158,9 @@ jobs: timezoneMacos: "Asia/Shanghai" timezoneWindows: "China Standard Time" - uses: actions/checkout@v4 - - name: Build1211 + - name: Build run: | source /opt/rh/gcc-toolset-12/enable - rm -fr build cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_ENABLE_ECOSYSTEM=ON \ -D PHOTON_BUILD_TESTING=ON \ @@ -161,15 +168,18 @@ jobs: -D PHOTON_ENABLE_FUSE=ON \ -D PHOTON_ENABLE_URING=ON \ -D PHOTON_ENABLE_EXTFS=ON - cmake --build build -j $(nproc) --clean-first -- VERBOSE=1 - - name: test + cmake --build build -j $(nproc) -- VERBOSE=1 + - name: Test epoll + run: | + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test io_uring run: | - cd build/output/ - ctest -E test-lockfree --timeout 3600 -V export PHOTON_CI_EV_ENGINE=io_uring - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V + - name: Test epoll_ng + run: | export PHOTON_CI_EV_ENGINE=epoll_ng - ctest -E test-lockfree --timeout 3600 -V + cd build && ctest -E test-lockfree --timeout 3600 -V fstack: runs-on: ubuntu-latest @@ -178,8 +188,8 @@ jobs: options: --cpus 4 --privileged steps: - uses: actions/checkout@v4 - - name: Build on FStack-DPDK - run: | + - name: Build + run: | cmake -B build -D CMAKE_BUILD_TYPE=MinSizeRel \ -D PHOTON_BUILD_TESTING=ON \ -D PHOTON_ENABLE_FSTACK_DPDK=ON @@ -194,7 +204,6 @@ jobs: - uses: actions/checkout@v4 - name: Build run: | - export TZ=Asia/Shanghai dnf install -q -y git gcc-c++ cmake openssl-devel libcurl-devel libaio-devel zlib-devel epel-release dnf config-manager --set-enabled powertools dnf install -q -y gflags-devel snappy-devel zlib-devel bzip2-devel lz4-devel libzstd-devel diff --git a/.github/workflows/ci.macos.x86_64.yml b/.github/workflows/ci.macos.x86_64.yml index fcbb8a43..769e2d93 100644 --- a/.github/workflows/ci.macos.x86_64.yml +++ b/.github/workflows/ci.macos.x86_64.yml @@ -11,30 +11,30 @@ jobs: runs-on: macos-13 steps: - - uses: szenius/set-timezone@v2.0 - with: - timezoneLinux: "Asia/Shanghai" - timezoneMacos: "Asia/Shanghai" - timezoneWindows: "China Standard Time" - - - uses: actions/checkout@v4 - - - name: Install Dependencies - shell: bash - run: | - brew install cmake openssl gflags googletest gsasl - - - name: Build - run: | - cmake -B ${{github.workspace}}/build \ - -D PHOTON_ENABLE_ECOSYSTEM=ON \ - -D PHOTON_BUILD_TESTING=ON \ - -D CMAKE_BUILD_TYPE=MinSizeRel \ - -D PHOTON_ENABLE_SASL=ON \ - -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 - cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) - - - name: Test - working-directory: ${{github.workspace}}/build - run: ctest -E test-lockfree --timeout 3600 -V + - uses: szenius/set-timezone@v2.0 + with: + timezoneLinux: "Asia/Shanghai" + timezoneMacos: "Asia/Shanghai" + timezoneWindows: "China Standard Time" + + - uses: actions/checkout@v4 + + - name: Install Dependencies + shell: bash + run: | + brew install cmake openssl gflags googletest gsasl + + - name: Build + run: | + cmake -B ${{github.workspace}}/build \ + -D PHOTON_ENABLE_ECOSYSTEM=ON \ + -D PHOTON_BUILD_TESTING=ON \ + -D CMAKE_BUILD_TYPE=MinSizeRel \ + -D PHOTON_ENABLE_SASL=ON \ + -D OPENSSL_ROOT_DIR=/usr/local/opt/openssl@3 + cmake --build ${{github.workspace}}/build -j $(sysctl -n hw.logicalcpu) + + - name: Test + working-directory: ${{github.workspace}}/build + run: ctest -E test-lockfree --timeout 3600 -V From 06364a7c644789a349c3b14e4c146657b3eebb79 Mon Sep 17 00:00:00 2001 From: Bob Chen Date: Wed, 9 Oct 2024 09:32:25 +0800 Subject: [PATCH 3/3] Update test_throttle.cpp (#590) --- common/test/test_throttle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/test/test_throttle.cpp b/common/test/test_throttle.cpp index 19f8bef7..bea7f14c 100644 --- a/common/test/test_throttle.cpp +++ b/common/test/test_throttle.cpp @@ -214,8 +214,8 @@ TEST_P(FindAppropriateSliceNumTest, run) { INSTANTIATE_TEST_CASE_P(Throttle, FindAppropriateSliceNumTest, testing::Values( FindAppropriateSliceNumSuite{10, 0.01}, - FindAppropriateSliceNumSuite{50, 0.01}, - FindAppropriateSliceNumSuite{100, 0.02}, + FindAppropriateSliceNumSuite{50, 0.02}, + FindAppropriateSliceNumSuite{100, 0.03}, FindAppropriateSliceNumSuite{500, 0.08}, FindAppropriateSliceNumSuite{1000, 0.08}, FindAppropriateSliceNumSuite{5000, 0.85} // Unacceptable