| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
OpenCSD is an improved version of ZCSD achieving snapshot consistency log-structured filesystem (LFS) (FluffleFS) integration on Zoned Namespaces (ZNS) Computational Storage Devices (CSD). Below is a diagram of the overall architecture as presented to the end user. However, the actual implementation differs due to the use of emulation using technologies such as QEMU, uBPF and SPDK.
FluffleFS is the filesystem built on using the OpenCSD framework. Designed based on a LFS with the flash optimized F2FS filesystem as inspiration. FluffleFS is unique in that it is written in user space code thanks to the FUSE library while still offering simulated CSD offloading support with concurrent regular user access to the same file!
| Module | Task |
|---|---|
| arguments | Parse commandline arguments to relevant components |
| bpf_helpers | Headers to define functions available from within BPF |
| bpf_programs | BPF programs ready to run on a CSD using bpf_helpers |
| fuse_lfs | Log Structured Filesystem in FUSE |
| nvme_csd | Emulated additional NVMe commands to enable BPF CSDs |
| nvme_zns | Interface to handle zoned I/O using abstracted backends |
| nvme_zns_memory | Non-persistent memory backed emulated ZNS SSD backend |
| nvme_zns_spdk | Persistent SPDK backed ZNS SSD backend |
| output | Neatly control messages to stdout and stderr with levels |
| spdk_init | Provides SPDK initialization and handles for nvme_zns & nvme_csd |
This project has a large selection of dependencies as shown below. Note however, these dependencies are already available in the image QEMU base image.
Warning Meson must be below version 0.60 due to a bug in DPDK
The following dependencies are automatically compiled and installed into the build directory.
| Dependency | Version |
|---|---|
| backward | 1.6 |
| boost | 1.74.0 |
| bpftool | 5.14 |
| bpf_load | 5.10 |
| dpdk | spdk-21.11 |
| generic-ebpf | c9cee73 |
| fuse-lfs | 526454b |
| libbpf | 0.5 |
| libfuse | 3.10.5 |
| libbpf-bootstrap | 67a29e5 |
| linux | 5.14 |
| spdk | 22.09 |
| isa-l | spdk-v2.30.0 |
| rocksdb | 6.25.3 |
| qemu | 7.2.0 |
| uBPF | 9eb26b4 |
| xenium | f1d28d0 |
Several setups are available of which two are officially supported. We recommend using QEMU for a non-volatile filesystem setup provided by QEMU ZNS emulation.
QEMU setup will provide an emulated environment with emulated Zoned Namespaces NVMe device providing a non-volatile CSD filesystem experience. In addition, the use of QEMU ensures software libraries and frameworks use supported versions.
The QEMU setup will try to download a 4.5 GB qcow2 image that will fail if not downloaded within 30 minutes. Alternatively, the file can be downloaded as torrent through this link. This file should be saved as ./build/opencsd/arch-qemucsd.qcow2.
Alternatively the QEMU image can be downloaded after executing make qemu-build by running cd oepncsd; ./download-image.sh.
# git clone https://gitlab.dantalion.nl/vu/opencsd.git
cd opencsd
git submodule update --init
mkdir build
cd build
cmake ..
# This will also create a 32gb zns image
make qemu-build
cmake .. # this prevents re-compiling dependencies on every next make command
cd opencsd
source activate
# By default qemu will use 4 CPU cores and 8GB of memory + kvm
./qemu-start-256-kvm.sh
# Wait for QEMU VM to fully boot... (might take some time)# Type password (arch)
ssh arch@localhost -p 7777
cd opencsd
git pull origin master
git -c submodule."dependencies/qemu".update=none submodule update --init
mkdir build
cd build
cmake -DENABLE_DOCUMENTATION=off -DIS_DEPLOYED=on ..
make fuse-entry-spdk -j $(nproc)
cmake .. # this prevents re-compiling dependencies on every next make commandNote, in case of failure to detect native kernel sources install location; a fixed version from ./dependencies/linux will be used. This can cause failures in vmlinux.h with bpftool when accessing /sys/kernel/btf/vmlinux.
# git clone https://gitlab.dantalion.nl/vu/opencsd.git
cd opencsd
git submodule update --init
mkdir build
cd build
cmake ..
make fuse-entry -j $(nproc)
cmake .. # this prevents re-compiling dependencies on every next make commandWithin the build folder will be a opencsd/activate script. This script can be sourced using any shell source opencsd/activate. This script configures environment variables such as LD_LIBRARY_PATH while also exposing an essential sudo alias: ld-sudo.
The environment variables ensure any linked libraries can be found for targets compiled by Cmake. Additionally, ld-sudo provides a mechanism to start targets with sudo privileges while retaining these environment variables. The environment can be deactivated at any time by executing deactivate.
All usage examples assume the steps of the previous example have been executed prior!
Mounts and starts the filesystem in a volatile mode under the test directory. Any output will be printed to stdout / stderr.
# working directory: opencsd (root)
cd build
make fuse-entry
cmake ..
cd opencsd
mkdir −p test
source activate
ld−sudo ./fuse−entry −− −d −o max_read=2147483647 test &On a mounted filesystem copy the pre-compiled passthrough read kernel. Next, place data in a test file and execute a example python script to orchestrate executing the read kernel on the example file.
# working directory: opencsd/build/opencsd
cp ../bin/bpf_flfs_read.o test/
echo "hello world" > test/test
ld-sudo python3 ../../python/csd-read-passthrough.py# ld-sudo python3
import os
import xattr
import pdb
read_stride = 524288
pdb.set_trace()
fd = os.open("test/test", os.O_RDWR)
filesize = os.stat("test/test").st_size
kern_ino = os.stat("test/bpf_flfs_read.o").st_ino
xattr.setxattr(
"test/test", "user.process.csd_read_stream", bytes(f"{kern_ino}", "utf-8")
)
steps = int(filesize / read_stride)
if steps % read_stride != 0: steps += 1
for i in range(0, steps):
os.pread(fd, read_stride, i * read_stride)These are grouped by component and ordered by importance.
This section documents all configuration parameters that the CMake project exposes and how they influence the project. For more information about the CMake project see the report generated from the documentation folder. Below all parameters are listed along their default value and a brief description.
| Parameter | Default | Use case |
|---|---|---|
| ENABLE_TESTS | ON | Enables unit tests and adds tests target |
| ENABLE_CODECOV | OFF | Produce code coverage report \w unit tests |
| ENABLE_DOCUMENTATION | ON | Produce code documentation using doxygen & LaTeX |
| ENABLE_PLAYGROUND | OFF | Enables playground targets |
| ENABLE_LEAK_TESTS | OFF | Add compile parameter for address sanitizer |
| IS_DEPLOYED | OFF | Indicate that CMake project is deployed in QEMU |
For several parameters a more in depth explanation is required, primarily IS_DEPLOYED. This parameter is used as the CMake project is both used to compile QEMU and configure it as well as compile binaries to run inside QEMU. As a results, the CMake project needs to be able to identify if it is being executed outside of QEMU or not. This is what IS_DEPLOYED facilitates. Particularly, IS_DEPLOYED prevents the compilation of QEMU from source.
This project is available under the MIT license, several limitations apply including:
| Back | FazBrowse Home | New Git URL |