Documentation
¶
Index ¶
- Constants
- func ArchiveTgz(files map[string]string) (string, error)
- func BoolNilOrValue(b *bool) string
- func BoolPointer(b bool) *bool
- func BooleanPointer(b bool) *bool
- func DateTimePointer(t strfmt.DateTime) *strfmt.DateTime
- func ExtractErrorForCLI(err error, isDebugMode bool) error
- func ExtractMasterIPAndPort(config *rest.Config) string
- func ExtractTgz(tgzContent string) (map[string]string, error)
- func FormatInt64ForLabel(epoch int64) string
- func FormatTimeForLogging(epoch int64) string
- func GetKubernetesClientFromClientConfig(clientConfig clientcmd.ClientConfig) (*kubernetes.Clientset, *rest.Config, string, error)
- func GetParameters(template []byte) (string, error)
- func GetRpcConnection(address string) (*grpc.ClientConn, error)
- func HasCustomCode(err error, code CustomCode) bool
- func Int32Pointer(i int32) *int32
- func Int64NilOrValue(i *int64) string
- func Int64Pointer(i int64) *int64
- func IsNotFound(err error) bool
- func IsUserErrorCodeMatch(err error, code codes.Code) bool
- func LogError(err error)
- func MarshalJsonOrFail(v interface{}) []byte
- func MetaV1TimePointer(t metav1.Time) *metav1.Time
- func Metav1TimePointer(t metav1.Time) *metav1.Time
- func ParseTimeOrFatal(value string) time.Time
- func RetrieveInt64FromLabel(epoch string) (int64, error)
- func StringNilOrValue(s *string) string
- func StringPointer(s string) *string
- func TerminateIfError(err error)
- func TimePointer(t time.Time) *time.Time
- func ToAnyStringPointer(s *string) *workflowapi.AnyString
- func ToGRPCError(err error) error
- func ToInt64Pointer(t *metav1.Time) *int64
- func ToStringPointer(a *workflowapi.AnyString) *string
- func Truncate(s string, size float64) string
- func UInt32Pointer(i uint32) *uint32
- func UnmarshalJsonOrFail(data string, v interface{})
- func ValidateWorkflow(template []byte) (*v1alpha1.Workflow, error)
- func WaitForAPIAvailable(initializeTimeout time.Duration, basePath string, apiAddress string) error
- func Wrap(err error, message string) error
- func Wrapf(err error, format string, args ...interface{}) error
- type APICode
- type ClientParameters
- type CustomCode
- type CustomError
- type FakeTime
- type FakeUUIDGenerator
- type ParameterFormatter
- type RealTime
- type ScheduledWorkflow
- func (s *ScheduledWorkflow) ConditionSummary() string
- func (s *ScheduledWorkflow) CronOrEmpty() string
- func (s *ScheduledWorkflow) CronScheduleEndTimeInSecOrNull() *int64
- func (s *ScheduledWorkflow) CronScheduleStartTimeInSecOrNull() *int64
- func (s *ScheduledWorkflow) Get() *swfapi.ScheduledWorkflow
- func (s *ScheduledWorkflow) IntervalSecondOr0() int64
- func (s *ScheduledWorkflow) MaxConcurrencyOr0() int64
- func (s *ScheduledWorkflow) NoCatchupOrFalse() bool
- func (s *ScheduledWorkflow) ParametersAsString() (string, error)
- func (s *ScheduledWorkflow) PeriodicScheduleEndTimeInSecOrNull() *int64
- func (s *ScheduledWorkflow) PeriodicScheduleStartTimeInSecOrNull() *int64
- func (s *ScheduledWorkflow) ToStringForStore() string
- type TimeInterface
- type UUIDGenerator
- type UUIDGeneratorInterface
- type UserError
- func NewAlreadyExistError(messageFormat string, a ...interface{}) *UserError
- func NewBadRequestError(err error, externalFormat string, a ...interface{}) *UserError
- func NewInternalServerError(err error, internalMessageFormat string, a ...interface{}) *UserError
- func NewInvalidInputError(messageFormat string, a ...interface{}) *UserError
- func NewInvalidInputErrorWithDetails(err error, externalMessage string) *UserError
- func NewNotFoundError(err error, externalMessageFormat string, a ...interface{}) *UserError
- func NewPermissionDeniedError(err error, externalFormat string, a ...interface{}) *UserError
- func NewResourceNotFoundError(resourceType string, resourceName string) *UserError
- func NewResourcesNotFoundError(resourceTypesFormat string, resourceNames ...interface{}) *UserError
- func NewUnauthenticatedError(err error, externalFormat string, a ...interface{}) *UserError
- func NewUserError(err error, internalMessage string, externalMessage string) *UserError
- func NewUserErrorWithSingleMessage(err error, message string) *UserError
- type Workflow
- func (w *Workflow) Condition() string
- func (w *Workflow) FindObjectStoreArtifactKeyOrEmpty(nodeID string, artifactName string) string
- func (w *Workflow) FinishedAt() int64
- func (w *Workflow) Get() *workflowapi.Workflow
- func (w *Workflow) GetWorkflowParametersAsMap() map[string]string
- func (w *Workflow) GetWorkflowSpec() *Workflow
- func (w *Workflow) HasScheduledWorkflowAsParent() bool
- func (w *Workflow) IsInFinalState() bool
- func (w *Workflow) OverrideName(name string)
- func (w *Workflow) OverrideParameters(desiredParams map[string]string)
- func (w *Workflow) PersistedFinalState() bool
- func (w *Workflow) ReplaceUID(id string) error
- func (w *Workflow) ScheduledAtInSecOr0() int64
- func (w *Workflow) ScheduledWorkflowUUIDAsStringOrEmpty() string
- func (w *Workflow) SetAnnotations(key string, value string)
- func (w *Workflow) SetAnnotationsToAllTemplates(key string, value string)
- func (w *Workflow) SetCannonicalLabels(name string, nextScheduledEpoch int64, index int64)
- func (w *Workflow) SetLabels(key string, value string)
- func (w *Workflow) SetLabelsToAllTemplates(key string, value string)
- func (w *Workflow) SetOwnerReferences(schedule *swfapi.ScheduledWorkflow)
- func (w *Workflow) SetPodMetadataLabels(key string, value string)
- func (w *Workflow) SetServiceAccount(serviceAccount string)
- func (w *Workflow) ToStringForStore() string
- func (w *Workflow) VerifyParameters(desiredParams map[string]string) error
- type WorkflowFormatter
Constants ¶
const ( // LabelKeyScheduledWorkflowEnabled is a label on a ScheduledWorkflow. // It captures whether the ScheduledWorkflow is enabled. LabelKeyScheduledWorkflowEnabled = constants.FullName + "/enabled" // LabelKeyScheduledWorkflowStatus is a label on a ScheduledWorkflow. // It captures the status of the scheduled workflow. LabelKeyScheduledWorkflowStatus = constants.FullName + "/status" // The maximum byte sizes of the parameter column in package/pipeline DB. MaxParameterBytes = 10000 // LabelKeyWorkflowEpoch is a label on a Workflow. // It captures the epoch at which the workflow was scheduled. LabelKeyWorkflowEpoch = constants.FullName + "/workflowEpoch" // LabelKeyWorkflowIndex is a label on a Workflow. // It captures the index of creation the workflow by the ScheduledWorkflow. LabelKeyWorkflowIndex = constants.FullName + "/workflowIndex" // LabelKeyWorkflowIsOwnedByScheduledWorkflow is a label on a Workflow. // It captures whether the workflow is owned by a ScheduledWorkflow. LabelKeyWorkflowIsOwnedByScheduledWorkflow = constants.FullName + "/isOwnedByScheduledWorkflow" // LabelKeyWorkflowScheduledWorkflowName is a label on a Workflow. // It captures whether the name of the owning ScheduledWorkflow. LabelKeyWorkflowScheduledWorkflowName = constants.FullName + "/scheduledWorkflowName" LabelKeyWorkflowRunId = "pipeline/runid" LabelKeyWorkflowPersistedFinalState = "pipeline/persistedFinalState" // LabelKeyWorkflowEpoch is a Workflow annotation key. // It captures the the name of the Run. AnnotationKeyRunName = "pipelines.kubeflow.org/run_name" AnnotationKeyIstioSidecarInject = "sidecar.istio.io/inject" AnnotationValueIstioSidecarInjectEnabled = "true" AnnotationValueIstioSidecarInjectDisabled = "false" // LabelKeyCacheEnabled is a workflow label key. // It captures whether this step will be selected by cache service. // To disable/enable cache for a single run, this label needs to be added in every step under a run. LabelKeyCacheEnabled = "pipelines.kubeflow.org/cache_enabled" )
const (
API_CODE_NOT_FOUND = 404
)
const (
IndexExpression = "[[Index]]"
)
Variables ¶
This section is empty.
Functions ¶
func ArchiveTgz ¶
ArchiveTgz takes a map of files with name as key and content as value and tar and gzip it to a tgz content string. Nested files and directories are not supported.
func BoolNilOrValue ¶
func BoolPointer ¶
func BooleanPointer ¶
BooleanPointer converts a bool to a bool pointer.
func ExtractErrorForCLI ¶
func ExtractMasterIPAndPort ¶
func ExtractTgz ¶
ExtractTgz extracts a list of files from a tgz content. The output is a map with file name as key and content as value. Nested files and directories are not supported.
func FormatInt64ForLabel ¶
func FormatTimeForLogging ¶
FormatTimeForLogging formats an epoch for logging purposes.
func GetKubernetesClientFromClientConfig ¶
func GetKubernetesClientFromClientConfig(clientConfig clientcmd.ClientConfig) ( *kubernetes.Clientset, *rest.Config, string, error)
func GetParameters ¶
func GetRpcConnection ¶
func GetRpcConnection(address string) (*grpc.ClientConn, error)
func HasCustomCode ¶
func HasCustomCode(err error, code CustomCode) bool
func Int32Pointer ¶
func Int64NilOrValue ¶
func Int64Pointer ¶
func IsNotFound ¶
IsNotFound returns whether an error indicates that a resource was "not found".
func IsUserErrorCodeMatch ¶
IsUserErrorCodeMatch returns whether the error is a user error with specified code.
func MarshalJsonOrFail ¶
func MarshalJsonOrFail(v interface{}) []byte
func Metav1TimePointer ¶
Metav1TimePointer converts a metav1.Time to a pointer.
func ParseTimeOrFatal ¶
func RetrieveInt64FromLabel ¶
RetrieveInt64FromLabel converts a string label value into an epoch.
func StringNilOrValue ¶
func StringPointer ¶
func TerminateIfError ¶
func TerminateIfError(err error)
TerminateIfError Check if error is nil. Terminate if not.
func ToAnyStringPointer ¶
func ToAnyStringPointer(s *string) *workflowapi.AnyString
func ToGRPCError ¶
func ToInt64Pointer ¶
func ToStringPointer ¶
func ToStringPointer(a *workflowapi.AnyString) *string
func UInt32Pointer ¶
func UnmarshalJsonOrFail ¶
func UnmarshalJsonOrFail(data string, v interface{})
func WaitForAPIAvailable ¶
Types ¶
type ClientParameters ¶
type ClientParameters struct { // Use float64 instead of float32 here to use flag.Float64Var() directly QPS float64 Burst int }
ClientParameters contains parameters needed when creating a client
type CustomCode ¶
type CustomCode uint32
const ( CUSTOM_CODE_TRANSIENT CustomCode = 0 CUSTOM_CODE_PERMANENT CustomCode = 1 CUSTOM_CODE_NOT_FOUND CustomCode = 2 CUSTOM_CODE_GENERIC CustomCode = 3 )
type CustomError ¶
type CustomError struct {
// contains filtered or unexported fields
}
func NewCustomError ¶
func NewCustomError(err error, code CustomCode, format string, a ...interface{}) *CustomError
func NewCustomErrorf ¶
func NewCustomErrorf(code CustomCode, format string, a ...interface{}) *CustomError
func (*CustomError) Error ¶
func (e *CustomError) Error() string
type FakeUUIDGenerator ¶
type FakeUUIDGenerator struct {
// contains filtered or unexported fields
}
FakeUUIDGenerator is a fake implementation of the UUIDGeneratorInterface used for testing. It always generates the UUID and error provided during instantiation.
type ParameterFormatter ¶
type ParameterFormatter struct {
// contains filtered or unexported fields
}
ParameterFormatter is an object that substitutes specific strings in workflow parameters by information about the workflow execution (time at which the workflow was started, time at which the workflow was scheduled, etc.)
func NewRunParameterFormatter ¶
func NewRunParameterFormatter(runUUID string, runAt int64) *ParameterFormatter
NewRunParameterFormatter returns a new ParameterFormatter to substitute run macros.
func NewSWFParameterFormatter ¶
func NewSWFParameterFormatter(runUUID string, scheduledEpoch int64, nowEpoch int64, index int64) *ParameterFormatter
NewSWFParameterFormatter returns a new ParameterFormatter to substitute recurring run macros.
func (*ParameterFormatter) Format ¶
func (p *ParameterFormatter) Format(s string) string
Format substitutes special strings in the provided string.
func (*ParameterFormatter) FormatWorkflowParameters ¶
func (p *ParameterFormatter) FormatWorkflowParameters( parameters map[string]string) map[string]string
type ScheduledWorkflow ¶
type ScheduledWorkflow struct {
*swfapi.ScheduledWorkflow
}
ScheduledWorkflow is a type to help manipulate ScheduledWorkflow objects.
func NewScheduledWorkflow ¶
func NewScheduledWorkflow(swf *swfapi.ScheduledWorkflow) *ScheduledWorkflow
NewScheduledWorkflow creates an instance of ScheduledWorkflow.
func (*ScheduledWorkflow) ConditionSummary ¶
func (s *ScheduledWorkflow) ConditionSummary() string
func (*ScheduledWorkflow) CronOrEmpty ¶
func (s *ScheduledWorkflow) CronOrEmpty() string
func (*ScheduledWorkflow) CronScheduleEndTimeInSecOrNull ¶
func (s *ScheduledWorkflow) CronScheduleEndTimeInSecOrNull() *int64
func (*ScheduledWorkflow) CronScheduleStartTimeInSecOrNull ¶
func (s *ScheduledWorkflow) CronScheduleStartTimeInSecOrNull() *int64
func (*ScheduledWorkflow) Get ¶
func (s *ScheduledWorkflow) Get() *swfapi.ScheduledWorkflow
Get converts this object to a swfapi.ScheduledWorkflow.
func (*ScheduledWorkflow) IntervalSecondOr0 ¶
func (s *ScheduledWorkflow) IntervalSecondOr0() int64
func (*ScheduledWorkflow) MaxConcurrencyOr0 ¶
func (s *ScheduledWorkflow) MaxConcurrencyOr0() int64
func (*ScheduledWorkflow) NoCatchupOrFalse ¶
func (s *ScheduledWorkflow) NoCatchupOrFalse() bool
func (*ScheduledWorkflow) ParametersAsString ¶
func (s *ScheduledWorkflow) ParametersAsString() (string, error)
func (*ScheduledWorkflow) PeriodicScheduleEndTimeInSecOrNull ¶
func (s *ScheduledWorkflow) PeriodicScheduleEndTimeInSecOrNull() *int64
func (*ScheduledWorkflow) PeriodicScheduleStartTimeInSecOrNull ¶
func (s *ScheduledWorkflow) PeriodicScheduleStartTimeInSecOrNull() *int64
func (*ScheduledWorkflow) ToStringForStore ¶
func (s *ScheduledWorkflow) ToStringForStore() string
type TimeInterface ¶
func NewFakeTime ¶
func NewFakeTime(now time.Time) TimeInterface
func NewFakeTimeForEpoch ¶
func NewFakeTimeForEpoch() TimeInterface
func NewRealTime ¶
func NewRealTime() TimeInterface
type UUIDGenerator ¶
type UUIDGenerator struct { }
UUIDGenerator is the concrete implementation of the UUIDGeneratorInterface used to generate UUIDs in production deployments.
func NewUUIDGenerator ¶
func NewUUIDGenerator() *UUIDGenerator
type UUIDGeneratorInterface ¶
func NewFakeUUIDGeneratorOrFatal ¶
func NewFakeUUIDGeneratorOrFatal(uuidStringToReturn string, errToReturn error) UUIDGeneratorInterface
NewFakeUUIDGeneratorOrFatal creates a UUIDGenerator that always returns the UUID and error provided as parameters.
type UserError ¶
type UserError struct {
// contains filtered or unexported fields
}
func NewAlreadyExistError ¶
func NewBadRequestError ¶
func NewInternalServerError ¶
func NewInvalidInputError ¶
func NewNotFoundError ¶
func NewUnauthenticatedError ¶
func NewUserError ¶
func (*UserError) ExternalMessage ¶
func (*UserError) ExternalStatusCode ¶
type Workflow ¶
type Workflow struct {
*workflowapi.Workflow
}
Workflow is a type to help manipulate Workflow objects.
func NewWorkflow ¶
func NewWorkflow(workflow *workflowapi.Workflow) *Workflow
NewWorkflow creates a Workflow.
func (*Workflow) FindObjectStoreArtifactKeyOrEmpty ¶
FindObjectStoreArtifactKeyOrEmpty loops through all node running statuses and look up the first S3 artifact with the specified nodeID and artifactName. Returns empty if nothing is found.
func (*Workflow) FinishedAt ¶
func (*Workflow) Get ¶
func (w *Workflow) Get() *workflowapi.Workflow
Get converts this object to a workflowapi.Workflow.
func (*Workflow) GetWorkflowParametersAsMap ¶
func (*Workflow) GetWorkflowSpec ¶
func (*Workflow) HasScheduledWorkflowAsParent ¶
func (*Workflow) IsInFinalState ¶
IsInFinalState whether the workflow is in a final state.
func (*Workflow) OverrideName ¶
OverrideName sets the name of a Workflow.
func (*Workflow) OverrideParameters ¶
OverrideParameters overrides some of the parameters of a Workflow.
func (*Workflow) PersistedFinalState ¶
PersistedFinalState whether the workflow final state has being persisted.
func (*Workflow) ReplaceUID ¶
func (*Workflow) ScheduledAtInSecOr0 ¶
func (*Workflow) ScheduledWorkflowUUIDAsStringOrEmpty ¶
func (*Workflow) SetAnnotations ¶
func (*Workflow) SetAnnotationsToAllTemplates ¶
SetAnnotations sets annotations on all templates in a Workflow
func (*Workflow) SetCannonicalLabels ¶
func (*Workflow) SetLabelsToAllTemplates ¶
SetLabels sets labels on all templates in a Workflow
func (*Workflow) SetOwnerReferences ¶
func (w *Workflow) SetOwnerReferences(schedule *swfapi.ScheduledWorkflow)
SetOwnerReferences sets owner references on a Workflow.
func (*Workflow) SetPodMetadataLabels ¶
func (*Workflow) SetServiceAccount ¶
SetServiceAccount Set the service account to run the workflow.
func (*Workflow) ToStringForStore ¶
type WorkflowFormatter ¶
type WorkflowFormatter struct {
// contains filtered or unexported fields
}
func NewWorkflowFormatter ¶
func NewWorkflowFormatter(uuid UUIDGeneratorInterface, scheduledAtInSec int64, nowInSec int64) *WorkflowFormatter