common

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Overview

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	ALLUXIO_RUNTIME = "alluxio"

	ALLUXIO_MOUNT_TYPE = "fuse.alluxio-fuse"

	ALLUXIO_NAMESPACE = "alluxio-system"

	ALLUXIO_CHART = ALLUXIO_RUNTIME

	DEFAULT_INIT_IMAGE_ENV = "DEFAULT_INIT_IMAGE_ENV"

	ALLUXIO_RUNTIME_IMAGE_ENV = "ALLUXIO_RUNTIME_IMAGE_ENV"

	ALLUXIO_FUSE_IMAGE_ENV = "ALLUXIO_FUSE_IMAGE_ENV"

	DEFAULT_INIT_IMAGE = "registry.cn-hangzhou.aliyuncs.com/fluid/init-users:v0.3.0-1467caa"

	DEFAULT_ALLUXIO_RUNTIME_IMAGE = "registry.cn-huhehaote.aliyuncs.com/alluxio/alluxio:2.3.0-SNAPSHOT-2c41226"

	DEFAULT_ALLUXIO_FUSE_IMAGE = "registry.cn-huhehaote.aliyuncs.com/alluxio/alluxio-fuse:2.3.0-SNAPSHOT-2c41226"
)

Runtime for Alluxio

View Source
const (
	ErrorProcessDatasetReason = "ErrorProcessDataset"

	ErrorDeleteDataset = "ErrorDeleteDataset"

	ErrorProcessRuntimeReason = "ErrorProcessRuntime"

	ErrorHelmInstall = "ErrorHelmInstall"

	TargetDatasetNotFound = "TargetDatasetNotFound"

	TargetDatasetPathNotFound = "TargetDatasetPathNotFound"

	TargetDatasetNotReady = "TargetDatasetNotReady"

	TargetDatasetNamespaceNotSame = "TargetDatasetNamespaceNotSame"

	DataLoadCollision = "DataLoadCollision"

	RuntimeNotReady = "RuntimeNotReady"

	DataLoadJobStarted = "DataLoadJobStarted"

	DataLoadJobFailed = "DataLoadJobFailed"

	DataLoadJobComplete = "DataLoadJobComplete"

	DataBackupFailed = "DataBackupFailed"

	DataBackupComplete = "DataBackupComplete"

	RuntimeScaleInFailed = "RuntimeScaleInFailed"

	Succeed = "Succeed"
)

Reason for Fluid events

View Source
const (
	RootDirPath            = "/"
	DefaultImagePullPolicy = "IfNotPresent"
	MyPodNamespace         = "MY_POD_NAMESPACE"
	True                   = "true"
	False                  = "false"
)
View Source
const (
	GooseFSRuntime = "goosefs"

	GooseFSMountType = "fuse.goosefs-fuse"

	GooseFSNamespace = "goosefs-system"

	GooseFSChart = GooseFSRuntime

	GooseFSRuntimeImageEnv = "GOOSEFS_RUNTIME_IMAGE_ENV"

	GooseFSFuseImageEnv = "GOOSEFS_FUSE_IMAGE_ENV"

	DefaultGooseFSRuntimeImage = "ccr.ccs.tencentyun.com/goosefs/goosefs:v1.0.1"

	DefaultGooseFSFuseImage = "ccr.ccs.tencentyun.com/goosefs/goosefs-fuse:v1.0.1"
)

Runtime for Alluxio

View Source
const (
	JINDO_RUNTIME = "jindo"

	JINDO_MOUNT_TYPE = "fuse.jindofs-fuse"

	JINDO_SMARTDATA_IMAGE_ENV = "JINDO_SMARTDATA_IMAGE_ENV"

	JINDO_FUSE_IMAGE_ENV = "JINDO_FUSE_IMAGE_ENV"

	DEFAULT_JINDO_RUNTIME_IMAGE = "registry.cn-shanghai.aliyuncs.com/jindofs/smartdata:3.6.0"
)

Runtime for Alluxio

