ancient-wolf-19325
08/01/2024, 1:36 PMexecutions, task_executions, node_executions, execution-events, and node-execution-events. As per this GitHub issue, you can focus on these tables to clean up old executions.
3. Using flytectl: While flytectl delete execution can terminate executions, it does not delete the associated data. However, you can use it to identify and manage executions. Refer to the flytectl documentation for more details.
4. Custom Scripts: You can write custom scripts to delete data from both S3 and the Flyte database. For S3, you can use the boto3 library to delete objects. For the database, you can use SQL queries to delete records. Ensure that your script handles both S3 and database deletions to maintain consistency.
Here is an example of how you might use boto3 to delete S3 objects:
import boto3
s3 = boto3.client('s3')
def delete_s3_objects(bucket_name, prefix):
response = s3.list_objects_v2(Bucket=bucket_name, Prefix=prefix)
if 'Contents' in response:
for obj in response['Contents']:
s3.delete_object(Bucket=bucket_name, Key=obj['Key'])
# Example usage
delete_s3_objects('flyte', 'data/9m/fca9028c0ffe64016afa-n3-0-n3-n1-0-n1-0/3f275b36950b20fc8436681ba76437bd/8a664494c61b5de20e002fe0618ab938')ancient-wolf-19325
08/01/2024, 1:36 PM>>Would you like more detailed steps or additional information on any of these approaches?Sources: - Flyte GitHub Issue #3596 - Flyte Discussion on S3 Lifecycle Policies - Flytectl Delete Execution Documentation Slack Link https://flyte-org.slack.com/archives/CP2HDHKE1/p1722519343.804059 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.