utils

package
v0.12.4 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

View Source
const ErrorCodeSystem = "system"
View Source
const ErrorCodeUnknown = "Unknown"
View Source
const ErrorCodeUser = "User"
View Source
const ResourceNvidiaGPU = "nvidia.com/gpu"

ResourceNvidiaGPU is the name of the Nvidia GPU resource.

Variables

View Source
var Base32Encoder = base32.NewEncoding(specialEncoderKey).WithPadding(base32.NoPadding)
View Source
var NotTheOwnerError = errors.Errorf("FlytePropeller is not the owner")

Functions

func CopyMap

func CopyMap(o map[string]string) (r map[string]string)

func FixedLengthUniqueID

func FixedLengthUniqueID(inputID string, maxLength int) (string, error)

Creates a new UniqueID that is based on the inputID and of a specified length, if the given id is longer than the maxLength.

func FixedLengthUniqueIDForParts

func FixedLengthUniqueIDForParts(maxLength int, parts ...string) (string, error)

Creates a new uniqueID using the parts concatenated using `-` and ensures that the uniqueID is not longer than the maxLength. In case a simple concatenation yields a longer string, a new hashed ID is created which is always around 8 characters in length

func GetProtoTime

func GetProtoTime(t *metav1.Time) *timestamp.Timestamp

func GetSanitizedPrometheusKey added in v0.7.0

func GetSanitizedPrometheusKey(key string) (string, error)

func GetWorkflowIDFromOwner

func GetWorkflowIDFromOwner(reference *metav1.OwnerReference, namespace string) (v1alpha1.WorkflowID, error)

func MakeBinding

func MakeBinding(variable string, b *core.BindingData) *core.Binding

func MakeBindingDataCollection

func MakeBindingDataCollection(bindings ...*core.BindingData) *core.BindingData

func MakeBindingDataMap

func MakeBindingDataMap(pairs ...Pair) *core.BindingData

func MakeBindingDataPromise

func MakeBindingDataPromise(fromNode, fromVar string) *core.BindingData

func MakeBindingPromise

func MakeBindingPromise(fromNode, fromVar, toVar string) *core.Binding

func MakePrimitiveBindingData

func MakePrimitiveBindingData(v interface{}) (*core.BindingData, error)

func MustMakePrimitiveBindingData

func MustMakePrimitiveBindingData(v interface{}) *core.BindingData

func SanitizeLabelValue added in v0.1.16

func SanitizeLabelValue(name string) string

SanitizeLabelValue ensures that the label value is a valid DNS-1123 string

func ToK8sEnvVar

func ToK8sEnvVar(env []*core.KeyValuePair) []v1.EnvVar

func ToK8sResourceList

func ToK8sResourceList(resources []*core.Resources_ResourceEntry) (v1.ResourceList, error)

TODO we should modify the container resources to contain a map of enum values? Also we should probably create tolerations / taints, but we could do that as a post process

func ToK8sResourceRequirements

func ToK8sResourceRequirements(resources *core.Resources) (*v1.ResourceRequirements, error)

Types

type FailingRawStore

type FailingRawStore struct {
}

func (FailingRawStore) CopyRaw

func (FailingRawStore) CopyRaw(ctx context.Context, source, destination storage.DataReference, opts storage.Options) error

func (FailingRawStore) GetBaseContainerFQN

func (FailingRawStore) GetBaseContainerFQN(ctx context.Context) storage.DataReference

func (FailingRawStore) Head

func (FailingRawStore) ReadRaw

func (FailingRawStore) WriteRaw

func (FailingRawStore) WriteRaw(ctx context.Context, reference storage.DataReference, size int64, opts storage.Options, raw io.Reader) error

type Pair

type Pair struct {
	K string
	V *core.BindingData
}

func NewPair

func NewPair(k string, v *core.BindingData) Pair

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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