View Source
const (
	// LabelAnnotationPrefix is the prefix of every labels and annotations added by the controller.
	LabelAnnotationPrefix = "fluid.io/"
	// The format is fluid.io/s-{runtime_type}-{data_set_name}, s means storage
	LabelAnnotationStorageCapacityPrefix = LabelAnnotationPrefix + "s-"
	// The dataset annotation
	LabelAnnotationDataset = LabelAnnotationPrefix + "dataset"
	// LabelAnnotationDatasetNum indicates the number of the dataset in specific node
	LabelAnnotationDatasetNum = LabelAnnotationPrefix + "dataset-num"

	// fluid adminssion webhook inject flag
	EnableFluidInjectionFlag = LabelAnnotationPrefix + "enable-injection"
)
View Source
const (
	FLUID_FUSE_BALLOON_KEY   = "fluid_fuse_balloon"
	FLUID_FUSE_BALLOON_VALUE = "true"
)
View Source
const (
	FLUID_PATH = "fluid_path"

	Mount_TYPE = "mount_type"

	CSI_DRIVER = "fuse.csi.fluid.io"
)
View Source
const (
	WebhookName            = "fluid-pod-admission-webhook"
	WebhookServiceName     = "fluid-pod-admission-webhook"
	WebhookSchedulePodPath = "mutate-fluid-io-v1alpha1-schedulepod"

	// this file comes from tools/certificate.sh
	CertificationGenerateFile = "/usr/local/bin/certificate.sh"
)
View Source
const (
	FluidExclusiveKey string = "fluid_exclusive"
)
View Source
const RecommendedKubeConfigPathEnv = "KUBECONFIG"

Variables

View Source
var (
	// alluxio ufs root path
	AlluxioMountPathFormat = RootDirPath + "%s"

	AlluxioLocalStorageRootPath   = "/underFSStorage"
	AlluxioLocalStoragePathFormat = AlluxioLocalStorageRootPath + "/%s"
)
View Source
var (
	// goosefs ufs root path
	GooseFSMountPathFormat = RootDirPath + "%s"

	GooseFSLocalStorageRootPath   = "/underFSStorage"
	GooseFSLocalStoragePathFormat = GooseFSLocalStorageRootPath + "/%s"
)
View Source
var (
	ExpectedFluidAnnotations = map[string]string{
		"CreatedBy": "fluid",
	}
)
View Source
var (
	FLUID_STORAGECLASS = "fluid"
)

Functions

func CheckExpectValue added in v0.6.0

func CheckExpectValue(m map[string]string, key string, targetValue string) bool

Check if the key has the expected value

func GetDatasetNumLabelName added in v0.6.0

func GetDatasetNumLabelName() string

func GetDefaultTieredStoreOrder

func GetDefaultTieredStoreOrder(MediumType MediumType) (order int)

GetDefaultTieredStoreOrder get the TieredStoreOrder from the default Map because the crd has validated the value, It's not possible to meet unknown MediumType

func IsFluidNativeScheme added in v0.6.0

func IsFluidNativeScheme(s string) bool

func IsFluidWebScheme added in v0.6.0

func IsFluidWebScheme(s string) bool

Types

type AdmissionHandler added in v0.6.0

type AdmissionHandler interface {
	admission.Handler

	Setup(client client.Client)
}

AdmissionHandler wrappers admission.Handler, but adding client-go capablities

type CacheStateList

type CacheStateList map[CacheStateName]string

ResourceList is a set of (resource name, quantity) pairs.

type CacheStateName

type CacheStateName string

CacheStateName is the name identifying various cacheStateName in a CacheStateNameList.

const (
	// Cached in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	Cached CacheStateName = "cached"
	// Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	// Cacheable CacheStateName = "cacheable"
	LowWaterMark CacheStateName = "lowWaterMark"
	// Memory, in bytes. (500Gi = 500GiB = 500 * 1024 * 1024 * 1024)
	HighWaterMark CacheStateName = "highWaterMark"
	// NonCacheable size, in bytes (e,g. 5Gi = 5GiB = 5 * 1024 * 1024 * 1024)
	NonCacheable CacheStateName = "nonCacheable"
	// Percentage represents the cache percentage over the total data in the underlayer filesystem.
	// 1.5 = 1500m
	CachedPercentage CacheStateName = "cachedPercentage"

	CacheCapacity CacheStateName = "cacheCapacity"

	// CacheHitRatio defines total cache hit ratio(both local hit and remote hit), it is a metric to learn
	// how much profit a distributed cache brings.
	CacheHitRatio CacheStateName = "cacheHitRatio"

	// LocalHitRatio defines local hit ratio. It represents how many data is requested from local cache worker
	LocalHitRatio CacheStateName = "localHitRatio"

	// RemoteHitRatio defines remote hit ratio. It represents how many data is requested from remote cache worker(s).
	RemoteHitRatio CacheStateName = "remoteHitRatio"

	// CacheThroughputRatio defines total cache hit throughput ratio, both local hit and remote hit are included.
	CacheThroughputRatio CacheStateName = "cacheThroughputRatio"

	// LocalThroughputRatio defines local cache hit throughput ratio.
	LocalThroughputRatio CacheStateName = "localThroughputRatio"

	// RemoteThroughputRatio defines remote cache hit throughput ratio.
	RemoteThroughputRatio CacheStateName = "remoteThroughputRatio"
)

