Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

name: CI

on:
pull_request:
branches: [ "main" ]
on: [push, pull_request]

env:
GO_VERSION: "1.22.5"
Expand All @@ -19,10 +17,11 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- run: go mod tidy
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.60
version: latest

build:
env:
Expand Down
6 changes: 6 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
issues:
exclude-rules:
- path: internal/server/server\.go
linters:
- staticcheck
text: "SA1019:.*deprecated"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ require (
)

replace (
github.com/Project-HAMi/HAMi v0.0.0 => github.com/Project-HAMi/HAMi v0.0.0-20250107033239-d04fc8baaad6
github.com/Project-HAMi/HAMi v0.0.0 => github.com/Project-HAMi/HAMi v0.0.0-20250901013025-61c6cbe7d480
huawei.com/npu-exporter/v6 => gitee.com/ascend/ascend-npu-exporter/v6 v6.0.0-RC3
)
7 changes: 4 additions & 3 deletions internal/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"path"
"time"

"github.com/Project-HAMi/HAMi/pkg/device"
"github.com/Project-HAMi/HAMi/pkg/device/ascend"
"github.com/Project-HAMi/HAMi/pkg/util"
"github.com/Project-HAMi/HAMi/pkg/util/nodelock"
Expand Down Expand Up @@ -190,10 +191,10 @@ func (ps *PluginServer) registerKubelet() error {

func (ps *PluginServer) registerHAMi() error {
devs := ps.mgr.GetDevices()
apiDevices := make([]*util.DeviceInfo, 0, len(devs))
apiDevices := make([]*device.DeviceInfo, 0, len(devs))
// hami currently believes that the index starts from 0 and is continuous.
for i, dev := range devs {
apiDevices = append(apiDevices, &util.DeviceInfo{
apiDevices = append(apiDevices, &device.DeviceInfo{
Index: uint(i),
ID: dev.UUID,
Count: int32(ps.mgr.VDeviceCount()),
Expand All @@ -205,7 +206,7 @@ func (ps *PluginServer) registerHAMi() error {
})
}
annos := make(map[string]string)
annos[ps.registerAnno] = util.MarshalNodeDevices(apiDevices)
annos[ps.registerAnno] = device.MarshalNodeDevices(apiDevices)
annos[ps.handshakeAnno] = "Reported_" + time.Now().Add(time.Duration(*reportTimeOffset)*time.Second).Format("2006.01.02 15:04:05")
node, err := util.GetNode(ps.nodeName)
if err != nil {
Expand Down
Loading