Repository navigation
rgw: add experimental cuObject S3 RDMA server support - #70458
Conversation
Config Diff Tool Output+ added: rgw_cuobj_buffer_count (rgw.yaml.in)
+ added: rgw_cuobj_num_dcis (rgw.yaml.in)
+ added: rgw_cuobj_buffer_size (rgw.yaml.in)
+ added: rgw_cuobj_enabled (rgw.yaml.in)
+ added: rgw_cuobj_rdma_ip (rgw.yaml.in)
+ added: rgw_cuobj_rdma_port (rgw.yaml.in)
+ added: rgw_cuobj_log_level (rgw.yaml.in)
The above configuration changes are found in the PR. Please update the relevant release documentation if necessary. |
There was a problem hiding this comment.
Pull request overview
Adds optional NVIDIA cuObject RDMA acceleration to RGW S3 PUT/GET operations.
Changes:
- Adds cuObject server lifecycle, registered buffer pooling, and RDMA transfers.
- Integrates RDMA into S3 data paths and byte accounting.
- Adds build-time and runtime configuration.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| CMakeLists.txt | Adds the cuObject build option and library discovery. |
| src/include/config-h.in.cmake | Exposes the cuObject compile definition. |
| src/common/options/rgw.yaml.in | Defines RDMA runtime settings. |
| src/rgw/CMakeLists.txt | Builds and links cuObject support. |
| src/rgw/rgw_cuobj.h | Declares the RDMA server and buffer pool. |
| src/rgw/rgw_cuobj.cc | Implements lifecycle, parsing, pooling, and transfers. |
| src/rgw/rgw_appmain.cc | Initializes and shuts down the server. |
| src/rgw/rgw_common.h | Tracks per-request RDMA bytes. |
| src/rgw/rgw_op.cc | Implements the RDMA PUT path. |
| src/rgw/rgw_rest_s3.h | Adds S3 RDMA request state. |
| src/rgw/rgw_rest_s3.cc | Implements RDMA GET and response handling. |
| src/rgw/rgw_process.h | Extends request accounting output. |
| src/rgw/rgw_process.cc | Returns transferred RDMA bytes. |
| src/rgw/rgw_asio_frontend.cc | Includes RDMA traffic in access logs. |
| src/rgw/rgw_log.cc | Adds RDMA traffic to operation logs. |
| } | ||
| auto size_str = rdma_descr.substr(first_colon + 1, second_colon - first_colon - 1); | ||
| ldout(g_ceph_context, 21) << "rgw_cuobj: parsed size from RDMA descriptor: " << size_str << dendl; | ||
| return std::stoull(size_str, nullptr, 16); |
There was a problem hiding this comment.
@mkogan1 You might like ceph::parse or ceph::consume in common/strtol.h
There was a problem hiding this comment.
Thanks for the suggestion. Replaced std::stoull() with ceph::parse<size_t>(size_str, 16).value_or(0) from common/strtol.h. It requires a complete, valid hexadecimal field without throwing; invalid or overflowing sizes return zero, which the PUT path maps to HTTP 400 / InvalidArgument.
Permanent tests exercise the production parser with malformed fields, overflow, trailing garbage, embedded NULs, and valid boundary values. The parser suite and radosgw build passed.
Included in commit 95612ccd6b9.
| return 0; | ||
| } | ||
| ldout(g_ceph_context, 21) << "rgw_cuobj: parsed address from RDMA descriptor: " << rdma_descr.substr(0, first_colon) << dendl; | ||
| return std::stoull(rdma_descr.substr(0, first_colon), nullptr, 16); |
There was a problem hiding this comment.
The address parser now returns std::optional<uint64_t> using ceph::parse<uint64_t>(..., 16). Both RDMA transfer helpers reject a failed parse with -EINVAL before allocating a cuObject channel. PUT preserves that error as InvalidArgument; GET also propagates it to HTTP 400.
Tests cover malformed and overflowing addresses in both production transfer helpers, plus GET/PUT error propagation and buffer release. All four cuObject suites and the radosgw build passed.
Included in commit 95612ccd6b9.
| if (bl_len > 0) { | ||
| auto* cuobj = RGWCuObjServer::get_instance(); | ||
| if (!rdma_buf && cuobj) { | ||
| rdma_buf = cuobj->acquire_buffer(s->obj_size); |
There was a problem hiding this comment.
Checked against the current PR head, 95612ccd6b9: this is already handled. RGWGetObj::execute() computes total_len from the resolved range, and the RDMA response path calls acquire_buffer(total_len) rather than allocating for the full object.
Verified locally with CuObjGet.RangeAllocatesOnlyResponseLength: a request for bytes 2-5 of a 1024-byte object, with a 16-byte pool buffer, requests only 4 bytes and returns HTTP 206 with the correct Content-Range and RDMA byte count.
| if (rdma_active) { | ||
| dump_content_length(s, 0); |
There was a problem hiding this comment.
This was valid for the earlier code and is already addressed in the current PR head, 95612ccd6b9. RDMA response framing and transfer paths require rdma_active && get_data. HEAD sets get_data to false, retains the object's Content-Length, and performs no RDMA transfer.
Verified locally with CuObjGet.HeadPreservesContentLengthWithoutRdma: HEAD with an RDMA token returns HTTP 200 and the 4-byte object's content length, with no response body, RDMA success headers, or RDMA writes.
| dump_header(s, "x-amz-rdma-reply", "200"); | ||
| dump_header(s, "x-amz-rdma-bytes-transferred", total_len); |
There was a problem hiding this comment.
Rechecked the current PR head, 95612ccd6b9: data callbacks acquire/fill the buffer without sending response headers. After execute() finishes, complete() calls send_response(), which performs the synchronous RDMA write and checks its result before emitting HTTP success or RDMA reply headers. Allocation, source/filter, and transfer failures can therefore still produce an HTTP error.
CuObjGet.SuccessWaitsForOperationAndRdmaCompletion passes locally and checks rdma_complete -> http_status -> http_complete. The GET suite also covers missing EOF callbacks, empty objects, buffer exhaustion, failed/short writes, truncated reads, and filter failures.
| option(WITH_RADOSGW_CUOBJ "cuObject RDMA support for RADOS Gateway" OFF) | ||
| if(WITH_RADOSGW_CUOBJ) | ||
| find_library(CUOBJSERVER_LIBRARY cuobjserver REQUIRED) |
There was a problem hiding this comment.
Added a standalone RGW administration guide at doc/radosgw/s3rdma.rst, following the D3N documentation conventions. It covers architecture, hardware/software dependencies, build and runtime setup, client verification, memory sizing, the token/response protocol, transfer limits, and troubleshooting, with references for all seven configuration options.
The guide is linked from the RGW index, configuration reference, CMake option, and option descriptions. It passed a focused Sphinx build using Ceph's extensions, strict reference checking, and warnings treated as errors; the full documentation site was not built. Configuration validation and the radosgw build also passed.
Included in commit 95612ccd6b9.
| size_t RGWCuObjServer::parse_rdma_descriptor_size(const std::string& rdma_descr) | ||
| { | ||
| ldout(g_ceph_context, 21) << "rgw_cuobj: parsing RDMA descriptor: " << rdma_descr << dendl; |
There was a problem hiding this comment.
Added unittest_rgw_cuobj, unittest_rgw_cuobj_put, and unittest_rgw_cuobj_log, and expanded unittest_rgw_cuobj_get. Coverage includes the production descriptor parsers and buffer pool, concurrent exclusive buffer ownership, malformed tokens, short/oversized/failed completions, pool exhaustion, range GET, HEAD, response ordering, buffer release, storage/filter failures, and directional accounting.
GET/PUT use fake transports; PUT also uses an in-memory writer. The suites need the cuObject SDK at build time, but no RDMA hardware or running cluster. All four test targets and radosgw built, and all 78 cases passed (34 core, 18 GET, 14 PUT, 12 accounting):
ctest --test-dir build --output-on-failure --parallel 4 -R '^unittest_rgw_cuobj($|_)'Included in commit 95612ccd6b9.
| rdma_buf = cuobj->acquire_buffer(s->obj_size); | ||
| rdma_buf_offset = 0; | ||
| } | ||
| if (rdma_buf) { |
There was a problem hiding this comment.
Checked the current PR head, 95612ccd6b9: a failed acquire_buffer(total_len) already returns -EBUSY, mapped to HTTP 503 / ServiceUnavailable, before response headers are sent. This covers both an exhausted pool and a response larger than a pool entry.
Verified locally with CuObjGet.BufferExhaustionReturnsServiceUnavailable and CuObjGet.OversizedResponseReturnsServiceUnavailable: both return 503 without RDMA success headers or RDMA writes. The oversized-response regression test is included in commit 95612ccd6b9.
| ssize_t rdma_ret = cuobj_srv->rdma_read_from_client(s->object->get_name(), rbuf, 0, total, rdma_descr); | ||
| if (rdma_ret < 0) { | ||
| cuobj_srv->release_buffer(rbuf); | ||
| ldpp_dout(this, 0) << "rgw_cuobj: ERROR: RDMA read failed: " << rdma_ret << dendl; | ||
| op_ret = -EIO; | ||
| return; | ||
| } |
There was a problem hiding this comment.
Added an exact-size check before handing RDMA PUT data to the filter/storage writer. Any nonnegative completion different from the descriptor's declared size releases the buffer and returns -EIO / HTTP 500. This also rejects zero-byte and oversized completions.
The PUT tests return 0-3 and 5 bytes for a 4-byte descriptor and verify that no writer process()/complete() call or RDMA success response occurs, and that the buffer is released once. An exact 4-byte completion reaches storage successfully; negative errors are covered too. All 14 PUT cases and the radosgw build passed.
Included in commit 95612ccd6b9.
| } | ||
| ldpp_dout(this, 20) << "rgw_cuobj: RDMA PUT size=" << total | ||
| << " from descriptor" << dendl; | ||
| auto* rbuf = cuobj_srv->acquire_buffer(total); |
There was a problem hiding this comment.
Addressed this using the explicit-limit/documentation option. Each RDMA PUT still requires one buffer for its payload. rgw_cuobj_buffer_size and the new doc/radosgw/s3rdma.rst guide now document the default 8 MiB limit per PUT or multipart part, and per GET response/range, plus HTTP 503 for oversized requests or pool exhaustion.
The guide explains sizing larger buffers, multipart uploads, range GETs, ordinary HTTP, and the buffer_count * buffer_size memory cost (1 GiB per daemon by default). Both pool options are marked startup-only, matching initialization. Configuration/documentation checks and oversized GET/PUT regression tests passed.
Included in commit 95612ccd6b9.
| ceph::coarse_real_clock::duration latency{}; | ||
| process_request(env, &req, uri_prefix, &client, y, | ||
| scheduler, &user, &latency, &http_ret); | ||
| scheduler, &user, &latency, &http_ret, &rdma_bytes); |
There was a problem hiding this comment.
seems reasonable to me
| } | ||
| auto size_str = rdma_descr.substr(first_colon + 1, second_colon - first_colon - 1); | ||
| ldout(g_ceph_context, 21) << "rgw_cuobj: parsed size from RDMA descriptor: " << size_str << dendl; | ||
| return std::stoull(size_str, nullptr, 16); |
| tls_channel_id = m_server->allocateChannelId(); | ||
| tls_channel_valid = true; | ||
| } | ||
| ldout(m_cct, 21) << "rgw_cuobj: allocated channel ID " << tls_channel_id << dendl; |
There was a problem hiding this comment.
why do we have a new log level (21)? isn't 20 enough for anybody?
There was a problem hiding this comment.
the level 21 logs are for my RDMA debugging and very high verbosity - they may apear more than once on every requests, do not want to spam the logs at level 20, since the level 21 is not unprecedented in RGW, thought it's OK to use it.
| cuObjRDMATunable params; | ||
| params.setNumDcis(num_dcis); | ||
|
|
||
| ldout(cct, 1) << "rgw_cuobj: initializing cuObjServer on " |
There was a problem hiding this comment.
I will only post this one time, but for these dout statements with many inlines, I am inclined to say that for new code, we should consider using the new ldpp_dout_fmt() macro
There was a problem hiding this comment.
Converted all 27 log statements in rgw_cuobj.cc to ldpp_dout_fmt(), with DoutPrefixProvider support in rgw_cuobj.h and local prefix providers for the static parsers. The existing rgw_cuobj: prefix and log levels are preserved, including the intentional level 21.
The logging conversion is confined to these two files. The radosgw build and cuObject tests passed; a debug run also confirmed that level-21 output retains the prefix.
Included in commit 95612ccd6b9.
| RGWCuObjServer::RDMABufEntry* RGWCuObjServer::acquire_buffer(size_t needed_size) | ||
| { | ||
| ldout(m_cct, 21) << "rgw_cuobj: acquiring RDMA buffer for size " << needed_size << dendl; | ||
| for (size_t i = 0; i < m_buf_count; i++) { |
There was a problem hiding this comment.
hmm. maybe we could so something to reduce tendency toward convoying
There was a problem hiding this comment.
Changed buffer acquisition so each scan starts at a random entry using Ceph's per-thread random engine, then visits the full pool once with wraparound. This spreads competing requests across entries instead of having every thread contend on entry zero. A relaxed busy-flag load also skips occupied entries before attempting the atomic claim.
The acquire/release synchronization and exhaustion behavior are preserved. Concurrent regression tests cover pool sizes 1, 7, 16, and 33 with 16 threads, checking exclusive ownership and that all available capacity can be claimed. The tests and radosgw build passed.
Included in commit 95612ccd6b9.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
079d19f to
4be04f7
Compare
02fa12f to
e3cb6de
Compare
58a461c to
95612cc
Compare
95612cc to
4a0a03b
Compare
|
/config check ok |
588dd28 to
f6e45f1
Compare
d2d50f3 to
1f11c58
Compare
cbodley
left a comment
There was a problem hiding this comment.
the use of dlopen helps a lot here 👍 do we really need the non-shim option at all? trying to support both modes seems to add a lot of complexity to cmake, install-deps.sh, packaging and the container build that don't seem useful in the long run. it feels like we could remove all of that if we just rely on the user to install that shared library
| - rgw | ||
| flags: | ||
| - startup | ||
| - name: rgw_cuobj_library |
There was a problem hiding this comment.
do we really need a config option for this library name? can we not just hardcode to libcuobjserver.so?
There was a problem hiding this comment.
@cbodley ack, pushed an update for both comments, non-shim mode removed and the rgw_cuobj_library conf removed
Enable experimental cuObject support by default without the NVIDIA SDK. Load libcuobjserver.so.2 through the ABI shim; runtime RDMA stays opt-in. RDMA requests fail with HTTP 500 when the runtime is unavailable. Keep NVIDIA installation optional and pin libcuobjserver to 2.0.0.109-1. Use env INSTALL_CUOBJ_RUNTIME=ON ./install-deps.sh or the container flag --with-cuobj-runtime. Default builds install no NVIDIA packages. Update ceph.spec, container build support, documentation and unit tests. Signed-off-by: Mark Kogan <[email protected]> Assisted-by: IBM Bob Assisted-by: OpenAI Codex: GPT-6
1f11c58 to
fe8ff32
Compare
|
jenkins test make check |
|
jenkins test api |
684aa29 to
326f930
Compare
| # Experimental cuObject S3 RDMA support (enabled by default). The | ||
| # ABI shim loads libcuobjserver at runtime without an SDK build dependency. | ||
| %bcond_without cuobj |
There was a problem hiding this comment.
will any architecture need to turn this off? if not, it probably doesn't need to be conditional - so we could leave ceph.spec.in unchanged. the cmake variable WITH_RADOSGW_CUOBJ may also be unnecessary?
There was a problem hiding this comment.
ack, there is no reason not to build the shim even on arch that currently does not support cuObj like s390, removing all the conditional simplifies the code nicely, pushed update without WITH_RADOSGW_CUOBJ
| ./src/script/build-with-container.py -d centos9 -e packages | ||
| ``` | ||
|
|
||
| Build RPM packages with experimental RGW cuObject support on Rocky Linux 10: |
There was a problem hiding this comment.
can this stuff in ContainerBuild.md be removed?
There was a problem hiding this comment.
can this stuff in ContainerBuild.md be removed?
@cbodley ack, removed, sorry about that
|
@cbodley hi, removed the optional cuObject library installation mechanisms to further clean the PR as discussed on stand-up, and added to the documentation that for container build - it is possible to install the cuObj libraries inside the container using |
326f930 to
c82788d
Compare
Always build the cuObject ABI shim with RGW, removing WITH_RADOSGW_CUOBJ
and the cuobj RPM conditional. Runtime RDMA remains disabled by default.
Remove NVIDIA installation hooks and restore generic build files to
upstream. Document pinned runtime installation and non-root requirements.
Build a development container with the NVIDIA runtime:
./src/script/build-with-container.py --container-engine=podman \
-d rocky10 --tag=+cuobj \
--custom-image-build-command='dnf install -y dnf-plugins-core' \
--custom-image-build-command='dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel10/x86_64/cuda-rhel10.repo' \
--custom-image-build-command='dnf install -y libcuobjserver-2.0.0.109-1 libibverbs librdmacm numactl-libs' \
-e build-container
Validation: affected sources rebuilt; all 83 cuObject tests pass.
Signed-off-by: Mark Kogan <[email protected]>
Assisted-by: OpenAI Codex: GPT-6
c82788d to
a9166ec
Compare
|
jenkins test make check |
|
jenkins test make check arm64 |
|
jenkins test signed |
|
jenkins test submodules |
Map common transport errno values to distinct S3 Code strings and record error_ret in JSON ops log entries (encode struct v17). Use ceph::from_error_code() on rgw::io::Exception in PUT paths. Align unittest_rgw_cuobj_put with EIO -> InternalError mapping after ceph#70458 cuObject tests landed on main. Document ops log error fields in doc/radosgw/ops-log.rst. Fixes: https://tracker.ceph.com/issues/82075 Signed-off-by: ramin.najarbashi <[email protected]>
Add experimental S3 RDMA server support using NVIDIA cuObject. S3 PUT and GET payloads transfer between client and RGW memory over RDMA, while authentication, headers, metadata and request status remain on HTTP. This integration is intended for testing and evaluation; configuration and behavior may change between releases.
Key components:
RGWCuObjServermanages the server lifecycle, pre-registered buffer pool and per-thread channel IDs.206inx-amz-rdma-reply.cuObject support and the ABI shim are always compiled when RGW is built, for both source and RPM builds. RGW loads the fixed library name
libcuobjserver.so.2at runtime. Building RGW requires no NVIDIA SDK or CUDA toolkit. Default dependency installation adds no NVIDIA repositories or packages, and the resulting Ceph RPMs have no NVIDIA dependency. This PR leavesceph.spec.inand the generic build scripts unchanged.RDMA remains disabled at runtime until
rgw_cuobj_enabled=trueandrgw_cuobj_rdma_ipare configured; setrgw_cuobj_rdma_portas needed. A missing library or required symbol leaves ordinary HTTP service available. GET and PUT requests carrying an RDMA token return HTTP 500 when cuObject is unavailable.Container RPM builds need no NVIDIA packages (use
-d rocky9for EL9):To prepare a Rocky Linux 10 x86_64 development container with the NVIDIA runtime for RDMA testing:
./src/script/build-with-container.py --container-engine=podman \ -d rocky10 --tag=+cuobj \ --custom-image-build-command='dnf install -y dnf-plugins-core' \ --custom-image-build-command='dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel10/x86_64/cuda-rhel10.repo' \ --custom-image-build-command='dnf install -y libcuobjserver-2.0.0.109-1 libibverbs librdmacm numactl-libs' \ -e build-containerThe custom commands explicitly install the pinned cuObject server runtime and its RDMA/NUMA libraries inside the image.
--tag=+cuobjappends.cuobjto the image tag, and-e build-containerbuilds only the image. Ordinary builds and hardware-free unit tests need no NVIDIA runtime; install it where RGW runs to serve RDMA requests, including on the host for a local vstart cluster.See the S3 RDMA guide and container build instructions for runtime dependencies and configuration.
Validation: affected RGW sources and all four cuObject test executables were rebuilt on x86_64;
radosgwrelinked successfully and all 83 unit tests passed, including missing-library and missing-symbol cases. CMake integration checks and documentation builds with warnings treated as errors passed. The pinned runtime installation was verified in Rocky 9 and 10 containers, and EL9/EL10 RPM metadata parses for x86_64, aarch64 and s390x. A full RPM rebuild and an actual s390x build were not run for this revision.Hardware testing requires an x86_64 or ARM64 RGW host with the cuObject server 2.x runtime, a cuObject-aware client with its runtime dependencies, and an RDMA network with ConnectX-5 or newer NICs (ConnectX-4 is unsupported).
To test with vstart, add the RDMA settings:
Generate RDMA traffic with a cuObject-aware client, such as NooBaa's
s3perf.js:Observe RDMA traffic with ibtop:
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.