CacheStateName names must be not more than 63 characters, consisting of upper- or lower-case alphanumeric characters, with the -, _, and . characters allowed anywhere, except the first or last character. The default convention, matching that for annotations, is to use lower-case names, with dashes, rather than camel case, separating compound words. Fully-qualified resource typenames are constructed from a DNS-style subdomain, followed by a slash `/` and a name.

type CacheStoreType

type CacheStoreType string
const (
	DiskCacheStore CacheStoreType = "Disk"

	MemoryCacheStore CacheStoreType = "Memory"
)

type Category

type Category string
const (
	AccelerateCategory Category = "Accelerate"
)

type ConditionType added in v0.6.0

type ConditionType string

ConditionType is a valid value for Condition.Type

const (
	// Complete means the task has completed its execution.
	Complete ConditionType = "Complete"
	// Failed means the task has failed its execution.
	Failed ConditionType = "Failed"
)

These are valid conditions of a Task

type FluidUFSScheme added in v0.6.0

type FluidUFSScheme string
const (
	// native
	PathScheme   FluidUFSScheme = "local://"
	VolumeScheme FluidUFSScheme = "pvc://"
	// web
	HttpScheme  FluidUFSScheme = "http://"
	HttpsScheme FluidUFSScheme = "https://"
)

func (FluidUFSScheme) String added in v0.6.0

func (fns FluidUFSScheme) String() string

type ImageInfo added in v0.6.0

type ImageInfo struct {
	// Image of a Container
	Image string `yaml:"image"`
	// ImageTag of a Container
	ImageTag string `yaml:"imageTag"`
	// ImagePullPolicy is one of the three policies: `Always`,  `IfNotPresent`, `Never`
	ImagePullPolicy string `yaml:"imagePullPolicy"`
}

ImageInfo to run a Container

type InitUsers added in v0.6.0

type InitUsers struct {
	ImageInfo      `yaml:",inline"`
	EnvUsers       string `yaml:"envUsers"`
	Dir            string `yaml:"dir"`
	Enabled        bool   `yaml:"enabled,omitempty"`
	EnvTieredPaths string `yaml:"envTieredPaths"`
}

The InitContainer to init the users for other Containers

type LabelToModify added in v0.6.0

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

LabelToModify modifies the labelKey in operationType.

func (*LabelToModify) GetLabelKey added in v0.6.0

func (labelToModify *LabelToModify) GetLabelKey() string

func (*LabelToModify) GetLabelValue added in v0.6.0

func (labelToModify *LabelToModify) GetLabelValue() string

func (*LabelToModify) GetOperationType added in v0.6.0

func (labelToModify *LabelToModify) GetOperationType() OperationType

type LabelsToModify added in v0.6.0

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

func (*LabelsToModify) Add added in v0.6.0

func (labels *LabelsToModify) Add(labelKey string, labelValue string)

func (*LabelsToModify) Delete added in v0.6.0

func (labels *LabelsToModify) Delete(labelKey string)

func (*LabelsToModify) GetLabels added in v0.6.0

func (labels *LabelsToModify) GetLabels() []LabelToModify

func (*LabelsToModify) Update added in v0.6.0

func (labels *LabelsToModify) Update(labelKey string, labelValue string)

type MediumType

type MediumType string
const (
	Memory MediumType = "MEM"

	SSD MediumType = "SSD"

	HDD MediumType = "HDD"
)

type OperationType added in v0.6.0

type OperationType string
const (
	// AddLabel means adding a new label on the specific node.
	AddLabel OperationType = "Add"

	// DeleteLabel means deleting the label of the specific node.
	DeleteLabel OperationType = "Delete"

	// UpdateLabel means updating the label value of the specific node.
	UpdateLabel OperationType = "UpdateValue"
)

type Phase added in v0.6.0

type Phase string

Phase is a valid value of a task stage

const (
	PhaseNone      Phase = ""
	PhasePending   Phase = "Pending"
	PhaseExecuting Phase = "Executing"
	PhaseComplete  Phase = "Complete"
	PhaseFailed    Phase = "Failed"
)

These are possible phases of a Task

type ReadType added in v0.5.0

type ReadType string
const (
	HumanReadType ReadType = "h-"
)

type ResourceList

type ResourceList map[corev1.ResourceName]string

type Resources

type Resources struct {
	Requests ResourceList `yaml:"requests,omitempty"`
	Limits   ResourceList `yaml:"limits,omitempty"`
}

type RuntimeRole

type RuntimeRole string

type StorageType added in v0.5.0

type StorageType string
const (
	MemoryStorageType StorageType = "m-"

	DiskStorageType StorageType = "d-"

	TotalStorageType StorageType = "t-"
)

type UserInfo added in v0.6.0

type UserInfo struct {
	User    int `yaml:"user"`
	Group   int `yaml:"group"`
	FSGroup int `yaml:"fsGroup"`
}

UserInfo to run a Container

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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