Skip to content

fix(manifest): pass --node_config_file so per-node config is actually loaded#99

Open
Wangmin362 wants to merge 1 commit into
Project-HAMi:mainfrom
Wangmin362:fix/pass-node-config-file-flag
Open

fix(manifest): pass --node_config_file so per-node config is actually loaded#99
Wangmin362 wants to merge 1 commit into
Project-HAMi:mainfrom
Wangmin362:fix/pass-node-config-file-flag

Conversation

@Wangmin362

@Wangmin362 Wangmin362 commented Jul 7, 2026

Copy link
Copy Markdown

What this PR does

The shipped ascend-device-plugin.yaml mounts a per-node config file (from configmap hami-device-node-config) at /node-config.yaml, but the container args only pass --config_file. The --node_config_file flag is never set.

Since cmd/main.go guards node-config loading with:

nodeConfigFile = flag.String("node_config_file", "", "node specific config file path")
...
if *nodeConfigFile != "" {
    err = mgr.LoadNodeConfig(*nodeConfigFile, *nodeName)
}

and the flag defaults to empty, LoadNodeConfig is never called. As a result any per-node setting (e.g. hami-vnpu-core: true, vDeviceCount) placed in the mounted node-config is silently ignored — the file is mounted but unused.

This PR simply passes the flag (the file is already mounted):

args:
  - --config_file
  - /device-config.yaml
  - --node_config_file
  - /node-config.yaml

Evidence

On a real 8×910B4 node:

  • Without the flag: the hami-vnpu-core node annotation stays false; the mounted node-config has no effect.

  • After adding --node_config_file /node-config.yaml to the DaemonSet args, the log immediately shows:

    manager.go:72 Successfully matched node config for node-001: {Name:node-001 HamiVnpuCore:true VDeviceCount:8}
    

    and the node annotation flips to hami-vnpu-core=true. The feature works — the manifest just didn't wire the flag.

Scope

Manifest-only change (one flag). No code change.

Summary by CodeRabbit

  • New Features
    • Added support for an additional node-specific configuration file alongside the existing device configuration, enabling more flexible deployment setup.

AI assistance disclosure (per the project's AI Assistance Notice): the missing flag was found while testing per-node config on a real Ascend 910B4 node, where the node config never loaded until --node_config_file was added and the log then showed Successfully matched node config. This manifest one-liner was prepared with AI assistance (Claude Code) and verified by me on that node. I understand the change and stand behind it.

@hami-robot

hami-robot Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Wangmin362
Once this PR has been reviewed and has the lgtm label, please assign archlitchi for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Welcome @Wangmin362! It looks like this is your first PR to Project-HAMi/ascend-device-plugin 🎉

@hami-robot hami-robot Bot added the size/XS label Jul 7, 2026
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The hami-ascend-device-plugin DaemonSet manifest is updated to add a new --node_config_file /node-config.yaml argument to the device-plugin container, alongside the existing --config_file argument.

Changes

Device Plugin Manifest Update

Layer / File(s) Summary
Add node config argument
ascend-device-plugin.yaml
Added --node_config_file /node-config.yaml to the device-plugin container args in the DaemonSet.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Poem

A new flag hops into the fray,
"--node_config_file" leads the way,
One small line, config so bright,
The plugin now sees its node just right. 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the manifest-only change and states the main fix: adding --node_config_file so per-node config loads.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

… loaded

The DaemonSet mounts the node-config file (from configmap
hami-device-node-config) at /node-config.yaml, but the container args
only pass --config_file. Since main.go guards node-config loading with
`if *nodeConfigFile != ""` and the flag defaults to empty,
LoadNodeConfig is never called, so per-node settings (e.g.
hami-vnpu-core, vDeviceCount) are silently ignored.

Pass --node_config_file /node-config.yaml (the file is already mounted)
so the per-node config is loaded.

Signed-off-by: Wangmin362 <wangmin362@gmail.com>
Comment thread ascend-device-plugin.yaml
- --config_file
- /device-config.yaml
- --node_config_file
- /node-config.yaml

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The hami-device-node-config deployment is optional, so we need handle the case where it is not present.

#### (Optional) **Node Custom Configuration Description**

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.

2 participants