efc

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: 46 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MasterMountPath = "/efc/efc-master"
	FuseMountDir    = "efc-fuse"

	AccessKeyIDName     = "efc.nas.accessKeyId"
	AccessKeySecretName = "efc.nas.accessKeySecret"

	WorkerEndpointsDataName = "efc-worker-endpoints.json"

	NasMountPointPrefix = "nfs://"

	CpfsMountPointPrefix = "cpfs://"
)

Variables

This section is empty.

Functions

func GetReservedPorts

func GetReservedPorts(client client.Client) (ports []int, err error)

GetReservedPorts defines restoration logic for EFCRuntime

func Precheck

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

Precheck checks if the given key can be found in the current runtime types

Types

type EFC

type EFC struct {
	FullnameOverride string                 `yaml:"fullnameOverride"`
	PlacementMode    string                 `yaml:"placement,omitempty"`
	Master           Master                 `yaml:"master"`
	Worker           Worker                 `yaml:"worker"`
	Fuse             Fuse                   `yaml:"fuse"`
	InitFuse         InitFuse               `yaml:"initFuse"`
	OSAdvise         OSAdvise               `yaml:"osAdvise"`
	Tolerations      []v1.Toleration        `yaml:"tolerations,omitempty"`
	Owner            *common.OwnerReference `yaml:"owner,omitempty"`
	RuntimeIdentity  common.RuntimeIdentity `yaml:"runtimeIdentity,omitempty"`
}

The value yaml file

type EFCEngine

type EFCEngine struct {
	UnitTest bool
	Log      logr.Logger
	*ctrl.Helper
	client.Client
	// contains filtered or unexported fields
}

func (*EFCEngine) AssignNodesToCache

func (e *EFCEngine) AssignNodesToCache(desiredNum int32) (currentScheduleNum int32, err error)

AssignNodesToCache finds nodes to place the cache engine

func (*EFCEngine) BindToDataset

func (e *EFCEngine) BindToDataset() (err error)

func (*EFCEngine) CheckAndUpdateRuntimeStatus

func (e *EFCEngine) CheckAndUpdateRuntimeStatus() (ready bool, err error)

CheckAndUpdateRuntimeStatus checks the related runtime status and updates it.

func (*EFCEngine) CheckMasterReady

func (e *EFCEngine) CheckMasterReady() (ready bool, err error)

func (*EFCEngine) CheckRuntimeHealthy

func (e *EFCEngine) CheckRuntimeHealthy() (err error)

CheckRuntimeHealthy checks the healthy of the runtime

func (*EFCEngine) CheckRuntimeReady

func (e *EFCEngine) CheckRuntimeReady() (ready bool)

CheckRuntimeReady checks if runtime is ready or not

func (*EFCEngine) CheckWorkersReady

func (e *EFCEngine) CheckWorkersReady() (ready bool, err error)

are the workers ready

func (*EFCEngine) CreateDataLoadJob

func (e *EFCEngine) CreateDataLoadJob(ctx cruntime.ReconcileRequestContext, targetDataload datav1alpha1.DataLoad) (err error)

CreateDataLoadJob creates the job to load data

func (*EFCEngine) CreateDataMigrateJob

func (e *EFCEngine) CreateDataMigrateJob(ctx cruntime.ReconcileRequestContext, targetDataMigrate datav1alpha1.DataMigrate) error

func (*EFCEngine) CreateVolume

func (e *EFCEngine) CreateVolume() (err error)

func (*EFCEngine) DeleteVolume

func (e *EFCEngine) DeleteVolume() (err error)

func (*EFCEngine) FreeStorageBytes

func (e *EFCEngine) FreeStorageBytes() (int64, error)

func (*EFCEngine) GetDataOperationValueFile

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

func (*EFCEngine) PrepareUFS

func (e *EFCEngine) PrepareUFS() (err error)

func (*EFCEngine) SetupMaster

func (e *EFCEngine) SetupMaster() (err error)

SetupMaster setups the master and updates the status It will print the information in the Debug window according to the Master status It return any cache error encountered

func (*EFCEngine) SetupWorkers

func (e *EFCEngine) SetupWorkers() (err error)

SetupWorkers checks the desired and current replicas of workers and makes an update over the status by setting phases and conditions. The function calls for a status update and finally returns error if anything unexpected happens.

func (*EFCEngine) ShouldCheckUFS

func (e *EFCEngine) ShouldCheckUFS() (should bool, err error)

func (*EFCEngine) ShouldSetupMaster

func (e *EFCEngine) ShouldSetupMaster() (should bool, err error)

func (*EFCEngine) ShouldSetupWorkers

func (e *EFCEngine) ShouldSetupWorkers() (should bool, err error)

ShouldSetupWorkers checks if we need setup the workers

func (*EFCEngine) ShouldUpdateUFS

func (e *EFCEngine) ShouldUpdateUFS() (ufsToUpdate *utils.UFSToUpdate)

ShouldUpdateUFS EFCEngine hasn't support UpdateOnUFSChange

func (*EFCEngine) Shutdown

func (e *EFCEngine) Shutdown() (err error)

Shutdown shuts down the EFC engine

func (*EFCEngine) SyncMetadata

func (e *EFCEngine) SyncMetadata() (err error)

func (*EFCEngine) SyncReplicas

func (e *EFCEngine) SyncReplicas(ctx cruntime.ReconcileRequestContext) (err error)

