Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
b791b77
Run centos and debian workflows on push and PR
igchor Nov 2, 2021
470f563
Introduce 'markedForEviction' state for the Item.
igchor Dec 15, 2022
c1020df
Adds createPutToken and switches findEviction
byrnedj Feb 4, 2023
9bb6775
- Change the cache size calculation to use getCacheSize()
byrnedj Jan 4, 2023
1759e83
- Add memory tier configs to cache allocator based on NUMA bindings
byrnedj Jan 4, 2023
62b0c41
added ability for compressed pointer to use full 32 bits for addressi…
guptask Nov 14, 2022
b7459ee
Add memory usage statistics for allocation classes
igchor Jul 6, 2022
fafface
Initial multi-tier support implementation (rebased with NUMA and cs p…
igchor Sep 28, 2021
369e55b
AC stats multi-tier
byrnedj Jan 17, 2023
713c6d9
This commit contains the additional memory tiers tests
byrnedj Feb 8, 2023
d209d78
This is the additional multi-tier support needed
guptask Nov 14, 2022
e74fa40
added per pool class rolling average latency (upstream PR version)
guptask Jul 21, 2022
bab780a
added per tier pool class rolling average latency (based on upstream PR)
guptask Jul 21, 2022
f0baeb1
MM2Q promotion iterators (#1)
byrnedj Aug 9, 2022
8ab8c75
CS Patch Part 2 for mulit-tier cachelib:
byrnedj Feb 7, 2023
2152639
basic multi-tier test based on numa bindings
igchor Dec 30, 2021
e303104
Aadding new configs to hit_ratio/graph_cache_leader_fobj
vinser52 Jan 27, 2022
1e40a00
Do not block reader if a child item is moving
igchor Dec 19, 2022
b99bb9d
Background data movement (#20)
byrnedj Oct 21, 2022
08bf0b4
fix race in moveRegularItemWith sync where insertOrReplace can cause …
byrnedj Feb 16, 2023
8f88aa6
Add extra allocation/eviction policies
igchor Mar 7, 2023
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
Next Next commit
Run centos and debian workflows on push and PR
Run tests on CI

Run long tests (navy/bench) every day on CI

Run CI on prebuild docker image

Run only centos build on CI

Update docker file used in CI

Centos8 is EOL

Disable failing clang-format-check

Add extra param to build-package.sh

Add scripts for rebuilding/pushing docker images

Taken from: pmem/dev-utils-kit@30794c3

Extend CI to rebuild docker automatically

Update build-cachelib-docker.yml

Do not use shallow clone to make sure Docker rebuild logic works correctly.

Added required packages to install Intel ittapi

Update CI to use intel/CacheLib repo (#17)

Add multi-tier navy benchmark and run it on CI
- fix navy multi-tier config for NUMA bindings

added code coverage support in CacheLib

Adding libdml to CentOS docker image (#53)

only exclude allocator-test-NavySetupTestm, shm-test-test_page_size tests

added perf and numactl to docker packages

---------------------------------------------
one large commit for all CI and code coverage
see above for the change history.
  • Loading branch information
igchor authored and byrnedj committed Mar 3, 2023
commit b791b774ba6e92278b57bb2041a9980686392113
39 changes: 39 additions & 0 deletions .github/workflows/build-cachelib-centos-long.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: build-cachelib-centos-latest
on:
schedule:
- cron: '0 7 * * *'

jobs:
build-cachelib-centos8-latest:
name: "CentOS/latest - Build CacheLib with all dependencies"
runs-on: ubuntu-latest
# Docker container image name
container: "centos:latest"
steps:
- name: "update packages"
run: dnf upgrade -y
- name: "install sudo,git"
run: dnf install -y sudo git cmake gcc
- name: "System Information"
run: |
echo === uname ===
uname -a
echo === /etc/os-release ===
cat /etc/os-release
echo === df -hl ===
df -hl
echo === free -h ===
free -h
echo === top ===
top -b -n1 -1 -Eg || timeout 1 top -b -n1
echo === env ===
env
echo === gcc -v ===
gcc -v
- name: "checkout sources"
uses: actions/checkout@v2
- name: "build CacheLib using build script"
run: ./contrib/build.sh -j -v -T
- name: "run tests"
timeout-minutes: 60
run: cd opt/cachelib/tests && ../../../run_tests.sh long
43 changes: 43 additions & 0 deletions .github/workflows/build-cachelib-debian.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: build-cachelib-debian-10
on:
schedule:
- cron: '30 5 * * 0,3'

jobs:
build-cachelib-debian-10:
name: "Debian/Buster - Build CacheLib with all dependencies"
runs-on: ubuntu-latest
# Docker container image name
container: "debian:buster-slim"
steps:
- name: "update packages"
run: apt-get update
- name: "upgrade packages"
run: apt-get -y upgrade
- name: "install sudo,git"
run: apt-get install -y sudo git procps
- name: "System Information"
run: |
echo === uname ===
uname -a
echo === /etc/os-release ===
cat /etc/os-release
echo === df -hl ===
df -hl
echo === free -h ===
free -h
echo === top ===
top -b -n1 -1 -Eg || timeout 1 top -b -n1 ; true
echo === env ===
env
echo === cc -v ===
cc -v || true
echo === g++ -v ===
g++ - || true
- name: "checkout sources"
uses: actions/checkout@v2
- name: "build CacheLib using build script"
run: ./contrib/build.sh -j -v -T
- name: "run tests"
timeout-minutes: 60
run: cd opt/cachelib/tests && ../../../run_tests.sh
49 changes: 49 additions & 0 deletions .github/workflows/build-cachelib-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: build-cachelib-docker
on:
push:
pull_request:

jobs:
build-cachelib-docker:
name: "CentOS/latest - Build CacheLib with all dependencies"
runs-on: ubuntu-latest
env:
REPO: cachelib
GITHUB_REPO: intel/CacheLib
CONTAINER_REG: ghcr.io/pmem/cachelib
CONTAINER_REG_USER: ${{ secrets.GH_CR_USER }}
CONTAINER_REG_PASS: ${{ secrets.GH_CR_PAT }}
FORCE_IMAGE_ACTION: ${{ secrets.FORCE_IMAGE_ACTION }}
HOST_WORKDIR: ${{ github.workspace }}
WORKDIR: docker
IMG_VER: devel
strategy:
matrix:
CONFIG: ["OS=centos OS_VER=8streams PUSH_IMAGE=1"]
steps:
- name: "System Information"
run: |
echo === uname ===
uname -a
echo === /etc/os-release ===
cat /etc/os-release
echo === df -hl ===
df -hl
echo === free -h ===
free -h
echo === top ===
top -b -n1 -1 -Eg || timeout 1 top -b -n1
echo === env ===
env
echo === gcc -v ===
gcc -v
- name: "checkout sources"
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Pull the image or rebuild and push it
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./pull-or-rebuild-image.sh $FORCE_IMAGE_ACTION

- name: Run the build
run: cd $WORKDIR && ${{ matrix.CONFIG }} ./build.sh
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# From: https://github.com/marketplace/actions/clang-format-check#multiple-paths
name: clang-format Check
on: [pull_request]
on: []
jobs:
formatting-check:
name: Formatting Check
Expand Down
5 changes: 5 additions & 0 deletions cachelib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ set(CMAKE_MODULE_PATH
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)

if(COVERAGE_ENABLED)
# Add code coverage
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage -fprofile-arcs -ftest-coverage")
endif()

# include(fb_cxx_flags)
message(STATUS "Update CXXFLAGS: ${CMAKE_CXX_FLAGS}")

Expand Down
54 changes: 54 additions & 0 deletions cachelib/cachebench/test_configs/consistency/navy-multi-tier.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"cache_config" : {
"cacheSizeMB" : 300,
"poolRebalanceIntervalSec" : 1,
"moveOnSlabRelease" : true,

"cacheDir": "/tmp/mem-tier2",
"memoryTiers" : [
{
"ratio": 1,
"memBindNodes": 0
},
{
"ratio": 1,
"memBindNodes": 0
}
],

"numPools" : 2,
"poolSizes" : [0.5, 0.5],
"allocFactor" : 2.0,
"nvmCacheSizeMB" : 1024
},
"test_config" :
{

"checkConsistency" : true,

"numOps" : 60000,
"numThreads" : 20,
"numKeys" : 200000,


"keySizeRange" : [1, 8, 64],
"keySizeRangeProbability" : [0.5, 0.5],

"valSizeRange" : [256, 1024, 4096, 8192],
"valSizeRangeProbability" : [0.2, 0.7, 0.1],

"chainedItemLengthRange" : [1, 2, 4, 32],
"chainedItemLengthRangeProbability" : [0.8, 0.18, 0.02],

"chainedItemValSizeRange" : [1, 128, 256, 1024, 4096, 20480],
"chainedItemValSizeRangeProbability" : [0.1, 0.1, 0.2, 0.3, 0.3],

"getRatio" : 0.8,
"setRatio" : 0.1,
"delRatio" : 0.0,
"addChainedRatio" : 0.05,
"keyPoolDistribution": [0.5, 0.5],
"opPoolDistribution" : [0.5, 0.5]
}

}
4 changes: 2 additions & 2 deletions cachelib/cachebench/test_configs/consistency/navy.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

"checkConsistency" : true,

"numOps" : 30000000,
"numThreads" : 40,
"numOps" : 600000,
"numThreads" : 20,
"numKeys" : 200000,


Expand Down
8 changes: 4 additions & 4 deletions contrib/build-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ build_tests=
show_help=
many_jobs=
verbose=
PREFIX="$PWD/opt/cachelib/"

while getopts :BSdhijtvp: param
install_path=
while getopts :BSdhijtvI: param
do
case $param in
i) install=yes ;;
Expand All @@ -91,7 +90,7 @@ do
v) verbose=yes ;;
j) many_jobs=yes ;;
t) build_tests=yes ;;
p) PREFIX=$OPTARG ;;
I) install_path=${OPTARG} ; install=yes ;;
?) die "unknown option. See -h for help."
esac
done
Expand Down Expand Up @@ -281,6 +280,7 @@ test -d cachelib || die "expected 'cachelib' directory not found in $PWD"


