<#3338 Add remote workflow execution support to py...
# flyte-github
a
#3338 Add remote workflow execution support to pyflyte run Pull request opened by CtfChan ## Tracking issue N/A ## Why are the changes needed? Currently, the
pyflyte run
command supports executing remote tasks (
remote-task
) and remote launch plans (
remote-launchplan
), but lacks support for executing remote workflows directly. This creates an inconsistent user experience and limits flexibility when users want to execute workflows that are already registered in a Flyte backend. ## What changes were proposed in this pull request? This PR adds support for executing remote workflows via the
pyflyte run remote-workflow
command, bringing feature parity with the existing remote task and launch plan execution capabilities. Changes include: 1. Added
WORKFLOW_LAUNCHER
constant to
DynamicEntityLaunchCommand
class 2. Updated
_fetch_entity()
method to handle the workflow launcher type by calling
fetch_workflow()
on the remote instance 3. Added support for version-specific workflow execution using the
name:version
syntax 4. Updated
get_command()
in
RemoteEntityGroup
to create a
DynamicEntityLaunchCommand
with the workflow launcher when the command is
remote-workflow
5. Added comprehensive unit tests (
test_remote_workflow
and
test_remote_workflow_with_version
) to verify the functionality ## How was this patch tested? Added two new unit tests in `tests/flytekit/unit/cli/pyflyte/test_run.py`: 1.
test_remote_workflow
: Tests basic remote workflow execution with parameters 2.
test_remote_workflow_with_version
: Tests version-specific workflow execution using the
name:version
syntax Both tests: • Mock
FlyteRemote
and
run_remote
to verify correct behavior • Use the
CliRunner
to simulate command-line execution • Verify that
fetch_workflow()
is called with the correct arguments • Ensure the workflow executes successfully with provided inputs All tests pass successfully:
Copy code
pytest tests/flytekit/unit/cli/pyflyte/test_run.py::test_remote_workflow tests/flytekit/unit/cli/pyflyte/test_run.py::test_remote_workflow_with_version -v
### Setup process N/A ### Screenshots N/A ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs N/A ## Docs link N/A https://bito.ai#summarystart| ### Summary by Bito This pull request enhances the pyflyte run command by enabling the execution of remote workflows, introducing a WORKFLOW_LAUNCHER constant, and modifying the _fetch_entity method for workflow compatibility. It also supports version-specific workflows and includes comprehensive unit tests for reliability. flyteorg/flytekit