flytekit
flytekit copied to clipboard
[WIP][Remote API] delete execution phase
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
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
(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
4. And you can check that the database's executions data has been deleted.
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
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