# After ensuring we are in the correct directory, set the installation prefix"
PREFIX=${install_path:-"$PWD/opt/cachelib/"}
CMAKE_PARAMS="$CMAKE_PARAMS -DCMAKE_INSTALL_PREFIX=$PREFIX"
CMAKE_PREFIX_PATH="$PREFIX/lib/cmake:$PREFIX/lib64/cmake:$PREFIX/lib:$PREFIX/lib64:$PREFIX:${CMAKE_PREFIX_PATH:-}"
export CMAKE_PREFIX_PATH
Expand Down
97 changes: 97 additions & 0 deletions docker/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2022, Intel Corporation

#
# build.sh - runs a Docker container from a Docker image with environment
# prepared for running CacheLib builds and tests. It uses Docker image
# tagged as described in ./images/build-image.sh.
#
# Notes:
# - set env var 'HOST_WORKDIR' to where the root of this project is on the host machine,
# - set env var 'OS' and 'OS_VER' properly to a system/Docker you want to build this
# repo on (for proper values take a look at the list of Dockerfiles at the
# utils/docker/images directory in this repo), e.g. OS=ubuntu, OS_VER=20.04,
# - set env var 'CONTAINER_REG' to container registry address
# [and possibly user/org name, and package name], e.g. "<CR_addr>/pmem/CacheLib",
# - set env var 'DNS_SERVER' if you use one,
# - set env var 'COMMAND' to execute specific command within Docker container or
# env var 'TYPE' to pick command based on one of the predefined types of build (see below).
#

