utils

package
v0.2.27 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const ResourceNvidiaGPU = "nvidia.com/gpu"

ResourceNvidiaGPU is the name of the Nvidia GPU resource.

Variables

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 GetWorkflowIDFromObject

func GetWorkflowIDFromObject(obj metav1.Object) (v1alpha1.WorkflowID, error)

func GetWorkflowIDFromOwner

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

func MakeBinaryLiteral

func MakeBinaryLiteral(v []byte) *core.Literal

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 MakeDefaultLiteralForType

func MakeDefaultLiteralForType(typ *core.LiteralType) (*core.Literal, error)

func MakeLiteral

func MakeLiteral(v interface{}) (*core.Literal, error)

func MakeLiteralForCollection

func MakeLiteralForCollection(v []interface{}) (*core.Literal, error)

func MakeLiteralForMap

func MakeLiteralForMap(v map[string]interface{}) (*core.Literal, error)

func MakeLiteralMap

func MakeLiteralMap(v map[string]interface{}) (*core.LiteralMap, error)

func MakePrimitive

func MakePrimitive(v interface{}) (*core.Primitive, error)

func MakePrimitiveBindingData

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

func MakePrimitiveLiteral

func MakePrimitiveLiteral(v interface{}) (*core.Literal, error)

func MustMakeDefaultLiteralForType

func MustMakeDefaultLiteralForType(typ *core.LiteralType) *core.Literal

func MustMakeLiteral

func MustMakeLiteral(v interface{}) *core.Literal

func MustMakePrimitive

func MustMakePrimitive(v interface{}) *core.Primitive

func MustMakePrimitiveBindingData

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

func MustMakePrimitiveLiteral

func MustMakePrimitiveLiteral(v interface{}) *core.Literal

func NewPluginTaskEventRecorder

func NewPluginTaskEventRecorder(taskEventRecorder events.TaskEventRecorder) events.TaskEventRecorder

Construct task event recorder to pass down to plugin. This is a just a wrapper around the normal taskEventRecorder that can encapsulate logic to validate and handle errors.

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