flyte.remote
Remote Entities that are accessible from the Union Server once deployed or created.
Directory
Classes
| Class | Description |
|---|---|
Action |
A class representing an action. |
ActionDetails |
A class representing an action. |
ActionInputs |
A class representing the inputs of an action. |
ActionOutputs |
A class representing the outputs of an action. |
Project |
A class representing a project in the Union API. |
Run |
A class representing a run of a task. |
RunDetails |
A class representing a run of a task. |
Secret |
|
Task |
Methods
| Method | Description |
|---|---|
create_channel() |
Creates a new gRPC channel with appropriate authentication interceptors. |
upload_dir() |
Uploads a directory to a remote location and returns the remote URI. |
upload_file() |
Uploads a file to a remote location and returns the remote URI. |
Methods
create_channel()
def create_channel(
endpoint: str | None,
api_key: str | None,
insecure: typing.Optional[bool],
insecure_skip_verify: typing.Optional[bool],
ca_cert_file_path: typing.Optional[str],
ssl_credentials: typing.Optional[ssl_channel_credentials],
grpc_options: typing.Optional[typing.Sequence[typing.Tuple[str, typing.Any]]],
compression: typing.Optional[grpc.Compression],
http_session: httpx.AsyncClient | None,
proxy_command: typing.Optional[typing.List[str]],
kwargs,
) -> grpc.aio._base_channel.ChannelCreates a new gRPC channel with appropriate authentication interceptors.
This function creates either a secure or insecure gRPC channel based on the provided parameters, and adds authentication interceptors to the channel. If SSL credentials are not provided, they are created based on the insecure_skip_verify and ca_cert_file_path parameters.
The function is async because it may need to read certificate files asynchronously and create authentication interceptors that perform async operations.
| Parameter | Type |
|---|---|
endpoint |
str | None |
api_key |
str | None |
insecure |
typing.Optional[bool] |
insecure_skip_verify |
typing.Optional[bool] |
ca_cert_file_path |
typing.Optional[str] |
ssl_credentials |
typing.Optional[ssl_channel_credentials] |
grpc_options |
typing.Optional[typing.Sequence[typing.Tuple[str, typing.Any]]] |
compression |
typing.Optional[grpc.Compression] |
http_session |
httpx.AsyncClient | None |
proxy_command |
typing.Optional[typing.List[str]] |
kwargs |
**kwargs |
upload_dir()
def upload_dir(
dir_path: pathlib._local.Path,
verify: bool,
) -> strUploads a directory to a remote location and returns the remote URI.
| Parameter | Type |
|---|---|
dir_path |
pathlib._local.Path |
verify |
bool |
upload_file()
def upload_file(
fp: pathlib._local.Path,
verify: bool,
) -> typing.Tuple[str, str]Uploads a file to a remote location and returns the remote URI.
| Parameter | Type |
|---|---|
fp |
pathlib._local.Path |
verify |
bool |
flyte.remote.Action
A class representing an action. It is used to manage the run of a task and its state on the remote Union API.
class Action(
pb2: run_definition_pb2.Action,
_details: ActionDetails | None,
)| Parameter | Type |
|---|---|
pb2 |
run_definition_pb2.Action |
_details |
ActionDetails | None |
Methods
| Method | Description |
|---|---|
details() |
Get the details of the action. |
done() |
Check if the action is done. |
sync() |
Sync the action with the remote server. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
wait() |
Wait for the run to complete, displaying a rich progress panel with status transitions,. |
watch() |
Watch the action for updates. |
details()
def details()Get the details of the action. This is a placeholder for getting the action details.
done()
def done()Check if the action is done.
sync()
def sync()Sync the action with the remote server. This is a placeholder for syncing the action.
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
wait()
def wait(
quiet: bool,
wait_for: WaitFor,
)Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure.
| Parameter | Type |
|---|---|
quiet |
bool |
wait_for |
WaitFor |
watch()
def watch(
cache_data_on_done: bool,
wait_for: WaitFor,
) -> AsyncGenerator[ActionDetails, None]Watch the action for updates. This is a placeholder for watching the action.
| Parameter | Type |
|---|---|
cache_data_on_done |
bool |
wait_for |
WaitFor |
Properties
| Property | Type | Description |
|---|---|---|
action_id |
None |
Get the action ID. |
name |
None |
Get the name of the action. |
phase |
None |
Get the phase of the action. |
raw_phase |
None |
Get the raw phase of the action. |
run_name |
None |
Get the name of the run. |
task_name |
None |
Get the name of the task. |
flyte.remote.ActionDetails
A class representing an action. It is used to manage the run of a task and its state on the remote Union API.
class ActionDetails(
pb2: run_definition_pb2.ActionDetails,
_inputs: ActionInputs | None,
_outputs: ActionOutputs | None,
)| Parameter | Type |
|---|---|
pb2 |
run_definition_pb2.ActionDetails |
_inputs |
ActionInputs | None |
_outputs |
ActionOutputs | None |
Methods
| Method | Description |
|---|---|
done() |
Check if the action is in a terminal state (completed or failed). |
inputs() |
Placeholder for inputs. |
logs_available() |
Check if logs are available for the action, optionally for a specific attempt. |
outputs() |
Placeholder for outputs. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
watch_updates() |
done()
def done()Check if the action is in a terminal state (completed or failed). This is a placeholder for checking the action state.
inputs()
def inputs()Placeholder for inputs. This can be extended to handle inputs from the run context.
logs_available()
def logs_available(
attempt: int | None,
) -> boolCheck if logs are available for the action, optionally for a specific attempt. If attempt is None, it checks for the latest attempt.
| Parameter | Type |
|---|---|
attempt |
int | None |
outputs()
def outputs()Placeholder for outputs. This can be extended to handle outputs from the run context.
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
watch_updates()
def watch_updates(
cache_data_on_done: bool,
) -> AsyncGenerator[ActionDetails, None]| Parameter | Type |
|---|---|
cache_data_on_done |
bool |
Properties
| Property | Type | Description |
|---|---|---|
abort_info |
None |
|
action_id |
None |
Get the action ID. |
attempts |
None |
Get the number of attempts of the action. |
error_info |
None |
|
is_running |
None |
Check if the action is currently running. |
metadata |
None |
|
name |
None |
Get the name of the action. |
phase |
None |
Get the phase of the action. |
raw_phase |
None |
Get the raw phase of the action. |
run_name |
None |
Get the name of the run. |
runtime |
None |
Get the runtime of the action. |
status |
None |
|
task_name |
None |
Get the name of the task. |
flyte.remote.ActionInputs
A class representing the inputs of an action. It is used to manage the inputs of a task and its state on the remote Union API.
class ActionInputs(
pb2: run_definition_pb2.Inputs,
data: Dict[str, Any],
)| Parameter | Type |
|---|---|
pb2 |
run_definition_pb2.Inputs |
data |
Dict[str, Any] |
Methods
| Method | Description |
|---|---|
clear() |
D. |
copy() |
|
fromkeys() |
|
get() |
D. |
items() |
D. |
keys() |
D. |
pop() |
D. |
popitem() |
D. |
setdefault() |
D. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
update() |
D. |
values() |
D. |
clear()
def clear()D.clear() -> None. Remove all items from D.
copy()
def copy()fromkeys()
def fromkeys(
iterable,
value,
)| Parameter | Type |
|---|---|
iterable |
|
value |
get()
def get(
key,
default,
)D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
| Parameter | Type |
|---|---|
key |
|
default |
items()
def items()D.items() -> a set-like object providing a view on D’s items
keys()
def keys()D.keys() -> a set-like object providing a view on D’s keys
pop()
def pop(
key,
default,
)D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
| Parameter | Type |
|---|---|
key |
|
default |
popitem()
def popitem()D.popitem() -> (k, v), remove and return some (key, value) pair as a 2-tuple; but raise KeyError if D is empty.
setdefault()
def setdefault(
key,
default,
)D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
| Parameter | Type |
|---|---|
key |
|
default |
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
update()
def update(
other,
kwds,
)D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
| Parameter | Type |
|---|---|
other |
|
kwds |
values()
def values()D.values() -> an object providing a view on D’s values
flyte.remote.ActionOutputs
A class representing the outputs of an action. It is used to manage the outputs of a task and its state on the remote Union API.
class ActionOutputs(
pb2: run_definition_pb2.Outputs,
data: Tuple[Any, ...],
)| Parameter | Type |
|---|---|
pb2 |
run_definition_pb2.Outputs |
data |
Tuple[Any, ...] |
Methods
| Method | Description |
|---|---|
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
flyte.remote.Project
A class representing a project in the Union API.
class Project(
pb2: project_pb2.Project,
)| Parameter | Type |
|---|---|
pb2 |
project_pb2.Project |
Methods
| Method | Description |
|---|---|
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
flyte.remote.Run
A class representing a run of a task. It is used to manage the run of a task and its state on the remote Union API.
class Run(
pb2: run_definition_pb2.Run,
_details: RunDetails | None,
)| Parameter | Type |
|---|---|
pb2 |
run_definition_pb2.Run |
_details |
RunDetails | None |
Methods
| Method | Description |
|---|---|
done() |
Check if the run is done. |
sync() |
Sync the run with the remote server. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
watch() |
Get the details of the run. |
done()
def done()Check if the run is done.
sync()
def sync()Sync the run with the remote server. This is a placeholder for syncing the run.
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
watch()
def watch(
cache_data_on_done: bool,
) -> AsyncGenerator[ActionDetails, None]Get the details of the run. This is a placeholder for getting the run details.
| Parameter | Type |
|---|---|
cache_data_on_done |
bool |
Properties
| Property | Type | Description |
|---|---|---|
name |
None |
Get the name of the run. |
phase |
None |
Get the phase of the run. |
raw_phase |
None |
Get the raw phase of the run. |
url |
None |
Get the URL of the run. |
flyte.remote.RunDetails
A class representing a run of a task. It is used to manage the run of a task and its state on the remote Union API.
class RunDetails(
pb2: run_definition_pb2.RunDetails,
)| Parameter | Type |
|---|---|
pb2 |
run_definition_pb2.RunDetails |
Methods
| Method | Description |
|---|---|
done() |
Check if the run is in a terminal state (completed or failed). |
inputs() |
Placeholder for inputs. |
outputs() |
Placeholder for outputs. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
done()
def done()Check if the run is in a terminal state (completed or failed). This is a placeholder for checking the run state.
inputs()
def inputs()Placeholder for inputs. This can be extended to handle inputs from the run context.
outputs()
def outputs()Placeholder for outputs. This can be extended to handle outputs from the run context.
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
Properties
| Property | Type | Description |
|---|---|---|
action_id |
None |
Get the action ID. |
name |
None |
Get the name of the action. |
task_name |
None |
Get the name of the task. |
flyte.remote.Secret
class Secret(
pb2: definition_pb2.Secret,
)| Parameter | Type |
|---|---|
pb2 |
definition_pb2.Secret |
Methods
| Method | Description |
|---|---|
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
Properties
| Property | Type | Description |
|---|---|---|
name |
None |
|
type |
None |
flyte.remote.Task
class Task(
pb2: task_definition_pb2.Task,
)| Parameter | Type |
|---|---|
pb2 |
task_definition_pb2.Task |
Methods
| Method | Description |
|---|---|
get() |
Get a task by its ID or name. |
to_dict() |
Convert the object to a JSON-serializable dictionary. |
to_json() |
Convert the object to a JSON string. |
get()
def get(
name: str,
project: str | None,
domain: str | None,
version: str | None,
auto_version: AutoVersioning | None,
) -> LazyEntityGet a task by its ID or name. If both are provided, the ID will take precedence.
Either version or auto_version are required parameters.
| Parameter | Type |
|---|---|
name |
str |
project |
str | None |
domain |
str | None |
version |
str | None |
auto_version |
AutoVersioning | None |
to_dict()
def to_dict()Convert the object to a JSON-serializable dictionary.
Returns: dict: A dictionary representation of the object.
to_json()
def to_json()Convert the object to a JSON string.
Returns: str: A JSON string representation of the object.
Properties
| Property | Type | Description |
|---|---|---|
name |
None |
The name of the task. |
version |
None |
The version of the task. |