set -e

source $(dirname ${0})/set-ci-vars.sh
IMG_VER=${IMG_VER:-devel}
TAG="${OS}-${OS_VER}-${IMG_VER}"
IMAGE_NAME=${CONTAINER_REG}:${TAG}
CONTAINER_NAME=CacheLib-${OS}-${OS_VER}
WORKDIR=/CacheLib # working dir within Docker container
SCRIPTSDIR=${WORKDIR}/docker

if [[ -z "${OS}" || -z "${OS_VER}" ]]; then
echo "ERROR: The variables OS and OS_VER have to be set " \
"(e.g. OS=fedora, OS_VER=32)."
exit 1
fi

if [[ -z "${HOST_WORKDIR}" ]]; then
echo "ERROR: The variable HOST_WORKDIR has to contain a path to " \
"the root of this project on the host machine."
exit 1
fi

if [[ -z "${CONTAINER_REG}" ]]; then
echo "ERROR: CONTAINER_REG environment variable is not set " \
"(e.g. \"<registry_addr>/<org_name>/<package_name>\")."
exit 1
fi

# Set command to execute in the Docker container
COMMAND="./run-build.sh";
echo "COMMAND to execute within Docker container: ${COMMAND}"

if [ -n "${DNS_SERVER}" ]; then DOCKER_OPTS="${DOCKER_OPTS} --dns=${DNS_SERVER}"; fi

