devicelease

package
v0.33.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package devicelease guards physical accelerator residency across modeld data roots. The normal modeld lease stays per-data-root for service discovery; this wrapper adds a second, fixed-location lease keyed by the backend's resolved accelerator device so two daemons cannot make models resident on the same GPU.

Index

Constants

View Source
const (
	// EnvLeaseDir overrides the directory used for fixed-location device leases.
	// It exists for tests and for operators with non-standard cache locations.
	EnvLeaseDir = "CONTENOX_MODELD_DEVICE_LEASE_DIR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Service)

func WithLeaseDir

func WithLeaseDir(dir string) Option

WithLeaseDir sets the directory where device lease files are stored.

func WithMeta

func WithMeta(meta map[string]string) Option

WithMeta attaches holder metadata to the lease record.

func WithTTL

func WithTTL(ttl time.Duration) Option

WithTTL sets the device lease TTL. Owners renew until the session closes.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service wraps a transport.Service with accelerator-device ownership.

func New

func New(next transport.Service, opts ...Option) *Service

New returns next wrapped with accelerator-device leases.

func (*Service) Describe

func (*Service) Embed

func (*Service) OpenSession

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL