Repository navigation
Conversation
Signed-off-by: btxu-db <btxu-db@outlook.com>
Signed-off-by: btxu-db <btxu-db@outlook.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🔵 Needs a closer look
The admission E2E depends on the still-open, conflicted #6197 webhook changes, requiring maintainer confirmation of merge ordering and a Kubernetes matrix rerun to validate the integration.
No open issues 🎉
What changed in this PR
Adds Mooncake end-to-end coverage for clientless runtime configuration injection, addressing #6251 and depending on the webhook changes in #6197.
Changes:
- Updates the read/write Job to request injected configuration and use it to discover the master for the existing 4 MiB round trip.
- Checks the admitted Pod’s configuration mount and environment variable, and verifies rejection of a missing dataset.
- Simplifies worker startup to source
runtime.shdirectly, removing the image’sjqdependency.
| File | Description |
|---|---|
test/gha-e2e/mooncake/test.sh |
Adds injection and missing-dataset rejection assertions. |
test/gha-e2e/mooncake/rw_job.yaml |
Requests injection and discovers the master from runtime configuration. |
test/gha-e2e/mooncake/image/Dockerfile |
Removes the unused jq package. |
test/gha-e2e/mooncake/image/custom-entrypoint.sh |
Loads worker service names and quota from runtime.sh. |
Review effort: Balanced
cheyang
left a comment
There was a problem hiding this comment.
Thanks — this is exactly the coverage #6251 asked for, and the two of us verified it independently: every name the new assertions rely on (label, annotation, webhook, volume/mount/env shapes, runtime.sh exports) traces cleanly into #6197, and both of our deterministic harnesses (19/19 and 16/16 checks + a Go contract test) found no defects in the PR's own shell/jq/YAML logic. The worker-side simplification already works against base master.
One hard gate, and it's the only thing holding the merge: check_missing_dataset_rejected requires the clientless.fluid.io webhook that only unmerged #6197 registers, so this PR's kind-e2e is red on all five Kubernetes versions by construction (CI run 45047215477 — each job stops at the same panic, before the rw job even runs). You flagged this yourself in the PR description, so this is just enforcing it: please keep this PR open until #6197 lands, rebase onto it, and re-run the matrix green on the final head — your manual kind passes were taken against #6197@9c8d0e9f, one commit behind its current head b9315aca4, so the CI evidence needs regenerating anyway.
The meaningful disagreement in our debate was one sub-nit (whether the job-name pod selector should move to batch.kubernetes.io/job-name) — refuted: that label doesn't exist on Kubernetes < 1.27 and the matrix includes v1.22/v1.24, so the current selector is the only valid one. Copilot (Reviewer C) reviewed this head and raised no findings, so nothing to add or contest there.
Next round
[MUST] Land #6197 first, rebase this PR onto the post-#6197 master, and re-run the kind-e2e matrix green on the final head (F1) — merge is gated on exactly this.
[SHOULD] Keep the hard-coded strings (label/webhook/env/ConfigMap/denial text) in sync when #6197 finalizes (F2); add a jq guard or header note for local runs (F3); optionally commit the entrypoint stub tests (F4); restore an explicit config-not-found message — checking runtime.sh, the file actually sourced, not the env var's runtime.json target (F5); derive the env var name from $dataset_name and improve the no-succeeded-pod message (F6b/c).
[Filed] none.
Non-blocking observations (6) — not part of this round's ask; fix now, follow up, or file an issue as you see fit
- test/gha-e2e/mooncake/rw_job.yaml:17 [minor] — The e2e hard-codes #6197's still-unstable contract surface (label, webhook name, env suffix, ConfigMap name, denial text)
F2 (consensus — merged from both reviewers' F2s; Codex's broader framing accepted, with its narrowing nuance): the test pins #6197's contract surface — label clientless.fluid.io/inject (rw_job.yaml:17, test.sh:246), webhook name clientless.fluid.io (test.sh:246/250), env-suffix derivation (mooncake-demo -> FLUID_RUNTIME_CONFIG_PATH_MOONCAKE_DEMO, test.sh:235), ConfigMap name fluid-runtime-config-mooncake-demo (baked into the jq filter at test.sh:230/232), and the denial substrings '"mooncake-missing" not found' (test.sh:250-251). #6197 is under active review and has already renamed the label once (9c8d0e9, second-to-last commit; current head b9315ac is one commit past it) and reworked the error wording once (c01cbcc); the author's green manual run used 9c8d0e9. Any further contract change in #6197 breaks this test the day both land. Per the cross-critique, the true brittleness surface is #6197's error composition and webhook naming, not kubectl's phrasing (kubectl is pinned in CI and echoes the server message; the NotFound substring is apimachinery's stable format passed through verbatim). Acceptable if F1's merge order is enforced — just land the two PRs with these strings in sync. Both harnesses pin both sides of the contract so a rename fails loudly rather than silently. - samples/mooncake/docker/custom-entrypoint.sh:37 [minor] — pre-existing, not introduced by this PR — Should the user-facing sample also move off the jq/runtime.json contract?
Q1 (Codex, confirmed as a fair question by Claude — not a defect): samples/mooncake/docker/custom-entrypoint.sh still carries the old jq/runtime.json worker logic that this PR just replaced in the e2e image (lines 37-39: .master.service.name, .worker.service.name, .worker.tieredStoreLevels[0].quotas[0]). The JSON contract still exists on master, so the sample is not broken, but after this PR the repo demonstrates two different worker-config idioms. Should the sample move to sourcing runtime.sh too (now that the generator ships it), or is it intentionally left on the JSON contract? Either answer is defensible. - test/gha-e2e/mooncake/test.sh:230 [nit] — New host-side jq dependency for the e2e runner
F3 (consensus — identical finding from both reviewers): check_runtime_config_injection runs jq on the runner host while the same PR removes jq from the test image (the point of the Dockerfile change — nothing else in the image uses it; reportSummary.sh is grep/sed/awk only). GHA ubuntu runners ship jq, so CI is fine; the PR's manual-run instructions (bash test/gha-e2e/mooncake/test.sh) now silently require a local jq that was never needed before. Either a header comment (Codex) or acommand -v jq || panicguard (Claude) resolves it — complementary suggestions. - test/gha-e2e/mooncake/image/custom-entrypoint.sh:29 [nit] — Worker entrypoint logic is only covered end-to-end
F4 (Claude, confirmed by Codex with a citation correction — the ad-hoc entrypoint cases are described in the PR body §Ⅳ, not commit 74d77d9's message): the worker branch's ad-hoc checks (unset/empty var, path with spaces) were validated but nothing is committed — the branch is covered only through the kind e2e (worker readiness and the whole data path depend on it), which is adequate. For cheaper regression signal, the review harnesses show the pattern: stub mooncake_client on PATH and assert the computed flags. Optional uplift after merge. - test/gha-e2e/mooncake/image/custom-entrypoint.sh:31 [nit] — Worker entrypoint lost its explicit config-file guard message
F5 (Codex, behaviorally confirmed by Claude's direct reproduction): the worker branch replaced the explicit [[ -z … ]] || [[ ! -f … ]] guard with ${FLUID_RUNTIME_CONFIG_PATH:?} + a bare source. A set-but-nonexistent path now aborts via set -e with bash's raw 'No such file or directory' for the derived runtime.sh instead of the old explicit message — still fail-fast, only the error text regressed. Two notes from the cross-critique if the author acts on it: (1) head commit 74d77d9 is titled 'validate the Mooncake worker config path before sourcing' but only restructures the :? expansion — the file-existence guard was not restored; (2) the old guard checked the env var's target (runtime.json) while the new code sources the sibling runtime.sh, so a naive guard restoration would check the wrong file. - test/gha-e2e/mooncake/test.sh:228 [nit] — Small robustness points in check_runtime_config_injection (sub-claim (a) refuted and dropped)
F6 (disputed composite from Codex, adjudicated by Claude): two confirmed nits remain — (b) the env var name FLUID_RUNTIME_CONFIG_PATH_MOONCAKE_DEMO is hard-coded at test.sh:235 while $volume and $dir on lines 230-232 derive from $dataset_name; (c) when no succeeded pod exists, the jq any() yields false and the panic at line 237 blames injection ('expected the rw container to receive the runtime ConfigMap…') instead of saying no succeeded pod was found — though the call flow (wait_job_completed runs first) makes this reachable only via a narrow race, so the practical impact is small. Sub-claim (a) — that batch.kubernetes.io/job-name exists on every CI version and the legacy job-name selector is 'future-proofing only' — is refuted: the batch.kubernetes.io/* labels were introduced in Kubernetes 1.27, and the matrix includes v1.22.17 and v1.24.17 where they do not exist; the legacy job-name label is the only selector valid across the whole matrix, so do NOT switch it (at most a comment).
Verified review delta
- F1: open (initial-pr)
- F2: open (initial-pr)
- Q1: open (preexisting)
- F3: open (initial-pr)
- F4: open (initial-pr)
- F5: open (initial-pr)
- F6: open (initial-pr)
Code: needs-work. CI: failure; attribution: pr-regression. Required CI checks still apply.
| syslog "Verified runtime config injection on the completed Mooncake app Pod" | ||
| } | ||
|
|
||
| function check_missing_dataset_rejected() { |
There was a problem hiding this comment.
F1 (consensus — both reviewers, severity conceded up from 'major' by Claude in cross-critique): check_missing_dataset_rejected (called at line 415, before the rw job) requires the cluster to register the clientless.fluid.io mutating webhook. That webhook — plus the RuntimeConfigInjector plugin, its RBAC, and its plugins-profile group — exists only in unmerged #6197, while the kind-e2e workflow builds the chart and images from this PR's branch. On a webhook-less cluster the server-side dry-run is admitted and the check panics, so every Kubernetes version in the matrix fails before create_job runs, which also masks any real regression in the rest of this PR's changes. The test logic itself is correct (it is supposed to fail there). Before merge: land #6197 first, rebase this PR onto it, and re-run the kind-e2e matrix green on the final head — the author's kind passes were taken against #61979c8d0e9, which predates #6197's current head b9315ac, so the evidence must be regenerated at merge time.



Ⅰ. 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.
rw容器是否将 ConfigMapfluid-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.iowebhook 拒绝请求,且错误信息中包含"mooncake-missing" not found。Ⅳ. Describe how to verify it
在已启用 CacheRuntime 并部署 #6197 webhook 的 kind 集群上,从仓库根目录构建镜像并运行 Mooncake 用例。以下命令使用 CI 的集群名
fluid-cluster,运行前请确认 kubectl 当前上下文指向该集群。ca72c8ae搭配 feat(webhook): inject the runtime config into app pods of client-less cache runtimes #6197 的9c8d0e9f在 kind / Kubernetes v1.33.2 上跑通了完整 Mooncake E2E。4 MiB 数据写入和读回的 MD5 一致,Dataset 报告cached=4.00MiB、fileNum=1。74d77d9b调整了 worker 的配置路径校验。入口脚本用例确认变量未设置或为空时立即退出,路径含空格时能正常加载。基于该提交重建镜像并部署 feat(webhook): inject the runtime config into app pods of client-less cache runtimes #6197 的9c8d0e9fwebhook 后,完整 Mooncake E2E 在 kind / Kubernetes v1.33.2 上再次通过。Ⅴ. Special notes for reviews
此用例依赖 #6197 提供的注入标签和 webhook,请在 #6197 合入后合入本 PR。
本次 CI 的五个 Kubernetes 版本 都停在缺失数据集的拒绝断言。当前 master 的 Helm chart 尚未注册
clientless.fluid.iowebhook,因此 API Server 放行了这次 server-side dry-run。