Skip to content

docs: add a Mooncake CacheRuntime sample for client-less cache systems - #6163

Merged
cheyang merged 3 commits into
fluid-cloudnative:masterfrom
btxu-db:docs/mooncake-cache-runtime-sample
Aug 29, 2026
Merged

docs: add a Mooncake CacheRuntime sample for client-less cache systems#6163
cheyang merged 3 commits into
fluid-cloudnative:masterfrom
btxu-db:docs/mooncake-cache-runtime-sample

Conversation

@btxu-db

@btxu-db btxu-db commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR does

Mooncake is a distributed KVCache store with no POSIX mount semantics: applications talk to the cache service through its own client library instead of reading and writing files through a mount point. Its CacheRuntimeClass therefore declares only master and worker under topology, and omits the client component.

This PR documents that client-less setup:

  • docs/{en,zh}/samples/cacheruntime/mooncake_cache_runtime.md — a new end-to-end sample: create the CacheRuntimeClass / Dataset / CacheRuntime, write and read data across pods and nodes through the Mooncake Python client, inspect the reported cache status, plus an FAQ entry.
  • docs/{en,zh}/dev/generic_cache_runtime_integration.md — a new "cache systems without a client component" section describing when the client component may be omitted, and noting that Fluid still creates a Bound PVC/PV that application pods must not mount.
  • docs/{en,zh}/TOC.md — table of contents entries.

Docs only; no code changes.

Ⅱ. Does this pull request fix one issue?

NONE

Ⅲ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.

No tests — this PR only adds documentation.

Ⅳ. Describe how to verify it

The sample was run end to end on a kind cluster: the Dataset reaches Bound with only master and worker declared, data written from one client pod is readable from a second client pod on a different node after the writer has exited, and reportSummary.sh populates status.cacheStates (cached: 4.00MiB, fileNum: 1). All command output shown in the document is copied from that run.

Rendering: all relative links in the touched documents resolve to existing files, and the en/zh versions have identical heading structures.

Ⅴ. Special notes for reviews

@fluid-e2e-bot

fluid-e2e-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

Hi @btxu-db. Thanks for your PR.

I'm waiting for a fluid-cloudnative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Mooncake is a distributed KVCache store with no POSIX mount semantics:
applications talk to the cache service through its own client library
instead of a mount point. Its CacheRuntimeClass therefore declares only
master and worker, and omits the client component.

Add an end-to-end sample walking through that minimal setup, and document
the client-less topology in the generic cache runtime integration guide,
including the fact that Fluid still creates a Bound PVC/PV that
application pods must not mount.

Requires fluid-cloudnative#6157, without which the controller panics when a topology omits
the client component.

Signed-off-by: btxu-db <btxu-db@outlook.com>
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.19%. Comparing base (05f0665) to head (fcf7a53).
⚠️ Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6163      +/-   ##
==========================================
+ Coverage   65.13%   65.19%   +0.05%     
==========================================
  Files         485      486       +1     
  Lines       34039    34150     +111     
==========================================
+ Hits        22171    22263      +92     
- Misses      10127    10136       +9     
- Partials     1741     1751      +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents Mooncake as a client-less CacheRuntime, building on #6157.

Changes:

  • Adds bilingual end-to-end Mooncake samples.
  • Documents client-less cache-system integration behavior.
  • Adds English and Chinese navigation entries.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
docs/en/TOC.md Adds the English sample link.
docs/zh/TOC.md Adds the Chinese sample link.
docs/en/samples/cacheruntime/mooncake_cache_runtime.md Adds the English Mooncake walkthrough.
docs/zh/samples/cacheruntime/mooncake_cache_runtime.md Adds the Chinese Mooncake walkthrough.
docs/en/dev/generic_cache_runtime_integration.md Documents client-less integration requirements.
docs/zh/dev/generic_cache_runtime_integration.md Adds the corresponding Chinese guidance.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

print("match:", hashlib.md5(payload).hexdigest() == hashlib.md5(got).hexdigest())
```

> The connection address is the master pod's DNS name `mooncake-demo-master-0.svc-mooncake-demo-master`, not the Service name. The CacheRuntimeClass declares a headless Service, which does not expose ports itself, so you must reach the pod through its DNS record.
Comment on lines +29 to +32
本示例使用的 Mooncake 镜像:

```
btxu/mooncake:v3
print("match:", hashlib.md5(payload).hexdigest() == hashlib.md5(got).hexdigest())
```

> 连接地址使用的是 master Pod 的 DNS 名 `mooncake-demo-master-0.svc-mooncake-demo-master`,而不是 Service 名。CacheRuntimeClass 中声明的是 headless Service,其本身不暴露端口,需要通过 Pod 的 DNS 记录访问。
Comment on lines +29 to +32
The Mooncake image used in this example:

```
btxu/mooncake:v3
mooncake-client-2 1/1 Running 0 79s 10.244.2.15 fluid-mooncake-worker <none> <none>
```

In the second pod, only read and verify (the `setup` parameters are the same as above):
mooncake-client-2 1/1 Running 0 79s 10.244.2.15 fluid-mooncake-worker <none> <none>
```

在第二个 Pod 中只做读取和校验(`setup` 参数与上文相同):
Check the demo image's build context into samples/mooncake/docker so the
sample can be rebuilt from the repository instead of depending on an
opaque image in a personal registry. Pin both the Docker Hub image and
its Alibaba Cloud mirror to an immutable digest, note that the two
registries are personal accounts with no availability guarantee, and
recommend building and substituting your own image.

Correct the note on addressing the master: Fluid creates the component
Service as headless with no ports, but that only affects SRV records, so
the Service name resolves to the backing pod IPs just as the per-pod name
does. The per-pod name is preferred only because it stays pinned to a
single replica.

Show the second client pod opening its own Python session and repeating
the MooncakeDistributedStore initialization, which the reader previously
had to infer; following the sample literally hit a NameError on store.

Also add the trailing newline missing from the Chinese sample.

Signed-off-by: btxu-db <btxu-db@outlook.com>
Comment thread samples/mooncake/docker/Dockerfile Fixed
Comment thread samples/mooncake/docker/Dockerfile Fixed
Comment thread samples/mooncake/docker/Dockerfile Fixed
Comment on lines +51 to +56
exec mooncake_client \
--host="$WORKER_HOST" \
--port=50052 \
--global_segment_size="$SEGMENT_SIZE" \
--master_server_address="$MASTER_ADDR" \
--metadata_server="$METADATA_ADDR" \
Install Python wheels only so no setup script runs at install time, pin
nvidia-cuda-runtime-cu12, and run the components as an unprivileged user.
Document why the worker's metadata and transfer connections stay clear-text.

Signed-off-by: btxu-db <btxu-db@outlook.com>
@btxu-db
btxu-db force-pushed the docs/mooncake-cache-runtime-sample branch from a7c6163 to fcf7a53 Compare August 28, 2026 04:22
@sonarqubecloud

Copy link
Copy Markdown

@cheyang cheyang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@fluid-e2e-bot

fluid-e2e-bot Bot commented Aug 29, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheyang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cheyang
cheyang merged commit 395048f into fluid-cloudnative:master Aug 29, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants