Skip to content

Conversation

@DSFans2014
Copy link
Contributor

@DSFans2014 DSFans2014 commented Dec 11, 2025

What type of PR is this?
feature

What this PR does / why we need it:
install the mock-device-plugin alongside hami

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:
This PR depends on Project-HAMi/mock-device-plugin#6 and should be merged afterwards.

Does this PR introduce a user-facing change?:

@github-actions github-actions bot added the kind/feature new function label Dec 11, 2025
@hami-robot hami-robot bot added the size/L label Dec 11, 2025
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @DSFans2014, 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 integrates a mock-device-plugin into the hami Helm chart, providing a flexible solution for testing and development environments. It sets up all necessary Kubernetes resources, including a DaemonSet for deployment, a ServiceAccount, and appropriate RBAC permissions, along with Helm templating for easy configuration and management.

Highlights

  • Helm Template Additions: New helper templates have been introduced in _helpers.tpl for consistent naming and image definition of the mock-device-plugin.
  • Mock Device Plugin Deployment: A new DaemonSet (daemonsetmock.yaml) has been added to deploy the mock-device-plugin across the Kubernetes cluster, enabling its conditional activation via Helm values.
  • RBAC Configuration: Dedicated ServiceAccount, ClusterRole, and ClusterRoleBinding resources have been created for the mock-device-plugin to ensure it has the necessary permissions to interact with Kubernetes nodes and pods.
  • Configuration Options: The values.yaml file now includes a mockDevicePlugin section, allowing users to enable/disable and configure the image details for the mock device plugin.
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.

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

This pull request introduces a mock-device-plugin to the Helm chart. The implementation is mostly sound, adding the necessary Kubernetes manifests and values. However, I've identified a bug where an incorrect imagePullPolicy is used for the new plugin's container. Additionally, there are a couple of inconsistencies in code style and label usage that should be addressed to improve maintainability and align with the rest of the chart. My review includes specific suggestions to resolve these issues.

@codecov
Copy link

codecov bot commented Dec 11, 2025

Codecov Report

❌ Patch coverage is 63.63636% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/device/hygon/device.go 20.00% 3 Missing and 1 partial ⚠️
pkg/device/nvidia/device.go 33.33% 4 Missing ⚠️
Flag Coverage Δ
unittests 51.05% <63.63%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/device/ascend/device.go 80.68% <100.00%> (+0.24%) ⬆️
pkg/device/quota.go 62.91% <100.00%> (+0.75%) ⬆️
pkg/device/hygon/device.go 91.22% <20.00%> (-1.60%) ⬇️
pkg/device/nvidia/device.go 46.52% <33.33%> (-0.25%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: james <open4pd@4paradigm.com>
Signed-off-by: james <open4pd@4paradigm.com>
Signed-off-by: james <open4pd@4paradigm.com>
Signed-off-by: james <open4pd@4paradigm.com>
@DSFans2014 DSFans2014 force-pushed the feat/install_mock branch 2 times, most recently from b7c8620 to fc65ff6 Compare December 19, 2025 04:50
@DSFans2014 DSFans2014 force-pushed the feat/install_mock branch 3 times, most recently from a1dc418 to 8455510 Compare December 22, 2025 02:55
Signed-off-by: james <open4pd@4paradigm.com>
Copy link
Collaborator

@Shouren Shouren left a comment

Choose a reason for hiding this comment

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

/lgtm

@hami-robot hami-robot bot added the lgtm label Dec 23, 2025
@hami-robot
Copy link
Contributor

hami-robot bot commented Dec 23, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DSFans2014, Shouren

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hami-robot hami-robot bot added the approved label Dec 23, 2025
@hami-robot hami-robot bot merged commit 519f3ed into Project-HAMi:master Dec 23, 2025
15 checks passed
@DSFans2014 DSFans2014 deleted the feat/install_mock branch December 24, 2025 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants