util

package
v1.9.20 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Util around parsing request filters

Shared method implementations.

Index

Constants

View Source
const (
	OutputsFile = "outputs.pb"
	DeckFile    = "deck.html"
)

Variables

This section is empty.

Functions

func AddRequestFilters

func AddRequestFilters(requestFilters string, primaryEntity common.Entity, existingFilters []common.InlineFilter) (
	[]common.InlineFilter, error)

func CreateOrGetLaunchPlan

func CreateOrGetLaunchPlan(ctx context.Context,
	db repositoryInterfaces.Repository, config runtimeInterfaces.Configuration, taskIdentifier *core.Identifier,
	workflowInterface *core.TypedInterface, workflowID uint, spec *admin.ExecutionSpec) (*admin.LaunchPlan, error)

func CreateOrGetWorkflowModel

func CreateOrGetWorkflowModel(
	ctx context.Context, request admin.ExecutionCreateRequest, db repositoryInterfaces.Repository,
	workflowManager interfaces.WorkflowInterface, namedEntityManager interfaces.NamedEntityInterface, taskIdentifier *core.Identifier,
	task *admin.Task) (*models.Workflow, error)

func FetchAndGetWorkflowClosure

func FetchAndGetWorkflowClosure(ctx context.Context,
	store *storage.DataStore,
	remoteLocationIdentifier string) (*admin.WorkflowClosure, error)

func GetActiveLaunchPlanVersionFilters

func GetActiveLaunchPlanVersionFilters(project, domain, name string) ([]common.InlineFilter, error)

Returns the set of filters necessary to query launch plan models to find the active version of a launch plan

func GetCompleteTaskResourceRequirements

func GetCompleteTaskResourceRequirements(ctx context.Context, identifier *core.Identifier, task *core.CompiledTask) workflowengineInterfaces.TaskResources

GetCompleteTaskResourceRequirements parses the resource requests and limits from the `TaskTemplate` Container.

func GetDbFilters

func GetDbFilters(spec FilterSpec, primaryEntity common.Entity) ([]common.InlineFilter, error)

Consolidates request params and filters to a single list of filters. This consolidation is necessary since the db is agnostic to required request parameters and additional filter arguments.

func GetDescriptionEntity

func GetDescriptionEntity(
	ctx context.Context, repo repoInterfaces.Repository, identifier core.Identifier) (*admin.DescriptionEntity, error)

func GetDescriptionEntityModel

func GetDescriptionEntityModel(
	ctx context.Context, repo repoInterfaces.Repository, identifier core.Identifier) (models.DescriptionEntity, error)

func GetExecutionName

func GetExecutionName(request admin.ExecutionCreateRequest) string

func GetInputs

func GetInputs(ctx context.Context, urlData dataInterfaces.RemoteURLInterface,
	remoteDataConfig *runtimeInterfaces.RemoteDataConfig, storageClient *storage.DataStore, inputURI string) (
	*core.LiteralMap, *admin.UrlBlob, error)

GetInputs returns an inputs URL blob and if config settings permit, inline inputs data for an execution.

func GetLaunchPlan

func GetLaunchPlan(
	ctx context.Context, repo repoInterfaces.Repository, identifier core.Identifier) (*admin.LaunchPlan, error)

func GetLaunchPlanDigest

func GetLaunchPlanDigest(ctx context.Context, launchPlan *admin.LaunchPlan) ([]byte, error)

Returns a unique digest for functionally equivalent launch plans

func GetLaunchPlanModel

func GetLaunchPlanModel(
	ctx context.Context, repo repoInterfaces.Repository, identifier core.Identifier) (models.LaunchPlan, error)

func GetMatchableResource

func GetMatchableResource(ctx context.Context, resourceManager interfaces.ResourceInterface, resourceType admin.MatchableResource,
	project, domain, workflowName string) (*interfaces.ResourceResponse, error)

GetMatchableResource gets matchable resource for resourceType and project - domain - workflow combination. Returns nil with nothing is found or return an error

func GetNamedEntity

func GetNamedEntity(
	ctx context.Context, repo repoInterfaces.Repository, resourceType core.ResourceType, identifier admin.NamedEntityIdentifier) (*admin.NamedEntity, error)

func GetNamedEntityModel

