Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 9 additions & 29 deletions metaflow/plugins/argo/argo_workflows_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@

def suspend(instance: TriggeredRun, **kwargs):
"""
Suspend a running workflow.
Suspend the running workflow.

Parameters
----------
instance : TriggeredRun
The triggered run instance to suspend.
**kwargs : Any
Additional arguments to pass to the suspend command.

Expand Down Expand Up @@ -51,12 +49,10 @@ def suspend(instance: TriggeredRun, **kwargs):

def unsuspend(instance: TriggeredRun, **kwargs):
"""
Unsuspend a suspended workflow.
Unsuspend the suspended workflow.

Parameters
----------
instance : TriggeredRun
The triggered run instance to unsuspend.
**kwargs : Any
Additional arguments to pass to the unsuspend command.

Expand Down Expand Up @@ -88,12 +84,10 @@ def unsuspend(instance: TriggeredRun, **kwargs):

def terminate(instance: TriggeredRun, **kwargs):
"""
Terminate a running workflow.
Terminate the running workflow.

Parameters
----------
instance : TriggeredRun
The triggered run instance to terminate.
**kwargs : Any
Additional arguments to pass to the terminate command.

Expand Down Expand Up @@ -125,12 +119,7 @@ def terminate(instance: TriggeredRun, **kwargs):

def status(instance: TriggeredRun):
"""
Get the status of a triggered run.

Parameters
----------
instance : TriggeredRun
The triggered run instance to get the status of.
Get the status of the triggered run.

Returns
-------
Expand All @@ -151,12 +140,7 @@ def status(instance: TriggeredRun):

def production_token(instance: DeployedFlow):
"""
Get the production token for a deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to get the production token for.
Get the production token for the deployed flow.

Returns
-------
Expand All @@ -174,12 +158,10 @@ def production_token(instance: DeployedFlow):

def delete(instance: DeployedFlow, **kwargs):
"""
Delete a deployed flow.
Delete the deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to delete.
**kwargs : Any
Additional arguments to pass to the delete command.

Expand Down Expand Up @@ -208,18 +190,16 @@ def delete(instance: DeployedFlow, **kwargs):

def trigger(instance: DeployedFlow, **kwargs):
"""
Trigger a new run for a deployed flow.
Trigger a new run for the deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to trigger a new run for.
**kwargs : Any
Additional arguments to pass to the trigger command.
Additional arguments to pass to the trigger command, `Parameters` in particular

Returns
-------
TriggeredRun
ArgoWorkflowsTriggeredRun
The triggered run instance.

Raises
Expand Down
29 changes: 8 additions & 21 deletions metaflow/plugins/aws/step_functions/step_functions_deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@

def terminate(instance: TriggeredRun, **kwargs):
"""
Terminate a running workflow.
Terminate the running workflow.

Parameters
----------
instance : TriggeredRun
The triggered run instance to terminate.
**kwargs : Any
Additional arguments to pass to the terminate command.

Expand Down Expand Up @@ -52,12 +50,7 @@ def terminate(instance: TriggeredRun, **kwargs):

def production_token(instance: DeployedFlow):
"""
Get the production token for a deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to get the production token for.
Get the production token for the deployed flow.

Returns
-------
Expand All @@ -75,15 +68,13 @@ def production_token(instance: DeployedFlow):

def list_runs(instance: DeployedFlow, states: Optional[List[str]] = None):
"""
List runs of a deployed flow.
List runs of the deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to list runs for.
states : Optional[List[str]], optional
A list of states to filter the runs by. Allowed values are:
"RUNNING", "SUCCEEDED", "FAILED", "TIMED_OUT", "ABORTED".
RUNNING, SUCCEEDED, FAILED, TIMED_OUT, ABORTED.
If not provided, all states will be considered.

Returns
Expand Down Expand Up @@ -134,12 +125,10 @@ def list_runs(instance: DeployedFlow, states: Optional[List[str]] = None):

def delete(instance: DeployedFlow, **kwargs):
"""
Delete a deployed flow.
Delete the deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to delete.
**kwargs : Any
Additional arguments to pass to the delete command.

Expand Down Expand Up @@ -168,18 +157,16 @@ def delete(instance: DeployedFlow, **kwargs):

def trigger(instance: DeployedFlow, **kwargs):
"""
Trigger a new run for a deployed flow.
Trigger a new run for the deployed flow.

Parameters
----------
instance : DeployedFlow
The deployed flow instance to trigger a new run for.
**kwargs : Any
Additional arguments to pass to the trigger command.
Additional arguments to pass to the trigger command, `Parameters` in particular

Returns
-------
TriggeredRun
StepFunctionsTriggeredRun
The triggered run instance.

Raises
Expand Down
26 changes: 12 additions & 14 deletions metaflow/runner/deployer.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ def get_lower_level_group(

class Deployer(object):
"""
Deployer class for managing deployment of flows using different provider implementations.

This class dynamically adds methods for each deployment provider available in
`DEPLOYER_IMPL_PROVIDERS`.
Use the `Deployer` class to configure and access one of the production
orchestrators supported by Metaflow.

Parameters
----------
Expand Down Expand Up @@ -165,14 +163,10 @@ def f(self, **deployer_kwargs):

class TriggeredRun(object):
"""
TriggeredRun class represents a run that has been triggered for deployment.
TriggeredRun class represents a run that has been triggered on a production orchestrator.

Parameters
----------
deployer : DeployerImpl
Instance of the deployer implementation.
content : str
JSON content containing metadata and pathspec for the run.
Only when the `start` task starts running, the `run` object corresponding to the run
becomes available.
"""

def __init__(
Expand Down Expand Up @@ -206,12 +200,15 @@ def _enrich_object(self, env):
@property
def run(self):
"""
Retrieve the Run object for the triggered run.
Retrieve the `Run` object for the triggered run.

Note that Metaflow `Run` becomes available only when the `start` task
has started executing.

Returns
-------
Run, optional
Metaflow Run object if available else None.
Metaflow Run object if the `start` step has started executing, otherwise None.
"""
from metaflow import Run

Expand Down Expand Up @@ -322,7 +319,8 @@ def create(self, **kwargs) -> DeployedFlow:
Parameters
----------
**kwargs : Any
Additional arguments to pass to the `create` method of the deployer implementation.
Additional arguments to pass to `create` corresponding to the
command line arguments of `create`

Returns
-------
Expand Down