Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d199e02
Add RDMA and GPU Direct Storage support
harshavardhana Jan 12, 2026
576c152
Fix C++ issues in RDMA support
harshavardhana Jan 12, 2026
22d4122
fix: style issues
harshavardhana Jan 16, 2026
d851e50
feat: Add CRC64NVME checksum support for RDMA multipart uploads
harshavardhana Jan 17, 2026
1e7dc96
fix: Fall back to HTTP when RDMA buffer registration fails
harshavardhana Jan 18, 2026
2fdb4cc
feat: Switch RDMA to direct token API, update cuObj bindings to resil…
harshavardhana Mar 31, 2026
8dd5a87
feat: Vendor cuObj resiliency_v2 libs and update build paths
harshavardhana Mar 31, 2026
3398399
fix: Append buffer address and size to RDMA token for server parsing
harshavardhana Apr 1, 2026
2129843
fix: Remove trailing semicolon from RDMA token format
harshavardhana Apr 1, 2026
b506d43
fix: Add httplib connection/read timeouts for RDMA GET/PUT
harshavardhana Apr 1, 2026
d989486
feat: Vendor cuObj resiliency_v3 (1.2.0) libs
harshavardhana Apr 22, 2026
ef84f2a
feat: NIC-failover aware retry + HTTP fallback on RDMA path
harshavardhana Apr 22, 2026
45e1bd8
feat: Drop CUDA Toolkit build-time dependency
harshavardhana Apr 23, 2026
1f91fd4
rdma: bind HTTP socket to token NIC + process-wide cuObjClient
harshavardhana Apr 24, 2026
1420b78
rdma: propagate region on RDMA HTTP fallback + harden Validate
harshavardhana May 15, 2026
b2857ad
rdma: silence -Wmissing-field-initializers on s3_rdma_client_ctx
harshavardhana May 15, 2026
bf6e19e
rdma: drop vendored cpp-httplib, route control plane through curlpp
harshavardhana May 21, 2026
30a1bb9
cmake: gate RDMA / GPU Direct Storage behind MINIO_CPP_ENABLE_RDMA=OFF
harshavardhana May 21, 2026
e08cae0
vendor: document NVIDIA cuFile / cuObj license terms
harshavardhana May 21, 2026
3c9b694
vendor: bundle CUDA Toolkit EULA, reference Attachment A redistributa…
harshavardhana May 21, 2026
c275017
vendor: scrub sample IP from cuobj.json to placeholder
harshavardhana May 22, 2026
b8d958a
vendor: ground NOTICE in verbatim Attachment A entries; clarify Apach…
harshavardhana May 22, 2026
f95d83b
api: unify PutObjectArgs/GetObjectArgs (drop RDMA-specific overloads)…
harshavardhana May 22, 2026
509a723
examples: switch GetPutRDMA to libcudart + primary CUDA context
harshavardhana May 22, 2026
2074462
ci: Linux arm64 build matrix + per-arch RDMA libs + AIStor switch
harshavardhana May 26, 2026
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
1 change: 1 addition & 0 deletions .github/aistor-free-license.jwt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9.eyJhaWQiOjAsImNhcCI6MCwiaWF0IjoxLjc3NjAzODc4MDk2OTk4NjY0OGU5LCJpc3MiOiJzdWJuZXRAbWluLmlvIiwibGlkIjoiNDgzNzc4MmQtNjNiZi00NDIxLWFlNWYtMTYwOTEyOTFiY2M3Iiwib3JnIjoiIiwicGxhbiI6IkZSRUUiLCJzdWIiOiJlY28rcGxheUBtaW4uaW8iLCJ0cmlhbCI6ZmFsc2V9.Rt75WVubPqdI08pJLBrgL0nzvseNDE_Og3i45GkM1vnykLpBLFjDYjsiJF4dygvmLlpeodLRD_s2wkdcLHS_hBZ6vsQxfA06JQGu3L_KkfiaUEWw43oo4MI9cUmVll48
67 changes: 67 additions & 0 deletions .github/workflows/ci-rdma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: MinIO C++ Cmake (RDMA)

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- {
name: "Ubuntu_RDMA_GCC_amd64",
os: ubuntu-latest,
arch: "amd64",
build_type: "Release",
}
- {
name: "Ubuntu_RDMA_GCC_arm64",
os: ubuntu-24.04-arm,
arch: "arm64",
build_type: "Release",
}

name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}

steps:
- name: Checkout minio-cpp
uses: actions/checkout@v4
with:
path: "minio-cpp"

- name: Checkout vcpkg
uses: actions/checkout@v4
with:
repository: microsoft/vcpkg
path: "vcpkg"

- name: Install dependencies
run: |
sudo apt-get -qy update
sudo apt-get -qy install cmake libibverbs-dev librdmacm-dev libnuma-dev
cmake --version