func GetNamedEntityModel(
	ctx context.Context, repo repoInterfaces.Repository, resourceType core.ResourceType, identifier admin.NamedEntityIdentifier) (models.NamedEntity, error)

func GetNodeExecutionIdentifierFilters

func GetNodeExecutionIdentifierFilters(
	ctx context.Context, nodeExecutionIdentifier core.NodeExecutionIdentifier) ([]common.InlineFilter, error)

All inputs to this function must be validated.

func GetNodeExecutionModel

func GetNodeExecutionModel(ctx context.Context, repo repoInterfaces.Repository, nodeExecutionIdentifier *core.NodeExecutionIdentifier) (
	*models.NodeExecution, error)

func GetOutputs

func GetOutputs(ctx context.Context, urlData dataInterfaces.RemoteURLInterface,
	remoteDataConfig *runtimeInterfaces.RemoteDataConfig, storageClient *storage.DataStore, closure ExecutionClosure) (
	*core.LiteralMap, *admin.UrlBlob, error)

GetOutputs returns an outputs URL blob and if config settings permit, inline outputs data for an execution.

func GetSingleValueEqualityFilter

func GetSingleValueEqualityFilter(entity common.Entity, field, value string) (common.InlineFilter, error)

func GetTask

func GetTask(ctx context.Context, repo repoInterfaces.Repository, identifier core.Identifier) (
	*admin.Task, error)

func GetTaskDigest

func GetTaskDigest(ctx context.Context, task *core.CompiledTask) ([]byte, error)

Returns a unique digest for functionally equivalent compiled tasks

func GetTaskExecutionModel

func GetTaskExecutionModel(
	ctx context.Context, repo repoInterfaces.Repository, taskExecutionID *core.TaskExecutionIdentifier) (*models.TaskExecution, error)

func GetTaskModel

func GetTaskModel(ctx context.Context, repo repoInterfaces.Repository, taskIdentifier *core.Identifier) (
	*models.Task, error)

func GetTaskResources

GetTaskResources returns the most specific default and limit task resources for the specified id. This first checks if there is a matchable resource(s) defined, and uses the highest priority one, otherwise it falls back to using the flyteadmin default configured values.

func GetWorkflow

func GetWorkflow(
	ctx context.Context,
	repo repoInterfaces.Repository,
	store *storage.DataStore,
	identifier core.Identifier) (*admin.Workflow, error)

func GetWorkflowDigest

func GetWorkflowDigest(ctx context.Context, workflowClosure *core.CompiledWorkflowClosure) ([]byte, error)

Returns a unique digest for functionally equivalent compiled workflows

func GetWorkflowExecutionIdentifierFilters

func GetWorkflowExecutionIdentifierFilters(
	ctx context.Context, workflowExecutionIdentifier core.WorkflowExecutionIdentifier) ([]common.InlineFilter, error)

func GetWorkflowModel

func GetWorkflowModel(
	ctx context.Context, repo repoInterfaces.Repository, identifier core.Identifier) (models.Workflow, error)

func ListActiveLaunchPlanVersionsFilters

func ListActiveLaunchPlanVersionsFilters(project, domain string) ([]common.InlineFilter, error)

Returns the set of filters necessary to query launch plan models to find the active version of a launch plan

func MergeIntoExecConfig

MergeIntoExecConfig into workflowExecConfig (higher priority) from spec (lower priority) and return the new object with the merged changes. After settings project is done, can move this function back to execution manager. Currently shared with resource.

func ParseFilters

func ParseFilters(filterParams string, primaryEntity common.Entity) ([]common.InlineFilter, error)

Types

type ExecutionClosure

type ExecutionClosure interface {
	GetOutputUri() string //nolint
	GetOutputData() *core.LiteralMap
}

ExecutionClosure defines common methods in NodeExecutionClosure and TaskExecutionClosure used to return output data.

func ToExecutionClosureInterface

func ToExecutionClosureInterface(closure *admin.ExecutionClosure) ExecutionClosure

ToExecutionClosureInterface converts a workflow execution closure to an implementation of the ExecutionClosure interface for use in producing execution output data.

type FilterSpec

type FilterSpec struct {
	// All of these fields are optional (although they should not *all* be empty).
	Project        string
	Domain         string
	Name           string
	RequestFilters string
}

Jump to

Keyboard shortcuts

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