thin

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: Apache-2.0 Imports: 45 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"`
	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"`
	Labels           map[string]string             `json:"labels,omitempty"`
	Annotations      map[string]string             `json:"annotations,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"`
	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"`
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
	Lifecycle        *corev1.Lifecycle             `json:"lifecycle,omitempty"`
}

type ThinEngine

type ThinEngine struct {
	Log logr.Logger
	client.Client
	Recorder record.EventRecorder

	MetadataSyncDoneCh chan base.MetadataSyncResult

	UnitTest bool

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

func (*ThinEngine) BindToDataset

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

func (*ThinEngine) CheckAndUpdateRuntimeStatus

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

func (ThinEngine) CheckMasterReady

func (t ThinEngine) CheckMasterReady() (bool, 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) 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) UsedStorageBytes

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

func (*ThinEngine) Validate added in v1.0.2

func (t *ThinEngine) Validate(ctx cruntime.ReconcileRequestContext) (err error)

type ThinValue

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

	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"`
	RuntimeIdentity  common.RuntimeIdentity        `json:"runtimeIdentity"`
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

type Worker

type Worker 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"`
	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"`
	ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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