Skip to content

feat(fluid): support ThinRuntime advanced options#1297

Merged
szbr9486 merged 1 commit into
CurvineIO:mainfrom
jlon:codex/fluid-thinruntime-options
Jul 25, 2026
Merged

feat(fluid): support ThinRuntime advanced options#1297
szbr9486 merged 1 commit into
CurvineIO:mainfrom
jlon:codex/fluid-thinruntime-options

Conversation

@jlon

@jlon jlon commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR improves the Curvine Fluid ThinRuntime integration so Dataset mount options can configure HA Curvine masters, advanced Curvine [client] / [fuse] TOML fields, and current curvine-fuse CLI flags.

Issue Describe / Design

Related to the Fluid ThinRuntime integration work.

Before this change, the ThinRuntime parser had four gaps:

  • master-endpoints was parsed as a single host:port, so HA master lists could not be rendered correctly into [[client.master_addrs]].
  • Dataset mount options could not pass Curvine-specific [client] or [fuse] advanced settings, such as client.enable_unified_fs=false or FUSE metadata cache TTLs.
  • Some FUSE timeout options still used legacy names, while current curvine-fuse expects entry-timeout-ms, attr-timeout-ms, and negative-timeout-ms.
  • Multiple Fluid Dataset mounts were silently reduced to the first mount, although this ThinRuntime starts one Curvine FUSE mount.

The design keeps ThinRuntime-owned fields protected: mount path, filesystem path, worker/io threads, and client.master_addrs are still managed by the runtime parser. User-provided advanced options are only accepted through explicit client.<key> and fuse.<key> prefixes.

Changes

Module / File Change Impact on existing behavior
curvine-docker/fluid/config-parse.py Parse HA master endpoint lists and render all entries into [[client.master_addrs]]. Single-master configs still work; HA configs now work correctly.
curvine-docker/fluid/config-parse.py Render client.<key> and fuse.<key> Dataset options into generated Curvine TOML, while rejecting ThinRuntime-managed fields. Enables advanced Curvine client/fuse tuning from Fluid without allowing Dataset options to override runtime mount ownership.
curvine-docker/fluid/config-parse.py Map legacy Dataset option names to current curvine-fuse CLI flags where compatible. Existing option names remain usable; generated commands now match current FUSE CLI.
curvine-docker/fluid/config-parse.py Reject invalid Fluid config shapes and multi-mount configs early. Misconfigured ThinRuntime pods fail fast with a clear error instead of silently mounting the wrong path.
curvine-docker/fluid/tests/test_config_parse.py Add parser regression tests for HA masters, advanced options, legacy flag mapping, managed-field rejection, multi-mount rejection, and invalid endpoints. Adds coverage for the Fluid integration parser.
curvine-docker/fluid/thin-runtime/curvine-thinruntime.yaml Update the sample to start the unified image with fluid-thin-runtime and document advanced Dataset options. Sample aligns with the current Curvine image layout and supported options.

Test verified

Test case Result Notes
CARGO_TARGET_DIR=/tmp/curvine-cargo-target-format make format PASS Used an isolated target dir because local target/release is root-owned.
python3 -B curvine-docker/fluid/tests/test_config_parse.py PASS 5 parser tests.
python3 -B -m py_compile curvine-docker/fluid/config-parse.py curvine-docker/fluid/tests/test_config_parse.py PASS Python syntax check.
python3 - <<'PY' ... yaml.safe_load_all(...) ... PY PASS Parsed curvine-docker/fluid/thin-runtime/curvine-thinruntime.yaml.
git diff --check / git diff --cached --check PASS No whitespace errors.

Dependencies

  • Related PRs: None
  • Related issues: None
  • Blocks / blocked by: None

@jlon
jlon marked this pull request as ready for review July 24, 2026 10:26


if __name__ == "__main__":
unittest.main()

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.

These tests pass locally, but no workflow under .github/workflows/ invokes them (the only python3 references are curvine-tests/regression/build-server.py), so they won't run on PRs or guard against regressions in config-parse.py. Consider adding a lightweight CI step, e.g. python3 -B curvine-docker/fluid/tests/test_config_parse.py, so this coverage is actually enforced.

cmd_parts.extend([f"--{cli_flag}", str(value)])
emitted_cli_flags.add(cli_flag)

return " ".join(f'"{arg}"' if " " in arg else arg for arg in cmd_parts)

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.

This quoting only wraps args containing spaces. Values with $(...), backticks, or $VAR are still expanded inside double quotes in the generated mount-curvine.sh (e.g. a Dataset option of $(reboot) would execute). This pattern predates this PR, but the change widens the set of user-controllable values flowing into the script. Consider shlex.quote(arg) for defense in depth. (Low severity — Dataset options are admin-controlled.)

master_hostname, master_rpc_port = self.parse_master_endpoints()
master_endpoints = self.parse_master_endpoints()

master_web_port = self.get_option('master-web-port', 'CURVINE_MASTER_WEB_PORT', '8080')

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.

The PR adds strict integer/range validation for master RPC endpoint ports, but master-web-port is still interpolated raw into web_port = {master_web_port}, so a non-numeric value yields invalid TOML at mount time rather than a fail-fast error. Minor consistency gap with the PR's stated "reject invalid config early" goal.

@szbr9486
szbr9486 merged commit f10a6d6 into CurvineIO:main Jul 25, 2026
3 checks passed
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.

2 participants