Skip to content

docs(cacheruntime): fix heredocs and image tag in the Curvine sample - #6252

Open
btxu-db wants to merge 1 commit into
fluid-cloudnative:masterfrom
btxu-db:docs/fix-curvine-sample
Open

btxu-db wants to merge 1 commit into
fluid-cloudnative:masterfrom
btxu-db:docs/fix-curvine-sample

Conversation

@btxu-db

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

Copy link
Copy Markdown
Contributor

Ⅰ. Describe what this PR does

The Curvine sample does not work when followed as written, in either language:

  • The CacheRuntimeClass (step 4) and the two read jobs (steps 9 and 10) are written with an unquoted cat<<EOF, so the local shell expands ${CURVINE_HOME}, $FLUID_DATALOAD_DATA_PATH and $(cat /data/minio/bar) before the file is written. ${CURVINE_HOME}/conf ends up as /conf, for example. These three heredocs now use cat<<'EOF'.
  • curvine/curvine:0.3.6-alpha does not exist on Docker Hub. The tag is v0.3.6-alpha, which is what test/gha-e2e/curvine/ uses.

Ⅱ. 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; docs only.

Ⅳ. Describe how to verify it

docker manifest inspect curvine/curvine:0.3.6-alpha returns no such manifest, while v0.3.6-alpha resolves. The heredoc expansion can be seen by running the step 4 command in any shell and looking at the generated cacheruntimeclass.yaml.

Ⅴ. Special notes for reviews

The bucket job in step 2 is left alone. It already escapes its variables with \$, so it needs the unquoted heredoc.

The CacheRuntimeClass and the read jobs are written with an unquoted
`cat<<EOF`, so the local shell expands `${CURVINE_HOME}`,
`$FLUID_DATALOAD_DATA_PATH` and `$(cat /data/minio/bar)` before the
manifest is written, and the resulting scripts are broken. Quote the
delimiter for those three heredocs.

The image tag `curvine/curvine:0.3.6-alpha` does not exist on Docker Hub.
Use `v0.3.6-alpha`, the tag the e2e test already uses.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: btxu-db <btxu-db@outlook.com>
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.81%. Comparing base (ff99142) to head (41f1061).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6252   +/-   ##
=======================================
  Coverage   65.81%   65.81%           
=======================================
  Files         486      486           
  Lines       34454    34454           
=======================================
  Hits        22677    22677           
  Misses      10024    10024           
  Partials     1753     1753           

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

🟢 Approval recommended

No active review issues are recorded for the documentation updates to heredoc quoting and Curvine image tags.

No open issues 🎉

What changed in this PR

Fixes executable examples in the English and Chinese Curvine CacheRuntime guides so generated manifests preserve container-side shell expressions and use the correct image tag.

Changes:

  • Quotes the CacheRuntimeClass and both read-job heredoc delimiters to prevent local shell expansion.
  • Updates master, worker, and client images to curvine/curvine:v0.3.6-alpha, matching the integration fixtures.
  • Leaves the bucket-creation heredoc unchanged because it already escapes its variables.
File Description
docs/​zh/​samples/​cacheruntime/​curvine_cache_runtime.md Corrects heredoc quoting and image tags in the Chinese guide.
docs/​en/​samples/​cacheruntime/​curvine_cache_runtime.md Applies the same corrections to the English guide.

Review effort: Balanced

cheyang pushed a commit to cheyang/fluid that referenced this pull request Nov 16, 2026
…nce (root .gitignore excludes *.out)

Evidence files referenced by the README/manifest were silently skipped by
the repo-wide *.out ignore rule.

Co-Authored-By: Claude Code <noreply@anthropic.com>

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

