Skip to content

Conversation

@Syspretor
Copy link
Collaborator

Signed-off-by: 玖宇 guotongyu.gty@alibaba-inc.com

Ⅰ. Describe what this PR does

Ⅱ. Does this pull request fix one issue?

fixes #XXXX

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

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@Syspretor Syspretor requested a review from cheyang December 25, 2025 07:20
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Syspretor, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances Fluid's documentation by adding a detailed guide for the Fuse Sidecar mounting mode. It explains how this mode functions, contrasts it with the existing CSI mode, and provides practical examples and advanced configuration options. Furthermore, it introduces a robust cleanup script to manage HostPath directories, addressing potential resource accumulation and ensuring efficient operation of the Sidecar mode, especially in dynamic environments.

Highlights

  • New Documentation for Fuse Sidecar Mode: Introduced comprehensive documentation in Chinese for Fluid's Fuse Sidecar mounting mode, detailing its mechanisms, features, and usage.
  • Comparison with CSI Mode: The new documentation provides a clear comparison between the traditional CSI mode and the new Sidecar mode, highlighting their differences in mounting mechanisms, applicable scenarios, resource isolation, and fault impact.
  • Advanced Configurations: Detailed advanced configurations for Sidecar mode, including enabling random-suffix for HostPath in node environments to prevent conflicts and disabling PostStart blocking for flexible container startup.
  • Applicable Scenarios and Considerations: Outlined various scenarios where Sidecar mode is particularly beneficial, such as Serverless container services, Knative, temporary tasks, and situations requiring strong resource isolation. It also discusses important considerations like Webhook dependency, resource consumption, and connection overhead.
  • HostPath Cleanup Script: Added a new shell script (tools/clean-sidecar-hostpath.sh) designed to safely clean up residual HostPath directories generated by the Sidecar mode, incorporating multiple safety checks to prevent accidental data loss.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Syspretor Syspretor changed the title Add docs for fuse sidecar-mode doc(fluid): Add docs for fuse sidecar-mode Dec 25, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这个 PR 增加了关于 Fuse Sidecar 模式的详细文档和一个用于清理残留 HostPath 的脚本,非常有用。文档内容详实,结构清晰,对用户理解和使用 Sidecar 模式有很大帮助。清理脚本考虑了多种安全机制,设计得非常周到。

我在代码和文档中发现了一些可以改进的地方,主要集中在清理脚本的逻辑正确性和文档示例的一致性上。请查看具体的 review comments。

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 57.52%. Comparing base (0f5e6a7) to head (858bb01).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5397   +/-   ##
=======================================
  Coverage   57.52%   57.52%           
=======================================
  Files         444      444           
  Lines       30744    30744           
=======================================
  Hits        17687    17687           
  Misses      11443    11443           
  Partials     1614     1614           

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive documentation for Fluid's Fuse Sidecar mounting mode, a feature designed for Serverless and resource-isolated environments. The PR introduces a new documentation file explaining the differences between CSI and Sidecar modes, along with a cleanup script to manage residual HostPath directories.

Key Changes:

  • Added detailed Chinese documentation explaining Fuse Sidecar mode, its use cases, and configuration options
  • Introduced a cleanup script with multiple safety mechanisms to remove stale HostPath directories in random-suffix mode
  • Documented advanced configurations including random-suffix mode for node environments and PostStart hook control

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.

File Description
docs/zh/samples/fuse_sidecar_mode.md Comprehensive documentation covering Sidecar vs CSI mode comparison, setup examples, advanced configurations, and use cases for Serverless environments
tools/clean-sidecar-hostpath.sh Bash script with safety checks to clean up residual HostPath directories created in random-suffix mode, including threshold-based triggers and mount point validation
Comments suppressed due to low confidence (1)

tools/clean-sidecar-hostpath.sh:423

  • The script has extra blank lines at the end (lines 422-423). While this doesn't affect functionality, it's cleaner to have only one trailing newline at the end of the file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: 玖宇 <guotongyu.gty@alibaba-inc.com>
@Syspretor Syspretor force-pushed the doc/add-doc-use-sidecar-mode branch from 437f6f3 to 858bb01 Compare December 29, 2025 11:22
@sonarqubecloud
Copy link

@Syspretor Syspretor marked this pull request as ready for review December 29, 2025 11:24
@cheyang
Copy link
Collaborator

cheyang commented Dec 30, 2025

/gemini review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

这份文档详尽地介绍了 Fluid 的 Fuse Sidecar 挂载模式,内容覆盖了背景、与 CSI 模式的对比、使用示例、进阶配置、适用场景及注意事项。整体结构清晰,内容丰富,对用户理解和使用 Sidecar 模式非常有帮助。

我在文档中发现两处可以改进的地方,以提高文档的准确性和清晰度:

  1. 在 Sidecar 模式的工作流程描述中,关于 Webhook 查找配置的说明可以更精确,避免与 CSI 模式的 DaemonSet 概念混淆。
  2. 在运行示例部分,Pod 启动命令与其对应的日志输出存在不一致,修正后能让用户更顺畅地跟随示例操作。

具体的修改建议已在代码评论中给出。


1. 用户在业务 Pod 上添加特定的 label:`serverless.fluid.io/inject: "true"`
2. Fluid Webhook 拦截 Pod 创建请求,识别需要注入 Sidecar 的 Pod
3. Webhook 根据 Pod 挂载的 PVC 找到对应的 Fuse DaemonSet 配置
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

在Sidecar模式的描述中,第三步提到“找到对应的 Fuse DaemonSet 配置”存在歧义。Sidecar模式的核心是不依赖于DaemonSet的,而是通过Webhook直接注入容器。此处的配置实际上来源于对应的Runtime(例如AlluxioRuntime)而非Fuse DaemonSet。为了避免混淆,建议修改为“找到对应的Runtime配置”。

Suggested change
3. Webhook 根据 Pod 挂载的 PVC 找到对应的 Fuse DaemonSet 配置
3. Webhook 根据 Pod 挂载的 PVC 找到对应的 Runtime 配置

args:
- |
echo "Listing files in /data:"
ls -lh /data/spark
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

文档中的 Pod command 与其展示的 log 输出不一致。ls -lh /data/spark 命令会列出 /data/spark 目录下的内容,而日志输出展示的是 /data 目录的内容(即 spark 目录本身)。为了保持一致性,建议将命令修改为 ls -lh /data,这与 echo 语句 "Listing files in /data:" 的意图也更相符。

Suggested change
ls -lh /data/spark
ls -lh /data

@cheyang cheyang self-requested a review December 30, 2025 00:08
Copy link
Collaborator

@cheyang cheyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@RongGu RongGu merged commit 63457dc into fluid-cloudnative:master Dec 30, 2025
12 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.

3 participants