-
Notifications
You must be signed in to change notification settings - Fork 320
[WIP][Remote API] delete execution phase #3162
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -416,6 +416,13 @@ def terminate_execution(self, terminate_execution_request): | |||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
return self._stub.TerminateExecution(terminate_execution_request, metadata=self._metadata) | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
def delete_execution_phase(self, delete_execution_phase_request): | ||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
:param flyteidl.admin.execution_pb2.DeleteExecutionPhaseRequest delete_execution_phase_request: | ||||||||||||||||||||||||||||||||||
:rtype: flyteidl.admin.execution_pb2.DeleteExecutionPhaseResponse | ||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
return self._stub.DeleteExecutionPhase(delete_execution_phase_request, metadata=self._metadata) | ||||||||||||||||||||||||||||||||||
Comment on lines
+419
to
+424
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding gRPC error handling
Consider adding error handling for potential gRPC exceptions in the Code suggestionCheck the AI-generated fix before applying
Suggested change
Code Review Run #3b0d37 Should Bito avoid suggestions like this for future reviews? (Manage Rules)
|
||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
def relaunch_execution(self, relaunch_execution_request): | ||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||
:param flyteidl.admin.execution_pb2.ExecutionRelaunchRequest relaunch_execution_request: | ||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1170,6 +1170,36 @@ def terminate_execution(host, insecure, cause, urn=None): | |||||||||||||||
_terminate_one_execution(client, urn, cause) | ||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
@_flyte_cli.command("delete-execution-phase", cls=_FlyteSubCommand) | ||||||||||||||||
@_host_option | ||||||||||||||||
@_insecure_option | ||||||||||||||||
@click.option("-p", "--project", required=True, help="Project to delete execution phase from") | ||||||||||||||||
@click.option("-d", "--domain", required=True, help="Domain to delete execution phase from") | ||||||||||||||||
@click.option("-ph", "--phase", required=True, help="Phase to delete") | ||||||||||||||||
def delete_execution_phase(host, insecure, project, domain, phase): | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding phase parameter validation
Consider adding validation for the Code suggestionCheck the AI-generated fix before applying
Suggested change
Code Review Run #3b0d37 Should Bito avoid suggestions like this for future reviews? (Manage Rules)
|
||||||||||||||||
""" | ||||||||||||||||
Delete a phase from executions. This command deletes a phase from executions | ||||||||||||||||
in the specified project and domain. | ||||||||||||||||
|
||||||||||||||||
e.g., | ||||||||||||||||
$ flyte-cli -h localhost:30081 delete-execution-phase \ | ||||||||||||||||
-p flyteexamples -d development -ph RUNNING | ||||||||||||||||
""" | ||||||||||||||||
_welcome_message() | ||||||||||||||||
client = _get_client(host, insecure) | ||||||||||||||||
|
||||||||||||||||
click.echo("Deleting phase from executions:\n") | ||||||||||||||||
click.echo("{:40} {:40} {:40}".format("Project", "Domain", "Phase")) | ||||||||||||||||
click.echo("{:40} {:40} {:40}".format(project, domain, phase)) | ||||||||||||||||
|
||||||||||||||||
try: | ||||||||||||||||
client.delete_execution_phase(project, domain, phase) | ||||||||||||||||
click.echo("\nSuccessfully deleted phase from executions.") | ||||||||||||||||
except Exception as e: | ||||||||||||||||
click.echo(f"\nFailed to delete phase from executions: {str(e)}") | ||||||||||||||||
sys.exit(1) | ||||||||||||||||
|
||||||||||||||||
|
||||||||||||||||
@_flyte_cli.command("list-executions", cls=_FlyteSubCommand) | ||||||||||||||||
@_project_option | ||||||||||||||||
@_domain_option | ||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -2677,6 +2677,18 @@ def terminate(self, execution: FlyteWorkflowExecution, cause: str): | |||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||||
self.client.terminate_execution(execution.id, cause) | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
############################# | ||||||||||||||||||||||||||||||||||||
# Delete Execution Phase # | ||||||||||||||||||||||||||||||||||||
############################# | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
def delete_execution_phase(self, execution: FlyteWorkflowExecution, phase: str): | ||||||||||||||||||||||||||||||||||||
"""Delete a phase from executions. | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
:param execution: workflow execution to delete phase from | ||||||||||||||||||||||||||||||||||||
:param phase: phase to delete | ||||||||||||||||||||||||||||||||||||
""" | ||||||||||||||||||||||||||||||||||||
self.client.delete_execution_phase(execution.id.project, execution.id.domain, phase) | ||||||||||||||||||||||||||||||||||||
Comment on lines
+2684
to
+2690
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider adding phase parameter validation
Consider validating the Code suggestionCheck the AI-generated fix before applying
Suggested change
Code Review Run #3b0d37 Should Bito avoid suggestions like this for future reviews? (Manage Rules)
|
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
############ | ||||||||||||||||||||||||||||||||||||
# Projects # | ||||||||||||||||||||||||||||||||||||
############ | ||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider validating the
phase
parameter against allowed execution phases before making the delete request. This could help catch invalid phase values early.Code suggestion
Code Review Run #3b0d37
Should Bito avoid suggestions like this for future reviews? (Manage Rules)