Documentation
¶
Overview ¶
Package gpu inventories node GPUs over the Docker API, so the node agent needs no changes.
Index ¶
- Variables
- type Config
- type NoDeviceError
- type NodeDocker
- type Service
- func (s *Service) Devices(serverID uint) ([]models.GPUDevice, error)
- func (s *Service) Enabled() bool
- func (s *Service) Inventory(ctx context.Context) error
- func (s *Service) InventoryNode(ctx context.Context, serverID uint) (int, error)
- func (s *Service) NodeCapable(ctx context.Context, serverID uint) bool
- func (s *Service) Preflight(app *models.Application) error
- func (s *Service) ResolveDevices(ctx context.Context, app *models.Application, runtimes []string) ([]docker.GPURequest, error)
- func (s *Service) SetDevice(serverID, gpuID uint, enabled, shared *bool) (*models.GPUDevice, error)
- func (s *Service) SetQuota(q *quota.Service)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDeviceNotOnNode = errors.New("gpu device does not belong to this node")
View Source
var ErrGPUDisabled = errors.New("GPU support is disabled on this platform")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Enabled bool
NvidiaRuntime string // container runtime name that signals the NVIDIA toolkit
ProbeImage string // one-shot image the inventory probe runs nvidia-smi in
}
Config carries the GPU knobs from the platform config.
type NoDeviceError ¶
NoDeviceError names the node and requested kind so the deploy log is actionable.
func (*NoDeviceError) Code ¶
func (e *NoDeviceError) Code() string
func (*NoDeviceError) Error ¶
func (e *NoDeviceError) Error() string
type NodeDocker ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(devices *repositories.GPUDeviceRepository, servers *repositories.ServerRepository, apps *repositories.ApplicationRepository, clients NodeDocker, cfg Config) *Service
NewService builds the GPU service. quota is wired separately via SetQuota.
func (*Service) InventoryNode ¶
Most nodes have no GPU, so a missing runtime or failed probe yields zero devices, not an error; new devices arrive disabled.
func (*Service) NodeCapable ¶
Lets the admin UI explain a node with no listed GPUs.
func (*Service) ResolveDevices ¶
func (s *Service) ResolveDevices(ctx context.Context, app *models.Application, runtimes []string) ([]docker.GPURequest, error)
A node without the NVIDIA runtime is refused up front rather than failing cryptically at container start.
Click to show internal directories.
Click to hide internal directories.