flytekit.remote.remote.FlyteRemote

class flytekit.remote.remote.FlyteRemote(flyte_admin_url, insecure, default_project=None, default_domain=None, file_access=None, auth_role=None, notifications=None, labels=None, annotations=None, image_config=None, raw_output_data_config=None, grpc_credentials=None)[source]

Main entrypoint for programmatically accessing a Flyte remote backend.

The term ‘remote’ is synonymous with ‘backend’ or ‘deployment’ and refers to a hosted instance of the Flyte platform, which comes with a Flyte Admin server on some known URI.

Warning

This feature is in beta.

Initialize a FlyteRemote object.

Parameters
  • flyte_admin_url (str) – url pointing to the remote backend.

  • insecure (bool) – whether or not the enable SSL.

  • default_project (typing.Optional[str]) – default project to use when fetching or executing flyte entities.

  • default_domain (typing.Optional[str]) – default domain to use when fetching or executing flyte entities.

  • file_access (typing.Optional[FileAccessProvider]) – file access provider to use for offloading non-literal inputs/outputs.

  • auth_role (typing.Optional[flytekit.models.admin.common.AuthRole]) – auth role config

  • notifications (typing.Optional[typing.List[admin_common_models.Notification]]) – notification config

  • labels (typing.Optional[admin_common_models.Labels]) – label config

  • annotations (typing.Optional[admin_common_models.Annotations]) – annotation config

  • image_config (typing.Optional[ImageConfig]) – image config

  • raw_output_data_config (typing.Optional[admin_common_models.RawOutputDataConfig]) – location for offloaded data, e.g. in S3

  • grpc_credentials (typing.Optional[grpc.ChannelCredentials]) – gRPC channel credentials for connecting to flyte admin as returned by grpc.ssl_channel_credentials()

Methods

execute(entity, inputs, project=None, domain=None, name=None, version=None, execution_name=None, wait=False)[source]

Execute a task, workflow, or launchplan.

This method supports: - Flyte{Task, Workflow, LaunchPlan} remote module objects. - @task-decorated functions and TaskTemplate tasks. - @workflow-decorated functions. - LaunchPlan objects.

Parameters
Return type

flytekit.remote.workflow_execution.FlyteWorkflowExecution

fetch_launch_plan(project=None, domain=None, name=None, version=None)[source]

Fetch a launchplan entity from flyte admin.

Parameters
  • project (Optional[str]) – fetch entity from this project. If None, uses the default_project attribute.

  • domain (Optional[str]) – fetch entity from this domain. If None, uses the default_domain attribute.

  • name (Optional[str]) – fetch entity with matching name.

  • version (Optional[str]) – fetch entity with matching version. If None, gets the latest version of the entity.

Returns

FlyteLaunchPlan

Raises

FlyteAssertion if name is None

Return type

flytekit.remote.launch_plan.FlyteLaunchPlan

fetch_task(project=None, domain=None, name=None, version=None)[source]

Fetch a task entity from flyte admin.

Parameters
  • project (Optional[str]) – fetch entity from this project. If None, uses the default_project attribute.

  • domain (Optional[str]) – fetch entity from this domain. If None, uses the default_domain attribute.

  • name (Optional[str]) – fetch entity with matching name.

  • version (Optional[str]) – fetch entity with matching version. If None, gets the latest version of the entity.

Returns

FlyteTask

Raises

FlyteAssertion if name is None

Return type

flytekit.remote.tasks.task.FlyteTask

fetch_workflow(project=None, domain=None, name=None, version=None)[source]

Fetch a workflow entity from flyte admin.

Parameters
  • project (Optional[str]) – fetch entity from this project. If None, uses the default_project attribute.

  • domain (Optional[str]) – fetch entity from this domain. If None, uses the default_domain attribute.

  • name (Optional[str]) – fetch entity with matching name.

  • version (Optional[str]) – fetch entity with matching version. If None, gets the latest version of the entity.

Returns

FlyteWorkflow

Raises

FlyteAssertion if name is None

Return type

flytekit.remote.workflow.FlyteWorkflow

fetch_workflow_execution(project=None, domain=None, name=None)[source]

Fetch a workflow execution entity from flyte admin.

Parameters
  • project (Optional[str]) – fetch entity from this project. If None, uses the default_project attribute.

  • domain (Optional[str]) – fetch entity from this domain. If None, uses the default_domain attribute.

  • name (Optional[str]) – fetch entity with matching name.

Returns

FlyteWorkflowExecution

Raises

FlyteAssertion if name is None

Return type

flytekit.remote.workflow_execution.FlyteWorkflowExecution

classmethod from_config(default_project=None, default_domain=None, config_file_path=None, grpc_credentials=None)[source]

