Help us shape the future of Go! Take the 2026 Go Developer Survey

service

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2025 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ERR_CODE_INVALID_ARGUMENT        = "INVALID_ARGUMENT"
	ERR_CODE_INTERNAL                = "INTERNAL"
	ERR_CODE_NOT_FOUND               = "NOT_FOUND"
	ERR_CODE_INSUFFICIENT_DISK_QUOTA = "INSUFFICIENT_DISK_QUOTA"
)
View Source
const (
	// VendorVersion is the version of this CSP SP.
	VendorVersion = "0.1.0"
)

Variables

View Source
var CacheSacnInterval = 60 * time.Second
View Source
var ErrConflict = errors.New("conflict")
View Source
var NewPuller = func(ctx context.Context, pullCfg *config.PullConfig, hook *status.Hook, diskQuotaChecker *DiskQuotaChecker) Puller {
	return &puller{
		pullCfg:          pullCfg,
		hook:             hook,
		diskQuotaChecker: diskQuotaChecker,
	}
}

Functions

This section is empty.

Types

type CacheManager

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

func NewCacheManager

func NewCacheManager(cfg *config.Config) (*CacheManager, error)

func (*CacheManager) Scan

func (cm *CacheManager) Scan() error

type ContextMap

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

func NewContextMap

func NewContextMap() *ContextMap

func (*ContextMap) Get

func (cm *ContextMap) Get(key string) *context.CancelFunc

func (*ContextMap) Set

func (cm *ContextMap) Set(key string, cancelFunc *context.CancelFunc)

type DiskQuotaChecker

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

func NewDiskQuotaChecker

func NewDiskQuotaChecker(cfg *config.Config) *DiskQuotaChecker

func (*DiskQuotaChecker) Check

func (d *DiskQuotaChecker) Check(ctx context.Context, modelArtifact *ModelArtifact, excludeModelWeights bool) error

Check checks if there is enough disk quota to mount the model.

If cfg.Features.CheckDiskQuota is enabled and the Mount request specifies checkDiskQuota = true: - When cfg.Features.DiskUsageLimit == 0: reject if available disk space < model size; - When cfg.Features.DiskUsageLimit > 0: reject if (cfg.Features.DiskUsageLimit - used space) < model size;

type DynamicServer added in v0.1.1

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

type DynamicServerHandler added in v0.1.1

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

func (*DynamicServerHandler) CreateVolume added in v0.1.1

func (h *DynamicServerHandler) CreateVolume(c echo.Context) error

func (*DynamicServerHandler) DeleteVolume added in v0.1.1

func (h *DynamicServerHandler) DeleteVolume(c echo.Context) error

func (*DynamicServerHandler) GetVolume added in v0.1.1

func (h *DynamicServerHandler) GetVolume(c echo.Context) error

func (*DynamicServerHandler) ListVolumes added in v0.1.1

func (h *DynamicServerHandler) ListVolumes(c echo.Context) error

type DynamicServerManager added in v0.1.1

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

func NewDynamicServerManager added in v0.1.1

func NewDynamicServerManager(cfg *config.Config, svc *Service) *DynamicServerManager

func (*DynamicServerManager) CloseServer added in v0.1.1

func (m *DynamicServerManager) CloseServer(ctx context.Context, sockPath string) error

func (*DynamicServerManager) CreateServer added in v0.1.1

func (m *DynamicServerManager) CreateServer(ctx context.Context, sockPath string) (*DynamicServer, error)

func (*DynamicServerManager) RecoverServers added in v0.1.1

func (m *DynamicServerManager) RecoverServers(ctx context.Context) error

type ErrorResponse added in v0.1.1

type ErrorResponse struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type ModelArtifact

type ModelArtifact struct {
	Reference string
	// contains filtered or unexported fields
}

func NewModelArtifact

func NewModelArtifact(b backend.Backend, reference string, plainHTTP bool) *ModelArtifact

func (*ModelArtifact) GetPatterns

func (m *ModelArtifact) GetPatterns(ctx context.Context, excludeWeights bool) ([]string, error)

func (*ModelArtifact) GetSize

func (m *ModelArtifact) GetSize(ctx context.Context, excludeWeights bool) (int64, error)

type MountRequest

type MountRequest struct {
	MountID             string `json:"mount_id"`
	Reference           string `json:"reference"`
	CheckDiskQuota      bool   `json:"check_disk_quota"`
	ExcludeModelWeights bool   `json:"exclude_model_weights"`
}

type PullHook