# Check if we are running on a CI (Travis or GitHub Actions)
[ -n "${GITHUB_ACTIONS}" -o -n "${TRAVIS}" ] && CI_RUN="YES" || CI_RUN="NO"

# Do not allocate a pseudo-TTY if we are running on GitHub Actions
[ ! "${GITHUB_ACTIONS}" ] && DOCKER_OPTS="${DOCKER_OPTS} --tty=true"


echo "Running build using Docker image: ${IMAGE_NAME}"

# Run a container with
# - environment variables set (--env)
# - host directory containing source mounted (-v)
# - working directory set (-w)
docker run --privileged=true --name=${CONTAINER_NAME} -i \
${DOCKER_OPTS} \
--env http_proxy=${http_proxy} \
--env https_proxy=${https_proxy} \
--env TERM=xterm-256color \
--env WORKDIR=${WORKDIR} \
--env SCRIPTSDIR=${SCRIPTSDIR} \
--env GITHUB_REPO=${GITHUB_REPO} \
--env CI_RUN=${CI_RUN} \
--env TRAVIS=${TRAVIS} \
--env GITHUB_ACTIONS=${GITHUB_ACTIONS} \
--env CI_COMMIT=${CI_COMMIT} \
--env CI_COMMIT_RANGE=${CI_COMMIT_RANGE} \
--env CI_BRANCH=${CI_BRANCH} \
--env CI_EVENT_TYPE=${CI_EVENT_TYPE} \
--env CI_REPO_SLUG=${CI_REPO_SLUG} \
--env DOC_UPDATE_GITHUB_TOKEN=${DOC_UPDATE_GITHUB_TOKEN} \
--env DOC_UPDATE_BOT_NAME=${DOC_UPDATE_BOT_NAME} \
--env DOC_REPO_OWNER=${DOC_REPO_OWNER} \
--env COVERITY_SCAN_TOKEN=${COVERITY_SCAN_TOKEN} \
--env COVERITY_SCAN_NOTIFICATION_EMAIL=${COVERITY_SCAN_NOTIFICATION_EMAIL} \
--env TEST_TIMEOUT=${TEST_TIMEOUT} \
--env TZ='Europe/Warsaw' \
--shm-size=4G \
-v ${HOST_WORKDIR}:${WORKDIR} \
-v /etc/localtime:/etc/localtime \
-w ${SCRIPTSDIR} \
${IMAGE_NAME} ${COMMAND}

38 changes: 38 additions & 0 deletions docker/images/build-image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2016-2021, Intel Corporation
#
# build-image.sh - prepares a Docker image with <OS>-based environment for
# testing (or dev) purpose, tagged with ${CONTAINER_REG}:${OS}-${OS_VER}-${IMG_VER},
# according to the ${OS}-${OS_VER}.Dockerfile file located in the same directory.
# IMG_VER is a version of Docker image (it usually relates to project's release tag)
# and it defaults to "devel".
#

set -e
IMG_VER=${IMG_VER:-devel}
TAG="${OS}-${OS_VER}-${IMG_VER}"

if [[ -z "${OS}" || -z "${OS_VER}" ]]; then
echo "ERROR: The variables OS and OS_VER have to be set " \
"(e.g. OS=fedora, OS_VER=34)."
exit 1
fi

if [[ -z "${CONTAINER_REG}" ]]; then
echo "ERROR: CONTAINER_REG environment variable is not set " \
"(e.g. \"<registry_addr>/<org_name>/<package_name>\")."
exit 1
fi

echo "Check if the file ${OS}-${OS_VER}.Dockerfile exists"
if [[ ! -f "${OS}-${OS_VER}.Dockerfile" ]]; then
echo "Error: ${OS}-${OS_VER}.Dockerfile does not exist."
exit 1
fi

echo "Build a Docker image tagged with: ${CONTAINER_REG}:${TAG}"
docker build -t ${CONTAINER_REG}:${TAG} \
--build-arg http_proxy=$http_proxy \
--build-arg https_proxy=$https_proxy \
-f ${OS}-${OS_VER}.Dockerfile .
Loading