Skip to content

test(e2e): verify runtime config injection for clientless Mooncake pods - #6286

Open
btxu-db wants to merge 2 commits into
fluid-cloudnative:masterfrom
btxu-db:test/mooncake-runtime-config-injection
Open

btxu-db wants to merge 2 commits into
fluid-cloudnative:masterfrom
btxu-db:test/mooncake-runtime-config-injection

Conversation

@btxu-db

@btxu-db btxu-db commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR does

Mooncake 应用通过 SDK 直连 master。现有读写 Job 的 Pod 模板增加了 clientless.fluid.io/inject: "true" 标签和 fluid.io/datasets: mooncake-demo 注解。容器启动时加载 FLUID_RUNTIME_CONFIG_PATH_MOONCAKE_DEMO 指向的 runtime.sh,通过 ${MASTER_NAME}-0.${MASTER_SERVICE_NAME} 定位 master,完成原有的 4 MiB 写入和读回校验。

Worker 也改为直接加载 runtime.json 同目录的 runtime.sh,从中读取服务名和存储配额。测试镜像因此移除了 jq。

Ⅱ. Does this pull request fix one issue?

Fixes #6251

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

  • Pod admission webhook 处理的是 Job 创建的 Pod。读写成功后,用例检查该 Pod 的 rw 容器是否将 ConfigMap fluid-runtime-config-mooncake-demo 只读挂载到 /etc/fluid/config/mooncake-demo,并验证 FLUID_RUNTIME_CONFIG_PATH_MOONCAKE_DEMO 指向挂载目录内的 runtime.sh。
  • 用 kubectl run --dry-run=server 提交引用不存在数据集 mooncake-missing 的 Pod。用例要求 clientless.fluid.io webhook 拒绝请求,且错误信息中包含 "mooncake-missing" not found。

Ⅳ. Describe how to verify it

在已启用 CacheRuntime 并部署 #6197 webhook 的 kind 集群上,从仓库根目录构建镜像并运行 Mooncake 用例。以下命令使用 CI 的集群名 fluid-cluster,运行前请确认 kubectl 当前上下文指向该集群。

docker build -t fluidcloudnative/mooncake:e2e test/gha-e2e/mooncake/image
kind load docker-image fluidcloudnative/mooncake:e2e --name fluid-cluster
bash test/gha-e2e/mooncake/test.sh

Ⅴ. Special notes for reviews

此用例依赖 #6197 提供的注入标签和 webhook,请在 #6197 合入后合入本 PR。

本次 CI 的五个 Kubernetes 版本 都停在缺失数据集的拒绝断言。当前 master 的 Helm chart 尚未注册 clientless.fluid.io webhook,因此 API Server 放行了这次 server-side dry-run。

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

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.13%. Comparing base (07efc76) to head (74d77d9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6286   +/-   ##
=======================================
  Coverage   66.13%   66.13%           
=======================================
  Files         486      486           
  Lines       34616    34616           
=======================================
  Hits        22894    22894           
  Misses       9964     9964           
  Partials     1758     1758           

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURES] Add e2e coverage for runtime config injection of client-less cache runtimes (Mooncake)

1 participant