Both claims of this docs fix verified end-to-end, independently. Reproduced on the merge-base first: the unquoted heredocs really let the local shell eat the pod-side variables — CURVINE_CONF_DIR comes out as "/conf", the read jobs degenerate to test -n "" after a local cat /data/minio/bar — and curvine/curvine:0.3.6-alpha is a 404 on Docker Hub. At the PR head, every heredoc block in both languages regenerates its intended file verbatim, every generated YAML parses, v0.3.6-alpha resolves as a multi-arch (amd64/arm64) index, and the doc-generated cacheruntimeclass.yaml is byte-identical to the manifest kind-e2e actually deploys. The one heredoc left unquoted (step 2's minio bucket job) is correct as-is: its \$ escaping is load-bearing, and quoting it would leave a literal $MINIO_ROOT_USER that fails YAML parsing — mutation-tested in both directions. Only the three intended generated files change; the other seven are byte-identical, and en/zh stay in lockstep. Required CI is green (13/13 checks). No blockers or majors from either reviewer, no disagreement survived cross-critique, and Copilot's advisory pass raised no findings.

Next round

[MUST] (none — no PR-introduced blockers; merge checklist green)
[SHOULD] Follow-up PR: fix step 6's kubectl get pod -l cacheruntime.fluid.io/runtime-name=... in both language docs — the code only ever sets cacheruntime.fluid.io/name/component-name, so that command shows no pods (pre-existing).
[SHOULD] Consider wiring a doc-samples contract check (execute the heredocs, parse the YAML) into CI — the tag drift survived precisely because nothing runs the samples (pre-existing gap; both verify branches are working prototypes).
[Filed] (none)

Non-blocking observations (3) — not part of this round's ask; fix now, follow up, or file an issue as you see fit
  • docs/en/samples/cacheruntime/curvine_cache_runtime.md:393 [minor] — pre-existing, not introduced by this PR — Step-6 pod selector uses a label the code never sets
    F1 (Claude, confirmed by Codex in cross-critique): kubectl get pod -l cacheruntime.fluid.io/runtime-name=curvine-demo matches no pods. pkg/common/label.go:154,156 defines only cacheruntime.fluid.io/name and cacheruntime.fluid.io/component-name (set on component pods via GetComponentMatchLabels in pkg/ddc/cache/component/component_manager.go:78), and test/gha-e2e/curvine/test.sh selects pods only with those keys; repo-wide grep finds the runtime-name form only in these two doc files, so no counter-path exists. The zh doc carries the identical command at the identical line. Pre-existing on base (identical command at line 393 of ff99142) and outside this PR's declared scope — recommend a one-line follow-up (-l cacheruntime.fluid.io/name=curvine-demo), not a change to this PR.
  • [minor] — pre-existing, not introduced by this PR — Sample docs are never executed in CI, so doc/manifest drift goes unnoticed
    F2 (Codex, confirmed by Claude in cross-critique): no workflow parses, executes, or lints docs/{en,zh}/samples/** — the only curvine coverage in CI is test/gha-e2e/curvine/ via kind-e2e, which is a separate copy of the manifests, not the doc. This drift survived because of it: the doc pinned curvine/curvine:0.3.6-alpha (404 on Docker Hub) while test/gha-e2e/curvine/cacheruntimeclass.yaml:58,84,108 has carried v0.3.6-alpha all along, and three heredocs were broken from the day they were written. Not a merge condition for this docs fix — docs PRs do not owe test infrastructure — but a cheap guard exists: both reviewer harnesses (e.g. docs/verification/curvine-cache-sample-doc-codex/scripts/run_doc_contracts.sh) execute every heredoc in the sample and YAML-parse the output; wiring that style of check into CI would catch the next drift and the step-6 label-selector class of bug.
  • docs/en/samples/cacheruntime/curvine_cache_runtime.md:173 [nit] — nit: mixed cat<<EOF / cat<<'EOF' style across the sample's ten heredocs
    F1 (Codex, confirmed by Claude in cross-critique): the doc now mixes unquoted (7 blocks) and quoted (3 blocks) heredoc openers, introduced by this PR quoting exactly the three blocks that needed it. Both forms are correct where used — six unquoted blocks contain no $ at all, and step 2's bucket job MUST stay unquoted (its $ escapes are collapsed by the local shell for the pod; quoting it leaves literal $MINIO_ROOT_USER, an invalid YAML double-quote escape — proven by mutation in both reviewers' rounds, results/harness-bites-mutation.txt). Optionally quoting the six $-free blocks too would harden the doc against future edits that add $; keeping quotes only where needed instead documents intent. Taste either way — both reviewers agree: do not hold the PR on this.
Verified review delta
  • curvine-doc-step6-label: open (preexisting)
  • mt-sample-docs-not-executed-in-ci: open (preexisting)
  • nit-heredoc-quoting-uniformity: open (initial-pr)

Code: clear. CI: success; attribution: unknown. Required CI checks still apply.

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.

3 participants