- name: Configure and Build
shell: bash
run: |
./vcpkg/bootstrap-vcpkg.sh
cd minio-cpp
../vcpkg/vcpkg install
cmake . -B ./build \
-DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} \
-DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake \
-DMINIO_CPP_TEST:BOOL=ON \
-DMINIO_CPP_ENABLE_RDMA:BOOL=ON
cmake --build ./build --config ${{matrix.config.build_type}} -j 4
14 changes: 11 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ jobs:
- {
name: "Ubuntu_Latest_GCC",
os: ubuntu-latest,
arch: "amd64",
build_type: "Release",
cc: "gcc",
cxx: "g++"
}
- {
name: "Ubuntu_Latest_GCC_arm64",
os: ubuntu-24.04-arm,
arch: "arm64",
build_type: "Release",
cc: "gcc",
cxx: "g++"
Expand Down Expand Up @@ -66,11 +75,9 @@ jobs:
- name: Install dependencies if Ubuntu
if: startsWith(matrix.config.name, 'Ubuntu_Latest_GCC')
run: |
wget --quiet -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main' | sudo tee -a /etc/apt/sources.list
sudo apt-get -qy update
sudo apt-get -qy install cmake
wget --quiet https://dl.min.io/server/minio/release/linux-amd64/minio
wget --quiet https://dl.min.io/aistor/minio/release/linux-${{ matrix.config.arch }}/minio
chmod +x minio
cmake --version
./minio --version
Expand Down Expand Up @@ -107,6 +114,7 @@ jobs:
cp ./minio-cpp/tests/public.crt ./minio-cpp/tests/private.key ~/.minio/certs/
sudo cp ./minio-cpp/tests/public.crt /usr/local/share/ca-certificates/
sudo update-ca-certificates
export MINIO_LICENSE=$(cat ./minio-cpp/.github/aistor-free-license.jwt)
MINIO_CI_CD=true ./minio server /tmp/test-xl/{1...4}/ &
sleep 10

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ jobs:

- name: Install dependencies
run: |
sudo apt -qy install clang-format-18
clang-format-18 --version
sudo apt -qy install clang-format-20
clang-format-20 --version

- name: Version Check
shell: bash
Expand All @@ -44,4 +44,4 @@ jobs:
- name: Coding Style Check
shell: bash
working-directory: minio-cpp
run: CLANG_FORMAT=clang-format-18 ./check-style.sh
run: CLANG_FORMAT=clang-format-20 ./check-style.sh
94 changes: 94 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

MinIO C++ SDK is an S3-compatible object storage client library. This fork extends the upstream minio-cpp with RDMA (Remote Direct Memory Access) and NVIDIA GPU Direct Storage support for high-performance data transfers.

## Build Commands

### Prerequisites
- CMake 3.10+
- C++17 compiler
- vcpkg package manager (set `VCPKG_ROOT` environment variable)
- NVIDIA CUDA toolkit at `/usr/local/cuda` (for RDMA/GPU features)
- cuObjClient library (for RDMA support)

### Configure and Build

```bash
# Configure both Debug and Release builds (recommended)
./configure.sh -DMINIO_CPP_TEST=ON

# Or configure manually for Debug
cmake . -B build/Debug -DCMAKE_BUILD_TYPE=Debug -DMINIO_CPP_TEST=ON

# Build
cmake --build ./build/Debug
```

### Build Options
- `MINIO_CPP_TEST=ON` - Build tests and examples
- `MINIO_CPP_MAKE_DOC=ON` - Build Doxygen documentation
- `BUILD_SHARED_LIBS=ON` - Build shared library (default is static)

### Running Tests

```bash
./build/Debug/tests
```

### Running Examples

Examples are built when `MINIO_CPP_TEST=ON`. Run individual examples:
```bash
./build/Debug/MakeBucket
./build/Debug/PutObject
./build/Debug/GetPutRDMA # RDMA-specific example
./build/Debug/GPUHostDisk # GPU Direct Storage example
```

## Architecture

### Core Components

- **`minio::s3::Client`** (`include/miniocpp/client.h`, `src/client.cc`) - Main S3 client class with high-level operations (UploadObject, DownloadObject, etc.)
- **`minio::s3::BaseClient`** (`include/miniocpp/baseclient.h`, `src/baseclient.cc`) - Base class implementing low-level S3 API operations and request execution

### Request/Response Flow

- **`args.h`** - Argument structs for each S3 operation (e.g., `PutObjectArgs`, `GetObjectArgs`)
- **`response.h`** - Response types returned by operations
- **`request.h`** - HTTP request construction
- **`http.h`** - HTTP client abstraction using curlpp

### Authentication

- **`providers.h`/`credentials.h`** - Credential providers (StaticProvider, EnvProvider, etc.)
- **`signer.h`** - AWS Signature V4 request signing

### RDMA/GPU Support (Fork-specific)

- **`rdma.h`** - RDMA transport layer with S3 signing for GPU Direct Storage
- **`rdma-httplib.h`** - HTTP-over-RDMA implementation
- **`nvidia-cufile.h`** - NVIDIA cuFile integration headers
- **`nvidia-cuobjclient.h`** - cuObjClient wrapper for RDMA operations

The RDMA implementation uses `objectPut`/`objectGet` callbacks that are invoked by the cuFile RDMA layer for direct GPU-to-storage transfers.

## Dependencies (vcpkg)

- curlpp - HTTP client
- inih - INI file parsing for config
- nlohmann-json - JSON handling
- openssl - TLS/crypto
- pugixml - XML parsing for S3 responses

Additional system dependencies for RDMA: libcufile, libcuobjclient, libibverbs, librdmacm

## Code Style Guidelines

- Do not add obvious comments (e.g., "Safe: Validate() ensures X has value")
- Use `std::optional<T>` for values that may be uninitialized (not sentinel values like `-1` for unsigned types)
- RDMA buffers require page-aligned memory - use `posix_memalign` or `std::aligned_alloc` (C++17)
49 changes: 48 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,53 @@ project(miniocpp
include(GNUInstallDirs)
include(CheckIncludeFiles)
include(CMakePackageConfigHelpers)
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{VCPKG_ROOT})
include("$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake")
endif()

option(MINIO_CPP_TEST "Build tests" OFF)
option(MINIO_CPP_MAKE_DOC "Build documentation" OFF)
# RDMA / GPU Direct Storage support. OFF by default so consumers without
# NVIDIA cuFile + cuObj + ibverbs + rdmacm do not need those libraries on
# the host. When ON, links against the vendored NVIDIA blobs in
# vendor/cuobj/ and defines MINIO_CPP_RDMA so headers expose the
# GetObjectRDMAArgs / PutObjectRDMAArgs API surface.
option(MINIO_CPP_ENABLE_RDMA "Enable RDMA and GPU Direct Storage support" OFF)

set(MINIO_CPP_CFLAGS)
set(MINIO_CPP_INCLUDES)
set(MINIO_CPP_LIBS)
set(MINIO_CPP_STD "17")

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC" OR "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC")
# MSVC
else()
# GCC/Clang/AppleClang/...
LIST(APPEND MINIO_CPP_CFLAGS -Wall -Wextra -Wconversion)
list(APPEND MINIO_CPP_CFLAGS -Wall -Wextra -Wconversion)
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 8.0 AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.0 AND NOT MINGW)
list(APPEND MINIO_CPP_LIBS stdc++fs)
endif()
endif()

