thin

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataSyncNotDoneMsg               = "[Calculating]"
	CheckMetadataSyncDoneTimeoutMillisec = 500
)
View Source
const (
	EnvFuseConfigStorage = "THIN_FUSE_CONFIG_STORAGE"
)

Variables

This section is empty.

Functions

func CheckReferenceDatasetRuntime

func CheckReferenceDatasetRuntime(ctx cruntime.ReconcileRequestContext, runtime *datav1alpha1.ThinRuntime) (bool, error)

CheckReferenceDatasetRuntime judge if this runtime is used for handling dataset mounting another dataset.

func Precheck

func Precheck(client client.Client, key types.NamespacedName) (found bool, err error)

Types

type Config

type Config struct {
	Mounts                       []datav1alpha1.Mount                         `json:"mounts,omitempty"`
	TargetPath                   string                                       `json:"targetPath,omitempty"`
	RuntimeOptions               map[string]string                            `json:"runtimeOptions,omitempty"`
	PersistentVolumeAttrs        map[string]*corev1.CSIPersistentVolumeSource `json:"persistentVolumeAttrs,omitempty"`
	PersistentVolumeMountOptions map[string][]string                          `json:"persistentVolumeMountOptions,omitempty"`
	AccessModes                  []corev1.PersistentVolumeAccessMode          `json:"accessModes,omitempty"`
}

type Fuse

type Fuse struct {
	Enabled         bool                   `json:"enabled,omitempty"`
	Image           string                 `json:"image,omitempty"`
	ImageTag        string                 `json:"imageTag,omitempty"`
	ImagePullPolicy string                 `json:"imagePullPolicy,omitempty"`
	Resources       common.Resources       `json:"resources,omitempty"`
	Ports           []corev1.ContainerPort `json:"ports,omitempty"`
	CriticalPod     bool                   `json:"criticalPod,omitempty"`
	HostNetwork     bool                   `json:"hostNetwork,omitempty"`
	HostPID         bool                   `json:"hostPID,omitempty"`
	TargetPath      string                 `json:"targetPath,omitempty"`
	NodeSelector    map[string]string      `json:"nodeSelector,omitempty"`
	Envs            []corev1.EnvVar        `json:"envs,omitempty"`
	Command         []string               `json:"command,omitempty"`
	Args            []string               `json:"args,omitempty"`
	Volumes         []corev1.Volume        `json:"volumes,omitempty"`
	VolumeMounts    []corev1.VolumeMount   `json:"volumeMounts,omitempty"`
	LivenessProbe   *corev1.Probe          `json:"livenessProbe,omitempty"`
	ReadinessProbe  *corev1.Probe          `json:"readinessProbe,omitempty"`
	CacheDir        string                 `json:"cacheDir,omitempty"`
	ConfigValue     string                 `json:"configValue"`
	ConfigStorage   string                 `json:"configStorage"`
}

type RuntimeSetConfig

type RuntimeSetConfig struct {
	Workers []string `json:"workers"`
	Fuses   []string `json:"fuses"`
}

RuntimeSetConfig is with the info of the workers and fuses

type ThinEngine

type ThinEngine struct {
	Log logr.Logger
	client.Client

	MetadataSyncDoneCh chan base.MetadataSyncResult

	UnitTest bool

	*ctrl.Helper
	// contains filtered or unexported fields
}

func (ThinEngine) AssignNodesToCache

func (t ThinEngine) AssignNodesToCache(desiredNum int32) (currentNum int32, err error)

func (*ThinEngine) BindToDataset

func (t *ThinEngine) BindToDataset() (err error)

func (*ThinEngine) CheckAndUpdateRuntimeStatus

func (t *ThinEngine) CheckAndUpdateRuntimeStatus() (ready bool, err error)

func (ThinEngine) CheckMasterReady

func (t ThinEngine) CheckMasterReady() (ready bool, err error)

func (ThinEngine) CheckRuntimeHealthy

func (t ThinEngine) CheckRuntimeHealthy() (err error)

func (ThinEngine) CheckRuntimeReady

func (t ThinEngine) CheckRuntimeReady() (ready bool)

func (ThinEngine) CheckWorkersReady

func (t ThinEngine) CheckWorkersReady() (ready bool, err error)

func (ThinEngine) CreateDataLoadJob

func (t ThinEngine) CreateDataLoadJob(ctx cruntime.ReconcileRequestContext, targetDataload datav1alpha1.DataLoad) error

func (*ThinEngine) CreateDataMigrateJob

func (t *ThinEngine) CreateDataMigrateJob(ctx cruntime.ReconcileRequestContext, targetDataMigrate datav1alpha1.DataMigrate) error

func (ThinEngine) CreateVolume

func (t ThinEngine) CreateVolume() (err error)

func (ThinEngine) DeleteVolume