SyncReplicas syncs the replicas

func (*EFCEngine) SyncRuntime

func (e *EFCEngine) SyncRuntime(ctx cruntime.ReconcileRequestContext) (changed bool, err error)

SyncRuntime syncs the runtime spec

func (*EFCEngine) SyncScheduleInfoToCacheNodes

func (e *EFCEngine) SyncScheduleInfoToCacheNodes() (err error)

SyncScheduleInfoToCacheNodes syncs schedule info to nodes

func (*EFCEngine) TotalFileNums

func (e *EFCEngine) TotalFileNums() (int64, error)

func (*EFCEngine) TotalStorageBytes

func (e *EFCEngine) TotalStorageBytes() (int64, error)

func (*EFCEngine) UpdateCacheOfDataset

func (e *EFCEngine) UpdateCacheOfDataset() (err error)

UpdateCacheOfDataset updates the CacheStates and Runtimes of the dataset.

func (*EFCEngine) UpdateDatasetStatus

func (e *EFCEngine) UpdateDatasetStatus(phase datav1alpha1.DatasetPhase) (err error)

UpdateDatasetStatus updates the status of the dataset

func (*EFCEngine) UpdateOnUFSChange

func (e *EFCEngine) UpdateOnUFSChange(ufsToUpdate *utils.UFSToUpdate) (ready bool, err error)

func (*EFCEngine) UsedStorageBytes

func (e *EFCEngine) UsedStorageBytes() (int64, error)

type Fuse

type Fuse struct {
	common.ImageInfo `yaml:",inline"`
	MountPoint       string            `yaml:"mountPoint,omitempty"`
	HostMountPath    string            `yaml:"hostMountPath,omitempty"`
	Port             Port              `yaml:"port,omitempty"`
	Options          string            `yaml:"option,omitempty"`
	Resources        common.Resources  `yaml:"resources,omitempty"`
	NodeSelector     map[string]string `yaml:"nodeSelector,omitempty"`
	HostNetwork      bool              `yaml:"hostNetwork"`
	TieredStore      TieredStore       `yaml:"tieredstore,omitempty"`
	CriticalPod      bool              `yaml:"criticalPod"`
	Labels           map[string]string `yaml:"labels,omitempty"`
	Annotations      map[string]string `yaml:"annotations,omitempty"`
}

type InitFuse

type InitFuse struct {
	common.ImageInfo `yaml:",inline"`
}

type Level

type Level struct {
	Alias      string `yaml:"alias,omitempty"`
	Level      int    `yaml:"level"`
	MediumType string `yaml:"mediumtype,omitempty"`
	Type       string `yaml:"type,omitempty"`
	Path       string `yaml:"path,omitempty"`
	Quota      string `yaml:"quota,omitempty"`
	High       string `yaml:"high,omitempty"`
	Low        string `yaml:"low,omitempty"`
}

type Master

type Master struct {
	common.ImageInfo `yaml:",inline"`
	MountPoint       string            `yaml:"mountPoint,omitempty"`
	Replicas         int32             `yaml:"count,omitempty"`
	Enabled          bool              `yaml:"enabled"`
	Options          string            `yaml:"option,omitempty"`
	Resources        common.Resources  `yaml:"resources,omitempty"`
	NodeSelector     map[string]string `yaml:"nodeSelector,omitempty"`
	HostNetwork      bool              `yaml:"hostNetwork"`
	TieredStore      TieredStore       `yaml:"tieredstore,omitempty"`
	Labels           map[string]string `yaml:"labels,omitempty"`
	Annotations      map[string]string `yaml:"annotations,omitempty"`
}

type MountInfo

type MountInfo struct {
	MountPoint       string
	MountPointPrefix string
	ServiceAddr      string
	FileSystemId     string
	DirPath          string
}

type OSAdvise

type OSAdvise struct {
	OSVersion string `yaml:"osVersion,omitempty"`
	Enabled   bool   `yaml:"enabled"`
}

type Port

type Port struct {
	Rpc     int `yaml:"rpc,omitempty"`
	Monitor int `yaml:"monitor,omitempty"`
}

type SessMgrInitializer

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

func NewSessMgrInitializer

func NewSessMgrInitializer(client client.Client) *SessMgrInitializer

func (*SessMgrInitializer) NeedLeaderElection

func (s *SessMgrInitializer) NeedLeaderElection() bool

func (*SessMgrInitializer) Start

func (s *SessMgrInitializer) Start(ctx context.Context) error

type TieredStore

type TieredStore struct {
	Levels []Level `yaml:"levels,omitempty"`
}

type Worker

type Worker struct {
	common.ImageInfo `yaml:",inline"`
	Port             Port              `yaml:"port,omitempty"`
	Enabled          bool              `yaml:"enabled"`
	Options          string            `yaml:"option,omitempty"`
	Resources        common.Resources  `yaml:"resources,omitempty"`
	NodeSelector     map[string]string `yaml:"nodeSelector,omitempty"`
	HostNetwork      bool              `yaml:"hostNetwork"`
	TieredStore      TieredStore       `yaml:"tieredstore,omitempty"`
	Labels           map[string]string `yaml:"labels,omitempty"`
	Annotations      map[string]string `yaml:"annotations,omitempty"`
}

type WorkerEndPoints

type WorkerEndPoints struct {
	ContainerEndPoints []string `json:"containerendpoints,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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