Skip to content

test: add an e2e case for a client-less CacheRuntime topology - #6164

Closed
btxu-db wants to merge 1 commit into
fluid-cloudnative:masterfrom
btxu-db:test/mooncake-client-less-e2e
Closed

test: add an e2e case for a client-less CacheRuntime topology#6164
btxu-db wants to merge 1 commit into
fluid-cloudnative:masterfrom
btxu-db:test/mooncake-client-less-e2e

Conversation

@btxu-db

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

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR does

Adds an e2e case covering a client-less CacheRuntime topology — a CacheRuntimeClass whose topology declares only master and worker, with no client component.

No existing case covers that shape: the curvine case ships a client component, so the client-less path through cacheruntime-controller is currently untested. Mooncake is used as the concrete cache system because it genuinely has no POSIX mount semantics — applications talk to the cache service through its own client library rather than a mount point.

  • test/gha-e2e/mooncake/ — the case itself (CacheRuntimeClass / Dataset / CacheRuntime manifests, a read/write Job, a negative-case pod, and test.sh).
  • test/gha-e2e/mooncake/image/ — the image build context: a Dockerfile on top of python:3.12.13-slim plus the two scripts Fluid invokes (custom-entrypoint.sh, reportSummary.sh).
  • .github/scripts/build-all-images.sh — build and kind-load ${IMG_REPO}/mooncake:e2e.
  • .github/scripts/gha-e2e.sh — run the new case after curvine_e2e.

Ⅱ. 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.

This PR is itself an e2e case. It asserts:

  1. No panic, Dataset reaches Bound with the client component omitted — a regression guard for the nil pointer dereference fixed in fix: avoid nil pointer dereference in CacheRuntime configmap builder #6157. The controller logs are scanned for panic: / nil pointer dereference while waiting, so a regression reports its root cause instead of just a Bound timeout.
  2. No client-side artifacts: no client DaemonSet, no client pods, and cacheruntime.status.client.phase stays empty. (status.client does exist as {"phase":""} and spec.client is filled in by CRD defaults, so the empty phase is the actual criterion.)
  3. ReportSummary works: status.cacheStates gets populated, ufsTotal == cacheCapacity for this UFS-less system, and cached / fileNum reflect data actually written.
  4. Data path works without a mount point: a Job writes and reads back 4 MiB through Mooncake's Python client and verifies the md5, with no volumes / volumeMounts anywhere in the pod.
  5. The PVC is Bound but not mountable: an application pod mounting the Dataset's PVC gets a FailedMount event mentioning the missing FUSE mount point. This is the behaviour the docs' FAQ describes, pinned down so it cannot go stale silently.
  6. Cleanup: AdvancedStatefulSet / Service / PV / PVC are all garbage collected after the Dataset and CacheRuntime are deleted.

On failure the case dumps controller logs, describe output for the CacheRuntime / Dataset / stuck pod, job logs and namespace events.

Ⅳ. Describe how to verify it

bash test/gha-e2e/mooncake/test.sh

against a kind cluster with Fluid deployed and fluidcloudnative/mooncake:e2e loaded, which is what .github/scripts/build-all-images.sh and .github/scripts/gha-e2e.sh wire up for CI. The case was run end to end locally on kind.

Ⅴ. Special notes for reviews

  • Depends on fix: avoid nil pointer dereference in CacheRuntime configmap builder #6157. Without that fix the controller panics on this topology and the case fails at wait_dataset_bound — which is precisely the regression it guards. Please merge fix: avoid nil pointer dereference in CacheRuntime configmap builder #6157 first.
  • Related to docs: add a Mooncake CacheRuntime sample for client-less cache systems #6163, which documents this same client-less setup. That PR mentions I could contribute the image build context to this repository; test/gha-e2e/mooncake/image/ here is it. Happy to follow up on docs: add a Mooncake CacheRuntime sample for client-less cache systems #6163 with a docs change pointing readers at this directory once both land.
  • The image is built in-repo rather than pulled from an external registry, following test/gha-e2e/jindo/oss-emulator: e2e runs on every PR, an external image going away turns the pipeline red, and the two scripts Fluid invokes need to be reviewable. The only external dependency is Mooncake's official PyPI package. python:3.12.13-slim is pinned by digest; the non-slim variant would grow the image from ~470MB to ~1.9GB, which e2e then has to kind-load as well.
  • One worker replica, since the CI kind cluster is single-node and replica scaling is already covered by the curvine case.
  • test/gha-e2e/mooncake/cacheruntimeclass.yaml deliberately declares no resources on its containers, and says why in a comment: when the CacheRuntimeClass template sets resources but the CacheRuntime does not, syncRuntimeSpec passes the zero value to updateResources, which overwrites the template's resources with an empty value — silently dropping them and triggering an ASTS rollout that can leave the Dataset stuck in Failed. That looks like a genuine bug; I can open a separate issue with the details if that would be useful.

Mooncake has no POSIX mount semantics, so its CacheRuntimeClass declares
only master and worker. No existing e2e case covers that shape: curvine
ships a client component, so the client-less path through the controller
is untested.

The case pins down the behaviour that path is expected to have:

- the controller does not panic and the Dataset reaches Bound with the
  client component omitted (a regression guard for the nil pointer
  dereference fixed in fluid-cloudnative#6157);
- no client DaemonSet or client pods are created, and
  status.client.phase stays empty;
- the ReportSummary script populates status.cacheStates, and cached
  reflects data written through the cache system's own client;
- the Dataset PVC reaches Bound but cannot be mounted by application
  pods, which is what the docs' FAQ describes.

The image is built in-repo from test/gha-e2e/mooncake/image rather than
pulled from an external registry, for the same reason as the jindo
oss-emulator: e2e runs on every PR, and the two scripts Fluid invokes
inside the image have to be reviewable.

Signed-off-by: btxu-db <btxu-db@outlook.com>
@fluid-e2e-bot

fluid-e2e-bot Bot commented Aug 16, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zwwhdls for approval by writing /assign @zwwhdls in a comment. For more information see:The Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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

@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.

@sonarqubecloud

Copy link
Copy Markdown

restartPolicy: Never
automountServiceAccountToken: false
containers:
- name: app
restartPolicy: Never
automountServiceAccountToken: false
containers:
- name: app
jq \
&& rm -rf /var/lib/apt/lists/*

RUN pip install --no-cache-dir \
Comment on lines +25 to +27
RUN pip install --no-cache-dir \
mooncake-transfer-engine-non-cuda==0.3.12.post1 \
nvidia-cuda-runtime-cu12
# python:3.12.13-slim — slim is required: the full variant carries an extra
# ~700MB build toolchain, growing the image from ~470MB to ~1.9GB, and e2e also
# has to kind-load it onto the node and keep a second copy there.
FROM python:3.12.13-slim@sha256:229a2c5bfa27522db7815ea81f9bed70af17ccb9de9fc7ad142b1877b5830d36
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" \
@btxu-db btxu-db closed this Aug 16, 2026
@btxu-db

btxu-db commented Aug 16, 2026

Copy link
Copy Markdown
Contributor Author

Closing this — opened by mistake on my side, not intended for review. Sorry for the noise.

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.

2 participants