func (t ThinEngine) DeleteVolume() (err error)

func (*ThinEngine) FreeStorageBytes

func (t *ThinEngine) FreeStorageBytes() (int64, error)

func (*ThinEngine) GetDataOperationValueFile

func (t *ThinEngine) GetDataOperationValueFile(ctx cruntime.ReconcileRequestContext, operation dataoperation.OperationInterface) (valueFileName string, err error)

func (*ThinEngine) GetRunningPodsOfDaemonset

func (t *ThinEngine) GetRunningPodsOfDaemonset(dsName string, namespace string) (pods []corev1.Pod, err error)

func (ThinEngine) PrepareUFS

func (t ThinEngine) PrepareUFS() (err error)

func (ThinEngine) SetupMaster

func (t ThinEngine) SetupMaster() (err error)

func (ThinEngine) SetupWorkers

func (t ThinEngine) SetupWorkers() (err error)

func (ThinEngine) ShouldCheckUFS

func (t ThinEngine) ShouldCheckUFS() (should bool, err error)

func (ThinEngine) ShouldSetupMaster

func (t ThinEngine) ShouldSetupMaster() (should bool, err error)

func (ThinEngine) ShouldSetupWorkers

func (t ThinEngine) ShouldSetupWorkers() (should bool, err error)

func (ThinEngine) ShouldUpdateUFS

func (t ThinEngine) ShouldUpdateUFS() (ufsToUpdate *utils.UFSToUpdate)

func (ThinEngine) Shutdown

func (t ThinEngine) Shutdown() (err error)

func (*ThinEngine) SyncMetadata

func (t *ThinEngine) SyncMetadata() (err error)

func (ThinEngine) SyncReplicas

func (t ThinEngine) SyncReplicas(ctx cruntime.ReconcileRequestContext) (err error)

func (ThinEngine) SyncRuntime

func (t ThinEngine) SyncRuntime(ctx cruntime.ReconcileRequestContext) (changed bool, err error)

func (ThinEngine) SyncScheduleInfoToCacheNodes

func (t ThinEngine) SyncScheduleInfoToCacheNodes() (err error)

func (*ThinEngine) TotalFileNums

func (t *ThinEngine) TotalFileNums() (int64, error)

func (*ThinEngine) TotalStorageBytes

func (t *ThinEngine) TotalStorageBytes() (int64, error)

func (*ThinEngine) UpdateCacheOfDataset

func (t *ThinEngine) UpdateCacheOfDataset() (err error)

func (*ThinEngine) UpdateDatasetStatus

func (t *ThinEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (err error)

func (ThinEngine) UpdateOnUFSChange

func (t ThinEngine) UpdateOnUFSChange(ufsToUpdate *utils.UFSToUpdate) (ready bool, err error)

func (*ThinEngine) UpdateRuntimeSetConfigIfNeeded

func (t *ThinEngine) UpdateRuntimeSetConfigIfNeeded() (updated bool, err error)

func (*ThinEngine) UsedStorageBytes

func (t *ThinEngine) UsedStorageBytes() (int64, error)

type ThinValue

type ThinValue struct {
	FullnameOverride string `json:"fullnameOverride"`

	common.ImageInfo `json:",inline"`
	common.UserInfo  `json:",inline"`

	Fuse            Fuse                   `json:"fuse,omitempty"`
	Worker          Worker                 `json:"worker,omitempty"`
	NodeSelector    map[string]string      `json:"nodeSelector,omitempty"`
	Tolerations     []corev1.Toleration    `json:"tolerations,omitempty"`
	PlacementMode   string                 `json:"placement,omitempty"`
	Owner           *common.OwnerReference `json:"owner,omitempty"`
	RuntimeValue    string                 `json:"runtimeValue"`
	RuntimeIdentity common.RuntimeIdentity `json:"runtimeIdentity"`
}

type Worker

type Worker struct {
	Image           string                 `json:"image,omitempty"`
	ImageTag        string                 `json:"imageTag,omitempty"`
	ImagePullPolicy string                 `json:"imagePullPolicy,omitempty"`
	Resources       common.Resources       `json:"resources,omitempty"`
	NodeSelector    map[string]string      `json:"nodeSelector,omitempty"`
	HostNetwork     bool                   `json:"hostNetwork,omitempty"`
	Envs            []corev1.EnvVar        `json:"envs,omitempty"`
	Ports           []corev1.ContainerPort `json:"ports,omitempty"`
	Volumes         []corev1.Volume        `json:"volumes,omitempty"`
	VolumeMounts    []corev1.VolumeMount   `json:"volumeMounts,omitempty"`
	LivenessProbe   *corev1.Probe          `json:"livenessProbe,omitempty"`
	ReadinessProbe  *corev1.Probe          `json:"readinessProbe,omitempty"`
	CacheDir        string                 `json:"cacheDir,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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