From 13f5d856fffcc8ba832489ca2cf9e52632a611bd Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Wed, 26 Jun 2024 19:01:22 -0700 Subject: [PATCH 1/6] test pr --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8077c69ec..be2e88ce2 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ CacheLib

-# CacheLib +# Multi-Tier CacheLib Pluggable caching engine to build and scale high performance cache services. See [www.cachelib.org](https://cachelib.org) for documentation and more information. From cd864de6a68f885a3211330011d354b196841fc4 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 27 Jun 2024 09:09:07 -0700 Subject: [PATCH 2/6] update test for RSS --- cachelib/common/tests/UtilTestsRSS.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cachelib/common/tests/UtilTestsRSS.cpp b/cachelib/common/tests/UtilTestsRSS.cpp index 04efd4568..cf7dc7347 100644 --- a/cachelib/common/tests/UtilTestsRSS.cpp +++ b/cachelib/common/tests/UtilTestsRSS.cpp @@ -30,7 +30,7 @@ namespace tests { TEST(Util, MemRSS) { for (int i = 0; i < 10; i++) { - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); auto val = util::getRSSBytes(); EXPECT_GT(val, 0); @@ -42,7 +42,7 @@ TEST(Util, MemRSS) { std::memset(reinterpret_cast(ptr), 5, len); // sleep to let the stat catch up. /* sleep override */ - std::this_thread::sleep_for(std::chrono::milliseconds(100)); + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); auto newVal = util::getRSSBytes(); EXPECT_GT(newVal, val) << folly::sformat("newVal = {}, val = {}", newVal, val); From 4c36d8ecde3754d50cc98a74c968d98127b17d06 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 27 Jun 2024 09:09:59 -0700 Subject: [PATCH 3/6] fix chained item evict count --- cachelib/allocator/CacheAllocator.h | 1 - 1 file changed, 1 deletion(-) diff --git a/cachelib/allocator/CacheAllocator.h b/cachelib/allocator/CacheAllocator.h index 47d0678d2..92c6315fd 100644 --- a/cachelib/allocator/CacheAllocator.h +++ b/cachelib/allocator/CacheAllocator.h @@ -4610,7 +4610,6 @@ CacheAllocator::getNextCandidate(TierId tid, if (chainedItem) { XDCHECK(toRecycleParent->isMoving()); XDCHECK_EQ(evictedToNext->getRefCount(),2u); - (*stats_.chainedItemEvictions)[tid][pid][cid].inc(); // check if by releasing the item we intend to, we actually // recycle the candidate. auto ret = releaseBackToAllocator(*candidate, RemoveContext::kEviction, From 34a1d389252fa715a380b04428ddb0e92cdaf995 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Thu, 27 Jun 2024 09:11:21 -0700 Subject: [PATCH 4/6] fix run build script --- docker/run-build.sh | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/docker/run-build.sh b/docker/run-build.sh index 6c940a5d2..0b52cfbd2 100755 --- a/docker/run-build.sh +++ b/docker/run-build.sh @@ -2,23 +2,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright 2022, Intel Corporation -set -e - -function sudo_password() { - echo ${USERPASS} | sudo -Sk $* -} - -#cd .. -#mkdir build -#cd build -# source /opt/rh/gcc-toolset-12/enable -# -#cmake ../cachelib -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=/opt -DCMAKE_BUILD_TYPE=Debug -#sudo_password make install -j$(nproc) -cd $WORKDIR +cd / if [ -d "build-cachelib" ]; then rm -rf build-cachelib fi -./contrib/build-package.sh -t -j -v -I /opt/ cachelib +./$WORKDIR/contrib/build-package.sh -t -j -v -I /opt/ cachelib cd /opt/tests && $WORKDIR/run_tests.sh From 844b8ff96002264263beb1a436420beb0eca09c1 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Fri, 28 Jun 2024 06:42:15 -0700 Subject: [PATCH 5/6] add tests to centos 9 full build --- .github/workflows/build-cachelib-centos-9.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-cachelib-centos-9.yml b/.github/workflows/build-cachelib-centos-9.yml index a47166f48..3907f9de2 100644 --- a/.github/workflows/build-cachelib-centos-9.yml +++ b/.github/workflows/build-cachelib-centos-9.yml @@ -90,9 +90,11 @@ jobs: run: ./contrib/build-package.sh -j -v -i fbthrift - name: "build CacheLib" # Build cachelib in debug mode (-d) - run: ./contrib/build-package.sh -j -v -i -d cachelib + run: ./contrib/build-package.sh -j -v -i -d -t cachelib - name: "run cachebench" run: ./opt/cachelib/bin/cachebench --json_test_config ./opt/cachelib/test_configs/simple_test.json + - name: "run cachebench tests" + run: cd ./opt/cachelib/tests/ && ../../../run_tests.sh - uses: actions/upload-artifact@v3 if: failure() with: From a14809fd120a49108c5811081820c7a3ff7df94a Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Fri, 28 Jun 2024 07:34:58 -0700 Subject: [PATCH 6/6] make privilged --- .github/workflows/build-cachelib-centos-9.yml | 4 +++- docker/build.sh | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-cachelib-centos-9.yml b/.github/workflows/build-cachelib-centos-9.yml index 3907f9de2..a063cf343 100644 --- a/.github/workflows/build-cachelib-centos-9.yml +++ b/.github/workflows/build-cachelib-centos-9.yml @@ -25,7 +25,9 @@ jobs: name: "CentOS/9 - Build CacheLib with all dependencies" runs-on: ubuntu-latest # Docker container image name - container: "quay.io/centos/centos:stream9" + container: + image: "quay.io/centos/centos:stream9" + options: --privileged steps: - name: "Show Head Commit" env: diff --git a/docker/build.sh b/docker/build.sh index 0cafeef9b..defa525d9 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -66,7 +66,7 @@ echo "Running build using Docker image: ${IMAGE_NAME}" # - environment variables set (--env) # - host directory containing source mounted (-v) # - working directory set (-w) -docker run --privileged=true --name=${CONTAINER_NAME} -i \ +docker run --privileged --name=${CONTAINER_NAME} -i \ ${DOCKER_OPTS} \ --env http_proxy=${http_proxy} \ --env https_proxy=${https_proxy} \