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.
Attributes
-
pb2: run_definition_pb2.Run
- run_definition_pb2.Run
-
action: Action
- Action = field(init=False)
Constructors
-
Initialize the Run object with the given run definition.
-
Parameters
- pb2: run_definition_pb2.Run
- The run definition protocol buffer.
- _details: RunDetails | None
- Optional run details.
- pb2: run_definition_pb2.Run
Methods
def listall(filters: str | None = None, sort_by: Tuple[str, Literal["asc", "desc"]]| None = None, limit: int = 100) - > AsyncIterator[[Run](src_flyte_remote__run_run)]
-
Get all runs for the current project and domain.
-
Parameters
- filters: str | None
- The filters to apply to the project list.
- sort_by: Tuple[str, Literal["asc", "desc"]]| None
- The sorting criteria for the project list, in the format (field, order).
- limit: int
- The maximum number of runs to return.
- filters: str | None
-
Return Value: AsyncIterator[Run]
- An iterator of runs.
def get(name: str) - > [Run](src_flyte_remote__run_run)
-
Get the current run.
-
Parameters
- name: str
- The name of the run to retrieve.
- name: str
-
Return Value: Run
- The current run.
def name()
-
Get the name of the run.
-
Return Value: str
- The name of the run.
def phase()
-
Get the phase of the run.
-
Return Value: str
- The phase of the run.
def raw_phase()
-
Get the raw phase of the run.
-
Return Value: run_definition_pb2.Phase
- The raw phase of the run.
def wait(quiet: bool = False, wait_for: Literal["terminal", "running"] = "terminal") - > None
-
Wait for the run to complete, displaying a rich progress panel with status transitions, time elapsed, and error details in case of failure.
-
Parameters
- quiet: bool
- If True, suppress progress output.
- wait_for: Literal["terminal", "running"]
- The condition to wait for. Can be 'terminal' (completed or failed) or 'running'.
- quiet: bool
-
Return Value: None
def watch(cache_data_on_done: bool = False) - > AsyncGenerator[[ActionDetails](src_flyte_remote__action_actiondetails), None]
-
Get the details of the run. This is a placeholder for getting the run details.
-
Parameters
- cache_data_on_done: bool
- Whether to cache data when the run is done.
- cache_data_on_done: bool
-
Return Value: AsyncGenerator[ActionDetails, None]
- An asynchronous generator yielding ActionDetails.
def show_logs(attempt: int | None = None, max_lines: int = 100, show_ts: bool = False, raw: bool = False, filter_system: bool = False) - > None
-
Fetches and displays logs for a specific run attempt. Supports filtering and formatting options.
-
Parameters
- attempt: int | None
- The specific attempt number to fetch logs for. If None, fetches logs for the latest attempt.
- max_lines: int
- The maximum number of log lines to retrieve.
- show_ts: bool
- Whether to include timestamps in the log output.
- raw: bool
- Whether to retrieve raw log output without any formatting.
- filter_system: bool
- Whether to filter out system-generated log messages.
- attempt: int | None
-
Return Value: None
def details()
-
Get the details of the run. This is a placeholder for getting the run details.
-
Return Value: RunDetails
- The detailed information about the run.
def url()
-
Get the URL of the run.
-
Return Value: str
- The URL of the run.
def abort()
-
Aborts / Terminates the run.
-
Return Value: None
def done()
-
Check if the run is done.
-
Return Value: bool
- True if the run is done, False otherwise.
def sync()
-
Sync the run with the remote server. This is a placeholder for syncing the run.
-
Return Value: Run
- The current Run object, synced with the remote server.