<#3162 [WIP][Remote API] delete execution phase> P...
# flyte-github
c
#3162 [WIP][Remote API] delete execution phase Pull request opened by taieeuu ## Tracking issue ## Why are the changes needed? ## What changes were proposed in this pull request? Mainly added a delete_execution_phase method, allowing users to initiate a delete request based on the project, domain, and execution_phase parameters. ## How was this patch tested? #### 1. If you have these executions [image](https://private-user-images.githubusercontent.com/139771199/420563939-90b1ec1e-2ee4-41af-8ea3-aec8df68dba5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDE0MTM4NTQsIm5iZiI6MTc0MTQxMzU1NCwicGF0aCI6Ii8xMzk3NzExOTkvNDIwNTYzOTM5LTkwYjFlYzFlLTJlZTQtNDFhZi04ZWEzLWFlYzhkZjY4ZGJhNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMzA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDMwOFQwNTU5MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iZWZlMDlhYWI0NzYzYTc3Y2JiZjJiNjA2ZmE1NTJkZjMxOTUwMGQzZmYwYTdmM2EzNzI3ODRhZTYwNjI4MmY2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.wAqqaC84mz-Z4j77evMk8RlOZsFIXVekDq4kivERI28) #### 2. Then, you can use example.py to delete execution_phase. # example.py from flytekit import FlyteRemote from flytekit.configuration import Config PROJECT = "flytesnacks" DOMAIN = "development" config = Config.for_sandbox() remote = FlyteRemote(config=config) remote.client.delete_execution_phase(project=PROJECT, domain=DOMAIN, phase="RUNNING") And you can also use flyte-cli to delete
Copy code
(flytekit_issue)
flytekit/build/batch_delete  batch_delete ✔                                                                                                                                                              7d15h  ⍉
▶ flyte-cli -h localhost:30080 delete-execution-phase -p flytesnacks -d development -ph RUNNING
DeprecationWarning: The command 'flyte-cli' is deprecated.
Config file not found at default location, relying on environment variables instead.
                        To setup your config file run 'flyte-cli setup-config'

################################################################################################################################
# flyte-cli is being deprecated in favor of flytectl. More details about flytectl in https://docs.flyte.org/en/latest/api/flytectl/overview.html #
################################################################################################################################

Welcome to Flyte CLI! Version: 0.1.dev2135+g189b09e

Deleting phase from executions:

Project                                  Domain                                   Phase
flytesnacks                              development                              RUNNING

Successfully deleted phase from executions.
#### 3. Deleted Successfully [image](https://private-user-images.githubusercontent.com/139771199/420564023-d98206f3-57dd-4e37-9685-cac4a4196cfe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NDE0MTM4NTQsIm5iZiI6MTc0MTQxMzU1NCwicGF0aCI6Ii8xMzk3NzExOTkvNDIwNTY0MDIzLWQ5ODIwNmYzLTU3ZGQtNGUzNy05Njg1LWNhYzRhNDE5NmNmZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMzA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDMwOFQwNTU5MTRaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05MWY0NTE4N2UzZWQyOWMyODBjYjczMDVlMTk4MmJkMzJhOTNiOGE5MDg2Njc5M2Y2MTNjNTBlMzFjMDBmMGMwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.QLg2ytnNO9PaVm7YpQGz1XneH24wCrBAE3in260o1qw) #### 4. And you can check that the database's executions data has been deleted.
Copy code
flyte=# select * from executions;
 id | created_at | updated_at | deleted_at | execution_project | execution_domain | execution_name | launch_plan_id | workflow_id | task_id | phase | closure | spec | started_at | execution_created_at | execution_updated_at | duration | abort_cause | mode | source_execu
tion_id | parent_node_execution_id | cluster | inputs_uri | user_inputs_uri | error_kind | error_code | user | state | launch_entity
----+------------+------------+------------+-------------------+------------------+----------------+----------------+-------------+---------+-------+---------+------+------------+----------------------+----------------------+----------+-------------+------+-------------
--------+--------------------------+---------+------------+-----------------+------------+------------+------+-------+---------------
(0 rows)
### Setup process ### Screenshots ## Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. ## Related PRs PR 6267 ## Docs link ### Summary by Bito This PR implements a new feature for deleting execution phases in Flyte, adding functionality across client libraries, CLI interface, and remote execution components. The implementation enables phase deletion through both programmatic and command-line interfaces, with comprehensive phase validation checks. The changes include error handling for gRPC calls and consistent validation of execution phases across all interface layers. Unit tests added: False Estimated effort to review (1-5, lower is better): 1 flyteorg/flytekit