Create a FlyteRemote object using flyte configuration variables and/or environment variable overrides.

Parameters
  • default_project (Optional[str]) – default project to use when fetching or executing flyte entities.

  • default_domain (Optional[str]) – default domain to use when fetching or executing flyte entities.

  • config_file_path (Optional[str]) – config file to use when connecting to flyte admin. we will use ‘~/.flyte/config’ by default.

  • grpc_credentials (Optional[grpc.ChannelCredentials]) – gRPC channel credentials for connecting to flyte admin as returned by grpc.ssl_channel_credentials()

Return type

flytekit.remote.remote.FlyteRemote

list_tasks_by_version(version, project=None, domain=None, limit=100)[source]
Parameters
  • version (str) –

  • project (Optional[str]) –

  • domain (Optional[str]) –

  • limit (Optional[int]) –

Return type

List[flytekit.remote.tasks.task.FlyteTask]

recent_executions(project=None, domain=None, limit=100)[source]
Parameters
  • project (Optional[str]) –

  • domain (Optional[str]) –

  • limit (Optional[int]) –

Return type

List[flytekit.remote.workflow_execution.FlyteWorkflowExecution]

register(entity, project=None, domain=None, name=None, version=None)[source]

Register an entity to flyte admin.

Parameters
  • entity (Union[flytekit.core.base_task.PythonTask, flytekit.core.workflow.WorkflowBase, flytekit.core.launch_plan.LaunchPlan]) – entity to register.

  • project (str) – register entity into this project. If None, uses default_project attribute

  • domain (str) – register entity into this domain. If None, uses default_domain attribute

  • name (str) – register entity with this name. If None, uses entity.name

  • version (str) – register entity with this version. If None, uses auto-generated version.

Return type

Union[flytekit.remote.tasks.task.FlyteTask, flytekit.remote.workflow.FlyteWorkflow, flytekit.remote.launch_plan.FlyteLaunchPlan]

remote_context()[source]

Context manager with remote-specific configuration.

sync(execution, entity_definition=None, sync_nodes=True)[source]

This function was previously a singledispatchmethod. We’ve removed that but this function remains so that we don’t break people.

Parameters
Returns

Returns the same execution object, but with additional information pulled in.

Return type

flytekit.remote.workflow_execution.FlyteWorkflowExecution

sync_node_execution(execution, entity_definition=None)[source]

Sync a FlyteNodeExecution object with its corresponding remote state.

Parameters
Return type

flytekit.remote.nodes.FlyteNodeExecution

sync_task_execution(execution, entity_definition=None)[source]

Sync a FlyteTaskExecution object with its corresponding remote state.

Parameters
Return type

flytekit.remote.tasks.executions.FlyteTaskExecution

sync_workflow_execution(execution, entity_definition=None, sync_nodes=True)[source]

Sync a FlyteWorkflowExecution object with its corresponding remote state.

Parameters
Return type

flytekit.remote.workflow_execution.FlyteWorkflowExecution

terminate(execution, cause)[source]

Terminate a workflow execution.

Parameters
wait(execution, timeout=None, poll_interval=None, sync_nodes=True)[source]

Wait for an execution to finish.

Parameters
Return type

flytekit.remote.workflow_execution.FlyteWorkflowExecution

with_overrides(default_project=None, default_domain=None, flyte_admin_url=None, insecure=None, file_access=None, auth_role=None, notifications=None, labels=None, annotations=None, image_config=None, raw_output_data_config=None)[source]

Create a copy of the remote object, overriding the specified attributes.

Parameters
  • default_project (Optional[str]) –

  • default_domain (Optional[str]) –

  • flyte_admin_url (Optional[str]) –

  • insecure (Optional[bool]) –

  • file_access (Optional[flytekit.core.data_persistence.FileAccessProvider]) –

  • auth_role (Optional[flytekit.models.admin.common.AuthRole]) –

  • notifications (Optional[List[flytekit.models.admin.common.Notification]]) –

  • labels (Optional[flytekit.models.admin.common.Labels]) –

  • annotations (Optional[flytekit.models.admin.common.Annotations]) –

  • image_config (Optional[flytekit.core.context_manager.ImageConfig]) –

  • raw_output_data_config (Optional[flytekit.models.admin.common.RawOutputDataConfig]) –

Attributes

annotations

Annotation config.

auth_role

Auth role config.

client

Return a SynchronousFlyteClient for additional operations.

default_domain

Default project to use when fetching or executing flyte entities.

default_project

Default project to use when fetching or executing flyte entities.

file_access

File access provider to use for offloading non-literal inputs/outputs.

image_config

Image config.

labels

Label config.

notifications

Notification config.

raw_output_data_config

Location for offloaded data, e.g. in S3

version

Get a randomly generated version string.