Skip to content

Remove postStart hook for hami-core-vNPU tasks - #2062

Merged
hami-robot[bot] merged 10 commits into
Project-HAMi:masterfrom
archlitchi:master
Jul 15, 2026
Merged

Remove postStart hook for hami-core-vNPU tasks#2062
hami-robot[bot] merged 10 commits into
Project-HAMi:masterfrom
archlitchi:master

Conversation

@archlitchi

@archlitchi archlitchi commented Jul 13, 2026

Copy link
Copy Markdown
Member

/kind cleanup

Limiter process will be automatically launched when accessing cann API, we don't need to manually launch it anymore

Summary by CodeRabbit

  • Bug Fixes
    • Updated hami-core admission behavior to stop adding an automatic container startup hook.
    • Preserved raw memory allocation handling during vNPU-mode admission.
  • Tests
    • Updated admission tests to verify that no startup hook is added in hami-core mode.

archlitchi added 10 commits July 9, 2026 08:02
Signed-off-by: archlitchi <mengxuan.li@dynamia.ai>
Signed-off-by: archlitchi <mengxuan.li@dynamia.ai>
Signed-off-by: archlitchi <mengxuan.li@dynamia.ai>
Signed-off-by: archlitchi <mengxuan.li@dynamia.ai>
Signed-off-by: archlitchi <mengxuan.li@dynamia.ai>
Signed-off-by: archlitchi <mengxuan.li@dynamia.ai>
Signed-off-by: limengxuan <mengxuan.li@dynamia.ai>
@archlitchi

Copy link
Copy Markdown
Member Author

CC @Shouren

@wawa0210

Copy link
Copy Markdown
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


cc @s descendants

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 55011736-d637-4224-8f10-6971861452d3

📥 Commits

Reviewing files that changed from the base of the PR and between a1b418c and fc2572a.

📒 Files selected for processing (2)
  • pkg/device/ascend/device.go
  • pkg/device/ascend/device_test.go
💤 Files with no reviewable changes (1)
  • pkg/device/ascend/device.go

📝 Walkthrough

Walkthrough

hami-core admission no longer injects a limiter postStart hook. VNPU core-mode tests now verify that the lifecycle hook is absent while raw memory handling remains unchanged.

Changes

hami-core admission behavior

Layer / File(s) Summary
Remove limiter lifecycle hook and update tests
pkg/device/ascend/device.go, pkg/device/ascend/device_test.go
Admission skips postStart injection, and VNPU core-mode tests expect no lifecycle hook while preserving raw memory.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

A bunny saw the hook hop away,
While raw memory stayed in play.
No limiter starts at pod birth,
Tests guard the change with cheerful mirth.
Hop, hop—clean admission today!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: removing the postStart hook for hami-core vNPU tasks.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@hami-robot hami-robot Bot added the size/M label Jul 13, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request removes the injection of the PostStart lifecycle hook for Ascend core resources in MutateAdmission and updates the corresponding unit tests. The reviewer suggests simplifying the test assertions to directly verify that the container's Lifecycle remains nil, rather than using redundant nested conditional checks.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread pkg/device/ascend/device_test.go
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Flag Coverage Δ
unittests 59.71% <ø> (-0.06%) ⬇️

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 83.41% <ø> (-0.50%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Shouren Shouren left a comment

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.

/lgtm

@hami-robot hami-robot Bot added the lgtm label Jul 13, 2026
@hami-robot

hami-robot Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: archlitchi, 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

@Shouren

Shouren commented Jul 13, 2026

Copy link
Copy Markdown
Member

@archlitchi It seems that the doc about limiter-process-startup is out of date.

@hami-robot
hami-robot Bot merged commit 4ce891a into Project-HAMi:master Jul 15, 2026
16 checks passed
ouyangluwei163 pushed a commit to ouyangluwei163/HAMi that referenced this pull request Jul 16, 2026
…te and HAMi-core nodes

Make an annotation-less Ascend pod mode-agnostic so its effective mode
follows the node it lands on, while pods pinned via huawei.com/vnpu-mode
keep today's behavior:

- Fit: only reject a hami-core-requested pod on a node that does not
  support it; unannotated (legacy vNPU) pods are allowed on both node
  types. Composes with the existing whole-card / memory-less mode gate.
- PatchAnnotations: emit a superset RuntimeInfo (template name plus raw
  memory/core) so the device plugin picks the right shape per node.

Limiter startup is no longer injected here: the scheduler-side PostStart
hook was removed upstream in Project-HAMi#2062, so this change is scheduling-only.

Fixes Project-HAMi#2034

Signed-off-by: ouyangluwei(riseunion) <ouyangluwei@riseunion.io>
archlitchi pushed a commit that referenced this pull request Aug 3, 2026
…te and HAMi-core nodes (#2035)

Make an annotation-less Ascend pod mode-agnostic so its effective mode
follows the node it lands on, while pods pinned via huawei.com/vnpu-mode
keep today's behavior:

- Fit: only reject a hami-core-requested pod on a node that does not
  support it; unannotated (legacy vNPU) pods are allowed on both node
  types. Composes with the existing whole-card / memory-less mode gate.
- PatchAnnotations: emit a superset RuntimeInfo (template name plus raw
  memory/core) so the device plugin picks the right shape per node.

Limiter startup is no longer injected here: the scheduler-side PostStart
hook was removed upstream in #2062, so this change is scheduling-only.

Fixes #2034

Signed-off-by: ouyangluwei(riseunion) <ouyangluwei@riseunion.io>
Co-authored-by: ouyangluwei(riseunion) <ouyangluwei@riseunion.io>
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