Documentation
¶
Index ¶
- Constants
- Variables
- type CacheManager
- type ContextMap
- type DiskQuotaChecker
- type Hook
- type ModelArtifact
- type MountRequest
- type PullHook
- type Puller
- type Service
- func (s *Service) ControllerExpandVolume(ctx context.Context, req *csi.ControllerExpandVolumeRequest) (*csi.ControllerExpandVolumeResponse, error)
- func (s *Service) ControllerGetCapabilities(ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) (*csi.ControllerGetCapabilitiesResponse, error)
- func (s *Service) ControllerPublishVolume(ctx context.Context, req *csi.ControllerPublishVolumeRequest) (*csi.ControllerPublishVolumeResponse, error)
- func (s *Service) ControllerUnpublishVolume(ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) (*csi.ControllerUnpublishVolumeResponse, error)
- func (s *Service) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshotRequest) (*csi.CreateSnapshotResponse, error)
- func (s *Service) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest) (*csi.CreateVolumeResponse, error)
- func (s *Service) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshotRequest) (*csi.DeleteSnapshotResponse, error)
- func (s *Service) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest) (*csi.DeleteVolumeResponse, error)
- func (s *Service) GetCapacity(ctx context.Context, req *csi.GetCapacityRequest) (*csi.GetCapacityResponse, error)
- func (s *Service) GetDynamicVolume(ctx context.Context, volumeName, mountID string) (*modelStatus.Status, error)
- func (s *Service) GetPluginCapabilities(ctx context.Context, req *csi.GetPluginCapabilitiesRequest) (*csi.GetPluginCapabilitiesResponse, error)
- func (s *Service) GetPluginInfo(ctx context.Context, req *csi.GetPluginInfoRequest) (*csi.GetPluginInfoResponse, error)
- func (s *Service) ListDynamicVolumes(ctx context.Context, volumeName string) ([]modelStatus.Status, error)
- func (s *Service) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRequest) (*csi.ListSnapshotsResponse, error)
- func (s *Service) ListVolumes(ctx context.Context, req *csi.ListVolumesRequest) (*csi.ListVolumesResponse, error)
- func (s *Service) NodeExpandVolume(ctx context.Context, req *csi.NodeExpandVolumeRequest) (*csi.NodeExpandVolumeResponse, error)
- func (s *Service) NodeGetCapabilities(ctx context.Context, req *csi.NodeGetCapabilitiesRequest) (*csi.NodeGetCapabilitiesResponse, error)
- func (s *Service) NodeGetInfo(ctx context.Context, req *csi.NodeGetInfoRequest) (*csi.NodeGetInfoResponse, error)
- func (s *Service) NodeGetVolumeStats(ctx context.Context, req *csi.NodeGetVolumeStatsRequest) (*csi.NodeGetVolumeStatsResponse, error)
- func (s *Service) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolumeRequest) (*csi.NodePublishVolumeResponse, error)
- func (s *Service) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRequest) (*csi.NodeStageVolumeResponse, error)
- func (s *Service) NodeUnpublishVolume(ctx context.Context, req *csi.NodeUnpublishVolumeRequest) (*csi.NodeUnpublishVolumeResponse, error)
- func (s *Service) NodeUnstageVolume(ctx context.Context, req *csi.NodeUnstageVolumeRequest) (*csi.NodeUnstageVolumeResponse, error)
- func (s *Service) Probe(ctx context.Context, req *csi.ProbeRequest) (*csi.ProbeResponse, error)
- func (svc *Service) StatusManager() *status.StatusManager
- func (s *Service) ValidateVolumeCapabilities(ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) (*csi.ValidateVolumeCapabilitiesResponse, error)
- type Worker
Constants ¶
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 *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 Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
func (*Hook) AfterPullLayer ¶
func (h *Hook) AfterPullLayer(desc ocispec.Descriptor, err error)
func (*Hook) BeforePullLayer ¶
func (h *Hook) BeforePullLayer(desc ocispec.Descriptor, manifest ocispec.Manifest)
func (*Hook) GetProgress ¶
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 ¶
type MountRequest ¶
type PullHook ¶
type PullHook interface {
BeforePullLayer(desc ocispec.Descriptor, manifest ocispec.Manifest)
AfterPullLayer(desc ocispec.Descriptor, err error)
}
type Service ¶
type Service struct {
csi.UnimplementedControllerServer
csi.UnimplementedIdentityServer
csi.UnimplementedNodeServer
// contains filtered or unexported fields
}
func (*Service) ControllerExpandVolume ¶
func (s *Service) ControllerExpandVolume( ctx context.Context, req *csi.ControllerExpandVolumeRequest) ( *csi.ControllerExpandVolumeResponse, error)
func (*Service) ControllerGetCapabilities ¶
func (s *Service) ControllerGetCapabilities( ctx context.Context, req *csi.ControllerGetCapabilitiesRequest) ( *csi.ControllerGetCapabilitiesResponse, error)
func (*Service) ControllerPublishVolume ¶
func (s *Service) ControllerPublishVolume( ctx context.Context, req *csi.ControllerPublishVolumeRequest) ( *csi.ControllerPublishVolumeResponse, error)
func (*Service) ControllerUnpublishVolume ¶
func (s *Service) ControllerUnpublishVolume( ctx context.Context, req *csi.ControllerUnpublishVolumeRequest) ( *csi.ControllerUnpublishVolumeResponse, error)
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 (*Service) GetPluginCapabilities ¶
func (s *Service) GetPluginCapabilities( ctx context.Context, req *csi.GetPluginCapabilitiesRequest) ( *csi.GetPluginCapabilitiesResponse, error)
func (*Service) GetPluginInfo ¶
func (s *Service) GetPluginInfo( ctx context.Context, req *csi.GetPluginInfoRequest) ( *csi.GetPluginInfoResponse, error)
func (*Service) ListDynamicVolumes ¶
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 (s *Service) NodeGetCapabilities( ctx context.Context, req *csi.NodeGetCapabilitiesRequest) ( *csi.NodeGetCapabilitiesResponse, error)
func (*Service) NodeGetInfo ¶
func (s *Service) NodeGetInfo( ctx context.Context, req *csi.NodeGetInfoRequest) ( *csi.NodeGetInfoResponse, error)
func (*Service) NodeGetVolumeStats ¶
func (s *Service) NodeGetVolumeStats( ctx context.Context, req *csi.NodeGetVolumeStatsRequest) ( *csi.NodeGetVolumeStatsResponse, error)
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 (s *Service) NodeUnpublishVolume( ctx context.Context, req *csi.NodeUnpublishVolumeRequest) ( *csi.NodeUnpublishVolumeResponse, error)
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
func (*Service) ValidateVolumeCapabilities ¶
func (s *Service) ValidateVolumeCapabilities( ctx context.Context, req *csi.ValidateVolumeCapabilitiesRequest) ( *csi.ValidateVolumeCapabilitiesResponse, error)
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
func (*Worker) DeleteModel ¶
Click to show internal directories.
Click to hide internal directories.