Repository navigation
feat(Kunlun): add Kunlun vXPU mock resources - #26
spencercjh wants to merge 2 commits into
Conversation
Signed-off-by: spencercjh <spencercjh@gmail.com>
|
Warning Review limit reachedNext included review available in 59 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
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. Comment |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: spencercjh The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Signed-off-by: spencercjh <spencercjh@gmail.com>
|
Tested with HAMi Procedure:
Result: PASS. The Pod is Mock logs contain |
|
Old PRs and issues are being closed because they are no longer relevant. Or it was closed because of th |
Most of this Pull Request was generated or revised with the assistance of AI tools(Raft with GPT-5.6 Sol High). I have reviewed the resulting content and take full responsibility for its accuracy, security, licensing compliance, and inclusion in this project.
What
kunlunxin.com/vxpufrom healthy entries'countandkunlunxin.com/vxpu-memoryfrom theirdevmemhami.io/node-handshake-xpurequest with the real device-plugin'sReported_*protocolWhy
HAMi already schedules Kunlun vXPU resources from
hami.io/node-register-xpu, but the mock plugin did not register the corresponding kubelet resources or participate in the Scheduler health handshake. If the Scheduler started before the annotation appeared, its freshRequesting_*marker caused the now-visible XPU inventory to remain absent from the Scheduler cache.The original implementation also treated
devcoreas the virtual-device count. The real vXPU device plugin reports one P800-OAM ascount: 4,devmem: 98304, anddevcore: 100; the virtual count must therefore usecount, notdevcore.Impact
testbeforereplace, so a stale poll cannot overwrite a newer Scheduler request.Validation
Using the repository Go 1.21 toolchain and host verification:
go test ./...go test -race ./...go test -shuffle=on ./...go vet ./...CGO_ENABLED=0 go build ./cmd/k8s-device-plugingit diff --checkgolangci-lint run --new-from-rev a3a8764b12069b46c594eb0ea97f7e94031f8c01 ./...(0 new issues)Real-cluster regression on K3s v1.32.5 + HAMi v2.10.0 followed the failing startup order: install Scheduler/Mock first, wait for
Requesting_*, then add one P800-OAM annotation. The fixed mock reported the handshake; the Scheduler added vendorXPU; Node capacity becamevxpu=4,vxpu-memory=98304; and a Pod requesting one vXPU becameRunning. Itsto-allocateandallocatedannotations both identifiedXPU-MOCK-0,XPU,24576,25, and the mock received both Allocate calls.Full-repository lint still reports the same three pre-existing findings in untouched
cmd/k8s-device-plugin/main.goandinternal/pkg/mock/server.go; this update adds none.