type PullHook interface {
	BeforePullLayer(desc ocispec.Descriptor, manifest ocispec.Manifest)
	AfterPullLayer(desc ocispec.Descriptor, err error)
}

type Puller

type Puller interface {
	Pull(ctx context.Context, reference, targetDir string, excludeModelWeights bool) error
}

type Service

type Service struct {
	csi.UnimplementedControllerServer
	csi.UnimplementedIdentityServer
	csi.UnimplementedNodeServer

	DynamicServerManager *DynamicServerManager
	// contains filtered or unexported fields
}

func New

func New(cfg *config.Config) (*Service, error)

func (*Service) ControllerExpandVolume

func (*Service) CreateSnapshot

func (s *Service) CreateSnapshot(
	ctx context.Context,
	req *csi.CreateSnapshotRequest) (
	*csi.CreateSnapshotResponse, error)

func (*Service) CreateVolume

func (s *Service) CreateVolume(
	ctx context.Context,
	req *csi.CreateVolumeRequest) (
	*csi.CreateVolumeResponse, error)

func (*Service) DeleteSnapshot

func (s *Service) DeleteSnapshot(
	ctx context.Context,
	req *csi.DeleteSnapshotRequest) (
	*csi.DeleteSnapshotResponse, error)

func (*Service) DeleteVolume

func (s *Service) DeleteVolume(
	ctx context.Context,
	req *csi.DeleteVolumeRequest) (
	*csi.DeleteVolumeResponse, error)

func (*Service) GetCapacity

func (s *Service) GetCapacity(
	ctx context.Context,
	req *csi.GetCapacityRequest) (
	*csi.GetCapacityResponse, error)

func (*Service) GetDynamicVolume

func (s *Service) GetDynamicVolume(ctx context.Context, volumeName, mountID string) (*modelStatus.Status, error)

func (*Service) GetPluginCapabilities

func (*Service) GetPluginInfo

func (s *Service) GetPluginInfo(
	ctx context.Context,
	req *csi.GetPluginInfoRequest) (
	*csi.GetPluginInfoResponse, error)

func (*Service) ListDynamicVolumes

func (s *Service) ListDynamicVolumes(ctx context.Context, volumeName string) ([]modelStatus.Status, error)

func (*Service) ListSnapshots

func (s *Service) ListSnapshots(
	ctx context.Context,
	req *csi.ListSnapshotsRequest) (
	*csi.ListSnapshotsResponse, error)

func (*Service) ListVolumes

func (s *Service) ListVolumes(
	ctx context.Context,
	req *csi.ListVolumesRequest) (
	*csi.ListVolumesResponse, error)

func (*Service) NodeExpandVolume

func (s *Service) NodeExpandVolume(
	ctx context.Context,
	req *csi.NodeExpandVolumeRequest) (
	*csi.NodeExpandVolumeResponse, error)

func (*Service) NodeGetCapabilities

func (*Service) NodeGetInfo

func (s *Service) NodeGetInfo(
	ctx context.Context,
	req *csi.NodeGetInfoRequest) (
	*csi.NodeGetInfoResponse, error)

func (*Service) NodeGetVolumeStats

func (*Service) NodePublishVolume

func (s *Service) NodePublishVolume(
	ctx context.Context,
	req *csi.NodePublishVolumeRequest) (
	*csi.NodePublishVolumeResponse, error)

func (*Service) NodeStageVolume

func (s *Service) NodeStageVolume(
	ctx context.Context,
	req *csi.NodeStageVolumeRequest) (
	*csi.NodeStageVolumeResponse, error)

func (*Service) NodeUnpublishVolume

func (*Service) NodeUnstageVolume

func (s *Service) NodeUnstageVolume(
	ctx context.Context,
	req *csi.NodeUnstageVolumeRequest) (
	*csi.NodeUnstageVolumeResponse, error)

func (*Service) Probe

func (s *Service) Probe(
	ctx context.Context,
	req *csi.ProbeRequest) (
	*csi.ProbeResponse, error)

func (*Service) StatusManager

func (svc *Service) StatusManager() *status.StatusManager

type Worker

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

func NewWorker

func NewWorker(cfg *config.Config, sm *status.StatusManager) (*Worker, error)

func (*Worker) DeleteModel

func (worker *Worker) DeleteModel(ctx context.Context, isStaticVolume bool, volumeName, mountID string) error

func (*Worker) PullModel

func (worker *Worker) PullModel(
	ctx context.Context,
	isStaticVolume bool,
	volumeName, mountID,
	reference,
	modelDir string,
	checkDiskQuota bool,
	excludeModelWeights bool,
) error

Jump to

Keyboard shortcuts

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