if (MINIO_CPP_ENABLE_RDMA)
if (WIN32 OR APPLE)
message(FATAL_ERROR "MINIO_CPP_ENABLE_RDMA is only supported on Linux")
endif()
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|AMD64|amd64)$")
set(MINIO_CPP_RDMA_ARCH "x86_64")
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64)$")
set(MINIO_CPP_RDMA_ARCH "aarch64")
else()
message(FATAL_ERROR "MINIO_CPP_ENABLE_RDMA: unsupported CMAKE_SYSTEM_PROCESSOR '${CMAKE_SYSTEM_PROCESSOR}'")
endif()
set(MINIO_CPP_RDMA_LIBDIR "${CMAKE_SOURCE_DIR}/vendor/cuobj/lib/${MINIO_CPP_RDMA_ARCH}")
if (NOT EXISTS "${MINIO_CPP_RDMA_LIBDIR}/libcuobjclient.so")
message(FATAL_ERROR "MINIO_CPP_ENABLE_RDMA: ${MINIO_CPP_RDMA_ARCH} cuObj client libs not vendored at ${MINIO_CPP_RDMA_LIBDIR}")
endif()
list(APPEND MINIO_CPP_INCLUDES ${CMAKE_SOURCE_DIR}/vendor/cuobj/include)
list(APPEND MINIO_CPP_LIBS "-Bdynamic -L${MINIO_CPP_RDMA_LIBDIR} -lcufile -lpthread -lnuma -ldl -libverbs -lrdmacm -lrt -lcuobjclient")
endif()

# Dependencies
# ------------

Expand Down Expand Up @@ -115,6 +144,16 @@ set(MINIO_CPP_HEADERS
include/miniocpp/utils.h
)

if (MINIO_CPP_ENABLE_RDMA)
list(APPEND MINIO_CPP_HEADERS
include/miniocpp/c_api.h
include/miniocpp/nvidia-cufile.h
include/miniocpp/nvidia-cuobjclient.h
include/miniocpp/rdma.h
)
list(APPEND MINIO_CPP_SOURCES src/c_api.cc)
endif()

