Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
Merge volatile module, store persistent and volatile module in root d…
Browse files Browse the repository at this point in the history
…ir (#349)

Cherry-pick volatile branch, store persistent and volatile module to independent directories.

Signed-off-by: Wu, Jiayu <[email protected]>
  • Loading branch information
JiayuZzz authored Oct 27, 2022
1 parent d6b630b commit e3bbe95
Show file tree
Hide file tree
Showing 330 changed files with 36,239 additions and 161 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Check Java codestyle
- name: Check Persistent Java codestyle
run: |
cd java
cd persistent/java
mvn spotless:check
- name: Check Volatile Java codestyle
run: |
cd volatile/java
mvn spotless:check
- name: Get cmake
Expand All @@ -36,8 +41,16 @@ jobs:
- name: Init submodules
run: git submodule update --init --recursive

- name: Check codestyle & Build
- name: Check Persistent codestyle & Build
run: |
cd persistent
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCHECK_CPP_STYLE=ON -DWITH_JNI=ON
make -j
- name: Check Volatile codestyle & Build
run: |
cd volatile
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCHECK_CPP_STYLE=ON -DWITH_JNI=ON
make -j
Expand Down
13 changes: 11 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[submodule "extern/gtest"]
path = extern/gtest
[submodule "volatile/extern/jemalloc"]
path = volatile/extern/jemalloc
url = https://github.com/jemalloc/jemalloc
[submodule "volatile/extern/numactl"]
path = volatile/extern/numactl
url = https://github.com/numactl/numactl
[submodule "persistent/extern/gtest"]
path = persistent/extern/gtest
url = https://github.com/google/googletest.git
[submodule "volatile/extern/gtest"]
path = volatile/extern/gtest
url = https://github.com/google/googletest.git
File renamed without changes
File renamed without changes
115 changes: 5 additions & 110 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,124 +1,19 @@
<div align="center">
<p align="center"> <img src="pic/kvdk_logo.png" height="180px"><br></p>
<p align="center"> <img src=".pic/kvdk_logo.png" height="180px"><br></p>
</div>

`KVDK` (Key-Value Development Kit) is a key-value store library implemented in C++ language. It is designed for supporting DRAM, Optane persistent memory and CXL memory pool. It also demonstrates several optimization methods for high performance with tiered memory. Besides providing the basic APIs of key-value store, it offers several advanced features, like read-modify-write, checkpoint, etc.
`KVDK` (Key-Value Development Kit) is a key-value store library implemented in C++ language. It is designed for supporting Optane persistent memory, DRAM and CXL memory pool. It also demonstrates several optimization methods for high performance with tiered memory. Besides providing the basic APIs of key-value store, it offers several advanced features, like read-modify-write, checkpoint, etc.

## Features
* Rich data types
* string, sorted, hash, list, hash
* Basic KV operations
* get/put/update/delete/scan
* Read-Modify-Write
* Support TTL
* Atomic Batch Write
* Snapshot based Scan
* Consistent Dump & Restore to/from storage
* Consistent Checkpoint
* Transaction
* C/C++/Java APIs

# Limitations
* The maximum supported key-value size is 64KB-4GB.
* No approach to key-value compression.
* Users can't expand the persistent memory space on the fly.
**Notice: The DRAM engine and CXL memory pool are in development, you can checkout to v1.0 for a release version of PMEM based persistent engine.**

## Getting the Source
```bash
git clone --recurse-submodules https://github.com/pmem/kvdk.git
```

## Building
### Install dependent tools and libraries on Ubuntu 18.04
```bash
sudo apt install make clang-format-9 pkg-config g++ autoconf libtool asciidoctor libkmod-dev libudev-dev uuid-dev libjson-c-dev libkeyutils-dev pandoc libhwloc-dev libgflags-dev libtext-diff-perl bash-completion systemd wget git curl

git clone https://github.com/pmem/ndctl.git
cd ndctl
git checkout v70.1
./autogen.sh
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
make
sudo make install

git clone https://github.com/pmem/pmdk.git
cd pmdk
git checkout 1.11.1
make
sudo make install

wget https://github.com/Kitware/CMake/releases/download/v3.12.4/cmake-3.12.4.tar.gz
tar vzxf cmake-3.12.4.tar.gz
cd cmake-3.12.4
./bootstrap
make
sudo make install

```

### Install dependent tools and libraries on CentOS 8
```bash
yum config-manager --add-repo /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
yum config-manager --set-enabled PowerTools

yum install -y git gcc gcc-c++ autoconf automake asciidoc bash-completion xmlto libtool pkgconfig glib2 glib2-devel libfabric libfabric-devel doxygen graphviz pandoc ncurses kmod kmod-devel libudev-devel libuuid-devel json-c-devel keyutils-libs-devel gem make cmake libarchive clang-tools-extra hwloc-devel perl-Text-Diff gflags-devel curl

git clone https://github.com/pmem/ndctl.git
cd ndctl
git checkout v70.1
./autogen.sh
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
make
sudo make install

git clone https://github.com/pmem/pmdk.git
cd pmdk
git checkout 1.11.1
make
sudo make install

wget https://github.com/Kitware/CMake/releases/download/v3.12.4/cmake-3.12.4.tar.gz
tar vzxf cmake-3.12.4.tar.gz
cd cmake-3.12.4
./bootstrap
make
sudo make install
```

### Compile KVDK
```bash
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCHECK_CPP_STYLE=ON && make -j
```

### How to test it on a system without PMEM
```bash
# set the correct path for pmdk library
export LD_LIBRARY_PATH=/usr/local/lib64

# setup a tmpfs for test
mkdir /mnt/pmem0
mount -t tmpfs -o size=2G tmpfs /mnt/pmem0

# force the program work on non-pmem directory
export PMEM_IS_PMEM_FORCE=1

cd kvdk/build/examples
# Note: this requires CPU supporting AVX512
./cpp_api_tutorial

```

## Benchmarks
[Here](./doc/benchmark.md) are the examples of how to benchmark the performance of KVDK on your systems.

## Documentations

### User Guide

Please refer to [User guide](./doc/user_doc.md) for API introductions of KVDK.
## User guide

### Architecture
KVDK of different storage type are independently modules, please refer to [persistent](./persistent/README.md) and [volatile](./volatile/README.md) for building, test and docs.

# Support
Welcome to join the wechat group or slack channel for KVDK tech discussion.
Expand Down
53 changes: 53 additions & 0 deletions persistent/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# IDE related
.idea/
cmake-build-*
.vscode/
.vs/

# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

build/
.cache/

scripts/result*
scripts/__pycache__

java/out
java/target
java/benchmark/target
java/examples/target
java/test-libs
java/*.log
java/include/io_pmem_*.h
java/src/main/resources
2 changes: 1 addition & 1 deletion CMakeLists.txt → persistent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ add_cppstyle(src ${CMAKE_CURRENT_SOURCE_DIR}/engine/*.c*
${CMAKE_CURRENT_SOURCE_DIR}/engine/utils/*.h*
${CMAKE_CURRENT_SOURCE_DIR}/examples/tutorial/*.c*
${CMAKE_CURRENT_SOURCE_DIR}/benchmark/*.c*
${CMAKE_CURRENT_SOURCE_DIR}/include/kvdk/*.h*
${CMAKE_CURRENT_SOURCE_DIR}/include/kvdk/persistent/*.h*
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.c*
${CMAKE_CURRENT_SOURCE_DIR}/tests/*.h*)

Expand Down
126 changes: 126 additions & 0 deletions persistent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<div align="center">
<p align="center"> <img src="../.pic/kvdk_logo.png" height="180px"><br></p>
</div>

This is the persistent module of `kvdk`, based on Intel Optane Persistent Memory.

## Features
* Rich data types
* string, sorted, hash, list, hash
* Basic KV operations
* get/put/update/delete/scan
* Read-Modify-Write
* Support TTL
* Atomic Batch Write
* Snapshot based Scan
* Consistent Dump & Restore to/from storage
* Consistent Checkpoint
* Transaction
* C/C++/Java APIs

# Limitations
* The maximum supported key-value size is 64KB-4GB.
* No approach to key-value compression.
* Users can't expand the persistent memory space on the fly.

## Getting the Source
```bash
git clone --recurse-submodules https://github.com/pmem/kvdk.git
```

## Building
### Install dependent tools and libraries on Ubuntu 18.04
```bash
sudo apt install make clang-format-9 pkg-config g++ autoconf libtool asciidoctor libkmod-dev libudev-dev uuid-dev libjson-c-dev libkeyutils-dev pandoc libhwloc-dev libgflags-dev libtext-diff-perl bash-completion systemd wget git curl

git clone https://github.com/pmem/ndctl.git
cd ndctl
git checkout v70.1
./autogen.sh
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
make
sudo make install

git clone https://github.com/pmem/pmdk.git
cd pmdk
git checkout 1.11.1
make
sudo make install

wget https://github.com/Kitware/CMake/releases/download/v3.12.4/cmake-3.12.4.tar.gz
tar vzxf cmake-3.12.4.tar.gz
cd cmake-3.12.4
./bootstrap
make
sudo make install

```

### Install dependent tools and libraries on CentOS 8
```bash
yum config-manager --add-repo /etc/yum.repos.d/CentOS-Linux-PowerTools.repo
yum config-manager --set-enabled PowerTools

yum install -y git gcc gcc-c++ autoconf automake asciidoc bash-completion xmlto libtool pkgconfig glib2 glib2-devel libfabric libfabric-devel doxygen graphviz pandoc ncurses kmod kmod-devel libudev-devel libuuid-devel json-c-devel keyutils-libs-devel gem make cmake libarchive clang-tools-extra hwloc-devel perl-Text-Diff gflags-devel curl

git clone https://github.com/pmem/ndctl.git
cd ndctl
git checkout v70.1
./autogen.sh
./configure CFLAGS='-g -O2' --prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
make
sudo make install

git clone https://github.com/pmem/pmdk.git
cd pmdk
git checkout 1.11.1
make
sudo make install

wget https://github.com/Kitware/CMake/releases/download/v3.12.4/cmake-3.12.4.tar.gz
tar vzxf cmake-3.12.4.tar.gz
cd cmake-3.12.4
./bootstrap
make
sudo make install
```

### Compile KVDK
```bash
mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DCHECK_CPP_STYLE=ON && make -j
```

### How to test it on a system without PMEM
```bash
# set the correct path for pmdk library
export LD_LIBRARY_PATH=/usr/local/lib64

# setup a tmpfs for test
mkdir /mnt/pmem0
mount -t tmpfs -o size=2G tmpfs /mnt/pmem0

# force the program work on non-pmem directory
export PMEM_IS_PMEM_FORCE=1

cd kvdk/build/examples
# Note: this requires CPU supporting AVX512
./cpp_api_tutorial

```

## Benchmarks
[Here](./doc/benchmark.md) are the examples of how to benchmark the performance of KVDK on your systems.

## Documentations

### User Guide

Please refer to [User guide](./doc/user_doc.md) for API introductions of KVDK.

### Architecture

# Support
Welcome to join the wechat group or slack channel for KVDK tech discussion.
- [Wechat](https://github.com/pmem/kvdk/issues/143)
- [Slack Channel](https://join.slack.com/t/kvdksupportcommunity/shared_invite/zt-12b66vg1c-4FGb~Ri4w8K2_msau6v86Q)
4 changes: 2 additions & 2 deletions benchmark/bench.cpp → persistent/benchmark/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <thread>

#include "generator.hpp"
#include "kvdk/engine.hpp"
#include "kvdk/types.hpp"
#include "kvdk/persistent/engine.hpp"
#include "kvdk/persistent/types.hpp"

using namespace google;
using namespace KVDK_NAMESPACE;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/user_doc.md → persistent/doc/user_doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ or how to reopen an existing KVDK instance at the path supplied.
(In the following example, PMem is mounted as /mnt/pmem0/ and the KVDK instance is named tutorial_kvdk_example.)

```c++
#include "kvdk/engine.hpp"
#include "kvdk/namespace.hpp"
#include "kvdk/persistent/engine.hpp"
#include "kvdk/persistent/namespace.hpp"
#include <algorithm>
#include <cassert>
#include <random>
Expand Down
Loading

0 comments on commit e3bbe95

Please sign in to comment.