Documentation ¶
Overview ¶
Handles translating gRPC request & response objects to and from repository model objects
Index ¶
- Constants
- Variables
- func CreateDescriptionEntityModel(descriptionEntity *admin.DescriptionEntity, id core.Identifier) (*models.DescriptionEntity, error)
- func CreateExecutionEventModel(request admin.WorkflowExecutionEventRequest) (*models.ExecutionEvent, error)
- func CreateExecutionModel(input CreateExecutionModelInput) (*models.Execution, error)
- func CreateExecutionTagModel(input CreateExecutionModelInput) ([]*models.ExecutionTag, error)
- func CreateLaunchPlan(request admin.LaunchPlanCreateRequest, expectedOutputs *core.VariableMap) admin.LaunchPlan
- func CreateLaunchPlanModel(launchPlan admin.LaunchPlan, workflowRepoID uint, digest []byte, ...) (models.LaunchPlan, error)
- func CreateNamedEntityModel(request *admin.NamedEntityUpdateRequest) models.NamedEntity
- func CreateNodeExecutionEventModel(request admin.NodeExecutionEventRequest) (*models.NodeExecutionEvent, error)
- func CreateNodeExecutionModel(ctx context.Context, input ToNodeExecutionModelInput) (*models.NodeExecution, error)
- func CreateProjectModel(project *admin.Project) models.Project
- func CreateSignalModel(signalID *core.SignalIdentifier, signalType *core.LiteralType, ...) (models.Signal, error)
- func CreateTaskExecutionModel(ctx context.Context, input CreateTaskExecutionModelInput) (*models.TaskExecution, error)
- func CreateTaskModel(request admin.TaskCreateRequest, taskClosure admin.TaskClosure, digest []byte) (models.Task, error)
- func CreateWorkflowModel(request admin.WorkflowCreateRequest, remoteClosureIdentifier string, ...) (models.Workflow, error)
- func FromDescriptionEntityModel(descriptionEntityModel models.DescriptionEntity) (*admin.DescriptionEntity, error)
- func FromDescriptionEntityModels(descriptionEntityModels []models.DescriptionEntity) ([]*admin.DescriptionEntity, error)
- func FromExecutionModel(ctx context.Context, executionModel models.Execution, ...) (*admin.Execution, error)
- func FromExecutionModels(ctx context.Context, executionModels []models.Execution, ...) ([]*admin.Execution, error)
- func FromLaunchPlanModel(model models.LaunchPlan) (*admin.LaunchPlan, error)
- func FromLaunchPlanModels(launchPlanModels []models.LaunchPlan) ([]*admin.LaunchPlan, error)
- func FromLaunchPlanModelsToIdentifiers(launchPlanModels []models.LaunchPlan) []*admin.NamedEntityIdentifier
- func FromNamedEntityMetadataFields(metadata models.NamedEntityMetadataFields) admin.NamedEntityMetadata
- func FromNamedEntityModel(model models.NamedEntity) admin.NamedEntity
- func FromNamedEntityModels(models []models.NamedEntity) []*admin.NamedEntity
- func FromNodeExecutionModel(nodeExecutionModel models.NodeExecution, opts *ExecutionTransformerOptions) (*admin.NodeExecution, error)
- func FromProjectModel(projectModel models.Project, domains []*admin.Domain) admin.Project
- func FromProjectModels(projectModels []models.Project, domains []*admin.Domain) []*admin.Project
- func FromResourceModelToMatchableAttributes(model models.Resource) (admin.MatchableAttributesConfiguration, error)
- func FromResourceModelToProjectDomainAttributes(model models.Resource) (admin.ProjectDomainAttributes, error)
- func FromResourceModelToWorkflowAttributes(model models.Resource) (admin.WorkflowAttributes, error)
- func FromResourceModelsToMatchableAttributes(models []models.Resource) ([]*admin.MatchableAttributesConfiguration, error)
- func FromSignalModel(signalModel models.Signal) (admin.Signal, error)
- func FromSignalModels(signalModels []models.Signal) ([]*admin.Signal, error)
- func FromTaskExecutionModel(taskExecutionModel models.TaskExecution, opts *ExecutionTransformerOptions) (*admin.TaskExecution, error)
- func FromTaskExecutionModels(taskExecutionModels []models.TaskExecution, opts *ExecutionTransformerOptions) ([]*admin.TaskExecution, error)
- func FromTaskModel(taskModel models.Task) (admin.Task, error)
- func FromTaskModels(taskModels []models.Task) ([]*admin.Task, error)
- func FromTaskModelsToIdentifiers(taskModels []models.Task) []*admin.NamedEntityIdentifier
- func FromWorkflowModel(workflowModel models.Workflow) (admin.Workflow, error)
- func FromWorkflowModels(workflowModels []models.Workflow) ([]*admin.Workflow, error)
- func FromWorkflowModelsToIdentifiers(workflowModels []models.Workflow) []*admin.NamedEntityIdentifier
- func GetExecutionIdentifier(executionModel *models.Execution) core.WorkflowExecutionIdentifier
- func GetNodeExecutionInternalData(internalData []byte) (*genModel.NodeExecutionInternalData, error)
- func MergeUpdatePluginAttributes(ctx context.Context, model models.Resource, resource admin.MatchableResource, ...) (models.Resource, error)
- func MergeUpdateWorkflowAttributes(ctx context.Context, model models.Resource, resource admin.MatchableResource, ...) (models.Resource, error)
- func PopulateDefaultStateChangeDetails(executionModel models.Execution) (*admin.ExecutionStateChangeDetails, error)
- func ProjectAttributesToResourceModel(attributes admin.ProjectAttributes, resource admin.MatchableResource) (models.Resource, error)
- func ProjectDomainAttributesToResourceModel(attributes admin.ProjectDomainAttributes, resource admin.MatchableResource) (models.Resource, error)
- func SetExecutionAborting(execution *models.Execution, cause, principal string) error
- func TrimErrorMessage(errMsg string) string
- func UpdateExecutionModelState(ctx context.Context, execution *models.Execution, ...) error
- func UpdateExecutionModelStateChangeDetails(executionModel *models.Execution, stateUpdatedTo admin.ExecutionState, ...) error
- func UpdateNodeExecutionModel(ctx context.Context, request *admin.NodeExecutionEventRequest, ...) error
- func UpdateTaskExecutionModel(ctx context.Context, request *admin.TaskExecutionEventRequest, ...) error
- func WorkflowAttributesToResourceModel(attributes admin.WorkflowAttributes, resource admin.MatchableResource) (models.Resource, error)
- type CreateExecutionModelInput
- type CreateProjectModelInput
- type CreateTaskExecutionModelInput
- type ExecutionTransformerOptions
- type ToNodeExecutionModelInput
Constants ¶
const InputsObjectSuffix = "offloaded_inputs"
InputsObjectSuffix is used when execution event data includes inline events and admin offloads the data.
const OutputsObjectSuffix = "offloaded_outputs"
OutputsObjectSuffix is used when execution event data includes inline outputs but the admin deployment is configured to offload such data. The generated file path for the offloaded data will include the execution identifier and this suffix.
Variables ¶
var DefaultExecutionTransformerOptions = &ExecutionTransformerOptions{}
var ListExecutionTransformerOptions = &ExecutionTransformerOptions{ TrimErrorMessage: true, }
Functions ¶
func CreateDescriptionEntityModel ¶
func CreateDescriptionEntityModel( descriptionEntity *admin.DescriptionEntity, id core.Identifier) (*models.DescriptionEntity, error)
CreateDescriptionEntityModel Transforms a TaskCreateRequest to a Description entity model
func CreateExecutionEventModel ¶
func CreateExecutionEventModel(request admin.WorkflowExecutionEventRequest) (*models.ExecutionEvent, error)
Transforms a ExecutionEventCreateRequest to a ExecutionEvent model
func CreateExecutionModel ¶
func CreateExecutionModel(input CreateExecutionModelInput) (*models.Execution, error)
CreateExecutionModel transforms a ExecutionCreateRequest to a Execution model
func CreateExecutionTagModel ¶ added in v1.13.0
func CreateExecutionTagModel(input CreateExecutionModelInput) ([]*models.ExecutionTag, error)
CreateExecutionTagModel transforms a CreateExecutionModelInput to a ExecutionTag model
func CreateLaunchPlan ¶
func CreateLaunchPlan( request admin.LaunchPlanCreateRequest, expectedOutputs *core.VariableMap) admin.LaunchPlan
func CreateLaunchPlanModel ¶
func CreateLaunchPlanModel( launchPlan admin.LaunchPlan, workflowRepoID uint, digest []byte, initState admin.LaunchPlanState) (models.LaunchPlan, error)
Transforms a admin.LaunchPlan object to a LaunchPlan model
func CreateNamedEntityModel ¶
func CreateNamedEntityModel(request *admin.NamedEntityUpdateRequest) models.NamedEntity
func CreateNodeExecutionEventModel ¶
func CreateNodeExecutionEventModel(request admin.NodeExecutionEventRequest) (*models.NodeExecutionEvent, error)
Transforms a NodeExecutionEventRequest to a NodeExecutionEvent model
func CreateNodeExecutionModel ¶
func CreateNodeExecutionModel(ctx context.Context, input ToNodeExecutionModelInput) (*models.NodeExecution, error)
func CreateSignalModel ¶
func CreateSignalModel(signalID *core.SignalIdentifier, signalType *core.LiteralType, signalValue *core.Literal) (models.Signal, error)
func CreateTaskExecutionModel ¶
func CreateTaskExecutionModel(ctx context.Context, input CreateTaskExecutionModelInput) (*models.TaskExecution, error)
func CreateTaskModel ¶
func CreateTaskModel( request admin.TaskCreateRequest, taskClosure admin.TaskClosure, digest []byte) (models.Task, error)
Transforms a TaskCreateRequest to a task model
func CreateWorkflowModel ¶
func CreateWorkflowModel(request admin.WorkflowCreateRequest, remoteClosureIdentifier string, digest []byte) (models.Workflow, error)
Transforms a WorkflowCreateRequest to a workflow model
func FromDescriptionEntityModel ¶
func FromDescriptionEntityModel(descriptionEntityModel models.DescriptionEntity) (*admin.DescriptionEntity, error)
func FromDescriptionEntityModels ¶
func FromDescriptionEntityModels(descriptionEntityModels []models.DescriptionEntity) ([]*admin.DescriptionEntity, error)
func FromExecutionModel ¶
func FromExecutionModels ¶
func FromLaunchPlanModel ¶
func FromLaunchPlanModel(model models.LaunchPlan) (*admin.LaunchPlan, error)
Transforms a LaunchPlanModel to a LaunchPlan
func FromLaunchPlanModels ¶
func FromLaunchPlanModels(launchPlanModels []models.LaunchPlan) ([]*admin.LaunchPlan, error)
func FromLaunchPlanModelsToIdentifiers ¶
func FromLaunchPlanModelsToIdentifiers(launchPlanModels []models.LaunchPlan) []*admin.NamedEntityIdentifier
func FromNamedEntityMetadataFields ¶
func FromNamedEntityMetadataFields(metadata models.NamedEntityMetadataFields) admin.NamedEntityMetadata
func FromNamedEntityModel ¶
func FromNamedEntityModel(model models.NamedEntity) admin.NamedEntity
func FromNamedEntityModels ¶
func FromNamedEntityModels(models []models.NamedEntity) []*admin.NamedEntity
func FromNodeExecutionModel ¶
func FromNodeExecutionModel(nodeExecutionModel models.NodeExecution, opts *ExecutionTransformerOptions) (*admin.NodeExecution, error)
func FromProjectModel ¶
func FromProjectModels ¶
func FromResourceModelToMatchableAttributes ¶
func FromResourceModelToMatchableAttributes(model models.Resource) (admin.MatchableAttributesConfiguration, error)
func FromResourceModelToProjectDomainAttributes ¶
func FromResourceModelToProjectDomainAttributes(model models.Resource) (admin.ProjectDomainAttributes, error)
func FromResourceModelToWorkflowAttributes ¶
func FromResourceModelToWorkflowAttributes(model models.Resource) (admin.WorkflowAttributes, error)
func FromResourceModelsToMatchableAttributes ¶
func FromResourceModelsToMatchableAttributes(models []models.Resource) ( []*admin.MatchableAttributesConfiguration, error)
func FromSignalModels ¶
func FromTaskExecutionModel ¶
func FromTaskExecutionModel(taskExecutionModel models.TaskExecution, opts *ExecutionTransformerOptions) (*admin.TaskExecution, error)
func FromTaskExecutionModels ¶
func FromTaskExecutionModels(taskExecutionModels []models.TaskExecution, opts *ExecutionTransformerOptions) ([]*admin.TaskExecution, error)
func FromTaskModelsToIdentifiers ¶
func FromTaskModelsToIdentifiers(taskModels []models.Task) []*admin.NamedEntityIdentifier
func FromWorkflowModel ¶
func FromWorkflowModels ¶
func FromWorkflowModelsToIdentifiers ¶
func FromWorkflowModelsToIdentifiers(workflowModels []models.Workflow) []*admin.NamedEntityIdentifier
func GetExecutionIdentifier ¶
func GetExecutionIdentifier(executionModel *models.Execution) core.WorkflowExecutionIdentifier
func GetNodeExecutionInternalData ¶
func GetNodeExecutionInternalData(internalData []byte) (*genModel.NodeExecutionInternalData, error)
func MergeUpdatePluginAttributes ¶
func MergeUpdatePluginAttributes(ctx context.Context, model models.Resource, resource admin.MatchableResource, resourceID *repoInterfaces.ResourceID, matchingAttributes *admin.MatchingAttributes) (models.Resource, error)
MergeUpdatePluginAttributes only handles plugin overrides. Other attributes are just overridden when an update happens.
func MergeUpdateWorkflowAttributes ¶
func MergeUpdateWorkflowAttributes(ctx context.Context, model models.Resource, resource admin.MatchableResource, resourceID *repoInterfaces.ResourceID, workflowAttributes *admin.WorkflowAttributes) (models.Resource, error)
func PopulateDefaultStateChangeDetails ¶
func PopulateDefaultStateChangeDetails(executionModel models.Execution) (*admin.ExecutionStateChangeDetails, error)
PopulateDefaultStateChangeDetails used to populate execution state change details for older executions which do not have these details captured. Hence we construct a default state change details from existing data model.
func ProjectAttributesToResourceModel ¶
func ProjectAttributesToResourceModel(attributes admin.ProjectAttributes, resource admin.MatchableResource) (models.Resource, error)
func ProjectDomainAttributesToResourceModel ¶
func ProjectDomainAttributesToResourceModel(attributes admin.ProjectDomainAttributes, resource admin.MatchableResource) (models.Resource, error)
func SetExecutionAborting ¶
The execution abort metadata is recorded but the phase is not actually updated *until* the abort event is propagated by flytepropeller. The metadata is preemptively saved at the time of the abort.
func TrimErrorMessage ¶
TrimErrorMessage return the smallest possible trimmed error message >= trimmedErrMessageLen bytes in length that still forms a valid utf-8 string
func UpdateExecutionModelState ¶
func UpdateExecutionModelState( ctx context.Context, execution *models.Execution, request admin.WorkflowExecutionEventRequest, inlineEventDataPolicy interfaces.InlineEventDataPolicy, storageClient *storage.DataStore) error
Updates an existing model given a WorkflowExecution event.
func UpdateExecutionModelStateChangeDetails ¶
func UpdateExecutionModelStateChangeDetails(executionModel *models.Execution, stateUpdatedTo admin.ExecutionState, stateUpdatedAt time.Time, stateUpdatedBy string) error
UpdateExecutionModelStateChangeDetails Updates an existing model with stateUpdateTo, stateUpdateBy and statedUpdatedAt details from the request
func UpdateNodeExecutionModel ¶
func UpdateNodeExecutionModel( ctx context.Context, request *admin.NodeExecutionEventRequest, nodeExecutionModel *models.NodeExecution, targetExecution *core.WorkflowExecutionIdentifier, dynamicWorkflowRemoteClosure string, inlineEventDataPolicy interfaces.InlineEventDataPolicy, storageClient *storage.DataStore) error
func UpdateTaskExecutionModel ¶
func UpdateTaskExecutionModel(ctx context.Context, request *admin.TaskExecutionEventRequest, taskExecutionModel *models.TaskExecution, inlineEventDataPolicy interfaces.InlineEventDataPolicy, storageClient *storage.DataStore) error
func WorkflowAttributesToResourceModel ¶
func WorkflowAttributesToResourceModel(attributes admin.WorkflowAttributes, resource admin.MatchableResource) (models.Resource, error)
Types ¶
type CreateExecutionModelInput ¶
type CreateExecutionModelInput struct { WorkflowExecutionID core.WorkflowExecutionIdentifier RequestSpec *admin.ExecutionSpec LaunchPlanID uint WorkflowID uint TaskID uint CreatedAt time.Time Notifications []*admin.Notification WorkflowIdentifier *core.Identifier ParentNodeExecutionID uint SourceExecutionID uint Cluster string InputsURI storage.DataReference UserInputsURI storage.DataReference SecurityContext *core.SecurityContext LaunchEntity core.ResourceType Namespace string Error error }
CreateExecutionModelInput encapsulates request parameters for calls to CreateExecutionModel.
type CreateProjectModelInput ¶
type CreateTaskExecutionModelInput ¶
type CreateTaskExecutionModelInput struct { Request *admin.TaskExecutionEventRequest InlineEventDataPolicy interfaces.InlineEventDataPolicy StorageClient *storage.DataStore }
type ToNodeExecutionModelInput ¶
type ToNodeExecutionModelInput struct { Request *admin.NodeExecutionEventRequest ParentTaskExecutionID *uint ParentID *uint DynamicWorkflowRemoteClosure string InlineEventDataPolicy interfaces.InlineEventDataPolicy StorageClient *storage.DataStore }