option(BUILD_SHARED_LIBS "Build using shared libraries" OFF)

IF (BUILD_SHARED_LIBS)
Expand All @@ -132,8 +171,12 @@ target_compile_features(miniocpp PUBLIC cxx_std_${MINIO_CPP_STD})
target_include_directories(miniocpp PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${MINIO_CPP_INCLUDES}>
)
target_link_libraries(miniocpp PUBLIC ${MINIO_CPP_LIBS})
if (MINIO_CPP_ENABLE_RDMA)
target_compile_definitions(miniocpp PUBLIC MINIO_CPP_RDMA)
endif()
set_target_properties(miniocpp PROPERTIES VERSION "${MINIO_CPP_VERSION_STRING}")
set_target_properties(miniocpp PROPERTIES POSITION_INDEPENDENT_CODE ON)

Expand Down Expand Up @@ -198,6 +241,10 @@ if (MINIO_CPP_TEST)
GetObjectProgress
)

if (MINIO_CPP_ENABLE_RDMA)
list(APPEND EXAMPLE_APPS GetPutRDMA GPUHostDisk)
endif()

foreach(target ${EXAMPLE_APPS})
add_executable(${target} examples/${target}.cc)
target_compile_features(${target} PUBLIC cxx_std_${MINIO_CPP_STD})
Expand Down
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,28 @@ int main(int argc, char* argv[]) {
}
```

## RDMA / GPU Direct Storage (optional)

This SDK has optional support for RDMA-direct S3 PUT/GET against MinIO
servers, including GPUDirect Storage (cuFile) for transfers directly to
and from CUDA device buffers. Build with:

```
cmake -DMINIO_CPP_ENABLE_RDMA=ON ...
```

This requires NVIDIA cuFile, cuObj client/server, libibverbs, and
librdmacm. Pre-built NVIDIA binaries are vendored under `vendor/cuobj/`
for convenience; see `vendor/cuobj/NOTICE` for the applicable NVIDIA
license terms. The default build (`MINIO_CPP_ENABLE_RDMA=OFF`) omits
the entire RDMA stack and has no dependency on any of those libraries.

## License

This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/minio/minio-cpp/blob/master/LICENSE) for more information.

The artifacts under `vendor/cuobj/` and the NVIDIA-derived headers
(`include/miniocpp/cuda.h`, `nvidia-cufile.h`, `nvidia-cuobjclient.h`)
are NOT covered by this Apache 2.0 grant — they originate from NVIDIA
Corporation and are subject to NVIDIA's software license agreements.
See [`vendor/cuobj/NOTICE`](vendor/cuobj/NOTICE) for details.
31 changes: 24 additions & 7 deletions check-style.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,31 @@ if [ -z "${CLANG_FORMAT}" ]; then
CLANG_FORMAT="clang-format"
fi

FIX_MODE=0
if [ "$1" = "--fix" ] || [ "$1" = "-f" ]; then
FIX_MODE=1
fi

function do_clang_format() {
echo "verifying '${CLANG_FORMAT} --output-replacements-xml --style=Google $@'"
if ${CLANG_FORMAT} --output-replacements-xml --style=Google "$@" | grep -q '<replacement '; then
echo "ERROR:" "$@" "not in Google C/C++ style"
echo "To fix formatting run"
echo "$ ${CLANG_FORMAT} -i --style=Google" "$@"
return 255
if [ "$FIX_MODE" = "1" ]; then
if ${CLANG_FORMAT} --output-replacements-xml --style=Google "$@" | grep -q '<replacement '; then
echo "fixing '$@'"
${CLANG_FORMAT} -i --style=Google "$@"
return 0
fi
else
echo "verifying '${CLANG_FORMAT} --output-replacements-xml --style=Google $@'"
if ${CLANG_FORMAT} --output-replacements-xml --style=Google "$@" | grep -q '<replacement '; then
echo "ERROR:" "$@" "not in Google C/C++ style"
echo "To fix formatting run"
echo "$ ${CLANG_FORMAT} -i --style=Google" "$@"
return 255
fi
fi
}

tmpfile="tmpfile.$RANDOM"
find src include examples tests -iname "*.cc" -o -iname "*.h" > "$tmpfile"
find src include examples tests -iname "*.cc" -o -iname "*.h" | grep -v 'cuda\.h$' | grep -v 'cufile\.h$' | grep -v 'cufile_info\.h$' > "$tmpfile"
ec=0
while read -r file; do
if ! do_clang_format "$file"; then
Expand All @@ -24,4 +37,8 @@ while read -r file; do
done < "$tmpfile"
rm -f "$tmpfile"

if [ "$FIX_MODE" = "1" ]; then
echo "All formatting issues fixed."
fi

exit "$ec"
Loading
Loading