util

package
v1.1.131 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0 Imports: 27 Imported by: 2

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 added in v0.3.38

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 added in v0.3.38

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 added in v1.1.73

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 added in v1.1.67

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

func GetDescriptionEntityModel added in v1.1.67

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

func GetExecutionName

func GetExecutionName(request admin.ExecutionCreateRequest) string

func GetInputs added in v0.6.43

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 added in v0.6.119

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 added in v0.1.5

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

func GetNamedEntityModel added in v0.1.5

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 added in v0.6.43

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 added in v1.1.73

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 added in v1.1.46

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 added in v0.6.43

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

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

func ToExecutionClosureInterface added in v0.6.43

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