Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default execution name should be generated in flyteadmin #2678

Merged
16 changes: 6 additions & 10 deletions flytekit/clients/friendly.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,12 +537,11 @@ def update_named_entity(self, resource_type, id, metadata):
#
####################################################################################################################

def create_execution(self, project, domain, name, execution_spec, inputs):
def create_execution(self, project, domain, execution_spec, inputs):
"""
This will create an execution for the given execution spec.
:param Text project:
:param Text domain:
:param Text name:
:param flytekit.models.execution.ExecutionSpec execution_spec: This is the specification for the execution.
:param flytekit.models.literals.LiteralMap inputs: The inputs for the execution
:returns: The unique identifier for the execution.
Expand All @@ -554,24 +553,23 @@ def create_execution(self, project, domain, name, execution_spec, inputs):
_execution_pb2.ExecutionCreateRequest(
project=project,
domain=domain,
name=name,
name="",
spec=execution_spec.to_flyte_idl(),
inputs=inputs.to_flyte_idl(),
)
)
.id
)

def recover_execution(self, id, name: str = None):
def recover_execution(self, id):
"""
Recreates a previously-run workflow execution that will only start executing from the last known failure point.
:param flytekit.models.core.identifier.WorkflowExecutionIdentifier id:
:param name str: Optional name to assign to the newly created execution.
:rtype: flytekit.models.core.identifier.WorkflowExecutionIdentifier
"""
return _identifier.WorkflowExecutionIdentifier.from_flyte_idl(
super(SynchronousFlyteClient, self)
.recover_execution(_execution_pb2.ExecutionRecoverRequest(id=id.to_flyte_idl(), name=name))
.recover_execution(_execution_pb2.ExecutionRecoverRequest(id=id.to_flyte_idl(), name=""))
.id
)

Expand Down Expand Up @@ -650,17 +648,15 @@ def terminate_execution(self, id, cause):
_execution_pb2.ExecutionTerminateRequest(id=id.to_flyte_idl(), cause=cause)
)

def relaunch_execution(self, id, name=None):
def relaunch_execution(self, id):
"""
:param flytekit.models.core.identifier.WorkflowExecutionIdentifier id:
:param Text name: [Optional] name for the new execution. If not specified, a randomly generated name will be
used
:returns: The unique identifier for the new execution.
:rtype: flytekit.models.core.identifier.WorkflowExecutionIdentifier
"""
return _identifier.WorkflowExecutionIdentifier.from_flyte_idl(
super(SynchronousFlyteClient, self)
.relaunch_execution(_execution_pb2.ExecutionRelaunchRequest(id=id.to_flyte_idl(), name=name))
.relaunch_execution(_execution_pb2.ExecutionRelaunchRequest(id=id.to_flyte_idl(), name=""))
.id
)

Expand Down
6 changes: 2 additions & 4 deletions flytekit/clis/flyte_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ def update_launch_plan(state, host, insecure, urn=None):
@_optional_name_option
@_host_option
@_insecure_option
def recover_execution(urn, name, host, insecure):
def recover_execution(urn, host, insecure):
"""
Recreates a previously-run workflow execution that will only start executing from the last known failure point.

Expand All @@ -1100,8 +1100,6 @@ def recover_execution(urn, name, host, insecure):
- downstream system failures (downstream services)
- or simply to recover executions that failed because of retry exhaustion and should complete if tried again.

You can optionally assign a name to the recreated execution you trigger or let the system assign one.

Usage:
$ flyte-cli recover-execution -u ex:flyteexamples:development:some-workflow:abc123 -n my_retry_name

Expand All @@ -1115,7 +1113,7 @@ def recover_execution(urn, name, host, insecure):

original_workflow_execution_identifier = cli_identifiers.WorkflowExecutionIdentifier.from_python_std(urn)

execution_identifier_resp = client.recover_execution(id=original_workflow_execution_identifier, name=name)
execution_identifier_resp = client.recover_execution(id=original_workflow_execution_identifier)
execution_identifier = cli_identifiers.WorkflowExecutionIdentifier.promote_from_model(execution_identifier_resp)
click.secho("Launched execution: {}".format(execution_identifier), fg="blue")
click.echo("")
Expand Down
1 change: 0 additions & 1 deletion flytekit/clis/sdk_in_container/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,6 @@ def run_remote(
inputs=inputs,
project=project,
domain=domain,
execution_name=run_level_params.name,
wait=run_level_params.wait_execution,
options=options_from_run_params(run_level_params),
type_hints=type_hints,
Expand Down
Loading
Loading