Documentation
¶
Overview ¶
Copyright 2024 Shanghai Biren Technology Co., Ltd.
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.
Copyright 2024 Shanghai Biren Technology Co., Ltd.
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.
Copyright 2024 Shanghai Biren Technology Co., Ltd.
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.
Copyright 2024 Shanghai Biren Technology Co., Ltd.
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.
Copyright 2024 Shanghai Biren Technology Co., Ltd.
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.
Copyright 2024 Shanghai Biren Technology Co., Ltd.
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.
Index ¶
- Constants
- Variables
- func Allocate(g utils.Graph, mustIncludeNodes []string, size int) []string
- func Device2Graph(devices []string) (*utils.Graph, error)
- func NewBrGPUManager(devDirectory string, gpuConfig GPUConfig) *brGPUManager
- func PathExists(path string) (bool, error)
- type ContainerRuntime
- type DevicesInfo
- type DevicesInfoList
- type GPUConfig
- type Instance
- type Lister
- type MountPath
- type PFDeviceInfo
- type PFDeviceInfoList
- type Plugin
- func (p *Plugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
- func (p *Plugin) GetDevicePluginOptions(ctx context.Context, e *pluginapi.Empty) (*pluginapi.DevicePluginOptions, error)
- func (d *Plugin) GetNumaNode(idx int) (bool, int, error)
- func (p *Plugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
- func (p *Plugin) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error
- func (p *Plugin) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)
- func (p *Plugin) Start() error
- func (p *Plugin) Stop() error
- type VFDeviceInfo
Constants ¶
const (
BirenVendorID = "1ee0"
)
Variables ¶
var ( CdiFeature bool OverwriteCdiConfig bool )
var (
MountHostPath bool
)
Functions ¶
func NewBrGPUManager ¶
func PathExists ¶
Types ¶
type ContainerRuntime ¶
type ContainerRuntime string
const ( RuntimeKata ContainerRuntime = "kata" RuntimeRunc ContainerRuntime = "runc" )
type DevicesInfo ¶
type DevicesInfoList ¶
type DevicesInfoList []DevicesInfo
func DeviceDiscover ¶ added in v0.7.3
func DeviceDiscover() (DevicesInfoList, error)
func (DevicesInfoList) AllCardIDs ¶
func (d DevicesInfoList) AllCardIDs() []string
func (DevicesInfoList) FilterByName ¶
func (d DevicesInfoList) FilterByName(resourceName string) DevicesInfoList
func (DevicesInfoList) ResourceNames ¶
func (d DevicesInfoList) ResourceNames() []string
type GPUConfig ¶
type GPUConfig struct {
GPUPartitionSize string
}
GPUConfig stores the settings used to configure the GPUs on a node.
type Lister ¶
type Lister struct { ResUpdateChan chan dpm.PluginNameList Heartbeat chan bool MountAllDevice bool MountDriDevice bool DevicesInfoList DevicesInfoList PFDeviceInfoList PFDeviceInfoList Runtime string MountHostPath bool }
func (*Lister) Discover ¶
func (l *Lister) Discover(pluginListCh chan dpm.PluginNameList)
func (*Lister) GetResourceNamespace ¶
type PFDeviceInfo ¶
type PFDeviceInfo struct { Addr string VFs []VFDeviceInfo VFCount int }
type PFDeviceInfoList ¶
type PFDeviceInfoList []PFDeviceInfo
func (PFDeviceInfoList) Contain ¶
func (p PFDeviceInfoList) Contain(pciaddr string) bool
func (PFDeviceInfoList) FilterByName ¶
func (p PFDeviceInfoList) FilterByName(resourceName string) PFDeviceInfoList
func (PFDeviceInfoList) ResourceNames ¶
func (p PFDeviceInfoList) ResourceNames() []string
type Plugin ¶
type Plugin struct { PFDevices PFDeviceInfoList BRGPUs DevicesInfoList Runtime string Heartbeat chan bool MountAllDevice bool MountDriDevice bool MountHostPath bool TopoGraph *utils.Graph // contains filtered or unexported fields }
func (*Plugin) Allocate ¶
func (p *Plugin) Allocate(ctx context.Context, r *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error)
func (*Plugin) GetDevicePluginOptions ¶
func (*Plugin) GetPreferredAllocation ¶
func (p *Plugin) GetPreferredAllocation(ctx context.Context, r *pluginapi.PreferredAllocationRequest) (*pluginapi.PreferredAllocationResponse, error)
func (*Plugin) ListAndWatch ¶
func (*Plugin) PreStartContainer ¶
func (p *Plugin) PreStartContainer(ctx context.Context, r *pluginapi.PreStartContainerRequest) (*pluginapi.PreStartContainerResponse, error)