-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
koordlet: supply rdma devices (#2276)
Signed-off-by: wangjianyu.wjy <[email protected]> Co-authored-by: wangjianyu.wjy <[email protected]>
- Loading branch information
1 parent
b8b1d89
commit 7c94119
Showing
15 changed files
with
492 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
pkg/koordlet/metricsadvisor/devices/rdma/collector_rdma.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/* | ||
Copyright 2022 The Koordinator Authors. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package rdma | ||
|
||
import ( | ||
corev1 "k8s.io/api/core/v1" | ||
"k8s.io/klog/v2" | ||
|
||
"github.com/koordinator-sh/koordinator/pkg/features" | ||
"github.com/koordinator-sh/koordinator/pkg/koordlet/metriccache" | ||
"github.com/koordinator-sh/koordinator/pkg/koordlet/metricsadvisor/framework" | ||
) | ||
|
||
const ( | ||
DeviceCollectorName = "RDMA" | ||
) | ||
|
||
type rdmaCollector struct { | ||
enabled bool | ||
} | ||
|
||
func New(opt *framework.Options) framework.DeviceCollector { | ||
return &rdmaCollector{ | ||
enabled: features.DefaultKoordletFeatureGate.Enabled(features.RDMADevices), | ||
} | ||
} | ||
|
||
func (g *rdmaCollector) Shutdown() { | ||
} | ||
|
||
func (g *rdmaCollector) Enabled() bool { | ||
return g.enabled | ||
} | ||
|
||
func (g *rdmaCollector) Setup(fra *framework.Context) { | ||
} | ||
|
||
func (g *rdmaCollector) Run(stopCh <-chan struct{}) { | ||
} | ||
|
||
func (g *rdmaCollector) Started() bool { | ||
return true | ||
} | ||
|
||
func (g *rdmaCollector) Infos() metriccache.Devices { | ||
netDevices, err := GetNetDevice() | ||
if err != nil { | ||
klog.Errorf("failed to get net device: %v", err) | ||
} | ||
return netDevices | ||
} | ||
|
||
func (g *rdmaCollector) GetNodeMetric() ([]metriccache.MetricSample, error) { | ||
return nil, nil | ||
} | ||
|
||
func (g *rdmaCollector) GetPodMetric(uid, podParentDir string, cs []corev1.ContainerStatus) ([]metriccache.MetricSample, error) { | ||
return nil, nil | ||
} | ||
|
||
func (g *rdmaCollector) GetContainerMetric(containerID, podParentDir string, c *corev1.ContainerStatus) ([]metriccache.MetricSample, error) { | ||
return nil, nil | ||
} |
Oops, something went wrong.